To run the parser, run make
then run ./SQLPParser
. An example of a test input is select s.name from student s where s.name = "John";
. Currently a syntax error will be reported when the semi-colon is read, but the parse tree that is outputted is correct.
The grammar is located in SQLPGrammar.y
, and non-keyword types (such as INTEGER
, IDENTIFIER
, STRING
) are defined in SQLPScanner.l
. util.c
contains the functions needed to build the con cell structure.
A common way of defining the behavior of a process or thread in cases where performance is critical is in terms of a collection of n+1 files containing code in the C programming language: n "module" files with a ".c" suffix that contain the bodies of C functions and procedures, and one additional shared file with a ".h" suffix that contains definitions of C global variables and types that are used by each of the module files. LDI, short for "logical data integration", is a collection of tools that make it possible to define this behavior in another way. First, the ".h" file is replaced with a relational database schema that abstracts all data relevant to the process or threads. This includes all local heap-memory data with the low level interface defined by the ".h" file. And second, each of the ".c" module files is replaced with a ".sql" version in which all data manipulation in the bodies of C functions and procedures is re-coded by using a variant of the static embedded SQL protocol.
Note that each of the tools comprising the LDI system define the behavior of such a process or thread, and are therefore also coded in this manner. Thus, the tools themselves are benchmarks for their own evaluation.