This is a basic SQL parser that can parse and show output for the following statements:
- Create table table-name();
- Insert into table-name values();
- Select * from table-name where condition;
- Select count( * ) from table-name where condition;
- Drop table table-name;
- Flex
- Bison
- g++
For Windows:
You'll need the latest versions of:
Do a full install in a directory of your preference without spaces in the name because bison has problems with spaces in directory names.
Suggested directory:
C:\GnuWin32
Set PATH variable to include the bin directories of flex/bison: C:\GnuWin32\bin
Set PATH variable to include C:\MinGW\bin
For Linux:
$ yum install flex
$ yum install bison
If gcc and/or g++ and its related Development Tools are not installed in your system by default, you can install the latest available from the repositories as follows:
$ yum groupinstall 'Development tools'
$ flex sql.l
$ bison -dy sql.y
$ g++ lex.yy.c y.tab.c -o sql.exe
To execute, run sql.exe