Develop a handwritten parser that is able to parse SQL commands defined in the "operations.sql" into a simple Abstract Syntax Tree (AST). It does not have to support all features that are available in SQL but only the ones used by the example SQL file.
USE, SELECT, FROM, WHERE, IS, NOT, NULL, ORDER, BY, INSERT, INTO, VALUES, DELETE, FROM, WHERE, XOR, AND, OR, MOD, DIV
not all grammar of the keywords are supported!
- git clone https://github.com/testbuddy/GetASTFromSQL.git
- cd GetASTFromSQL
- npm install
- npm run build
npm start -- -i 'input.sql' -o 'output.json'
input.sql - here the path to input file
output.json - here the path to the output file
'--' <- very important dont skip!