Vulcan - Dsql Parser
From Jim Starkey on the Firebird Development List 11th March 2004
Vulcan now has a thread safe, re-entrant, encapsulated DSQL parser. In the process of converting it, I have eliminated the calls to fetch thread specific data on every memory allocations. To make it all work, I did the following:
- A class SQLParse controls the parser. It contains all initialiation code, all allocation code, and lexical code, and the actual calls to the Bison generated "pure" parser. SQLParse also keeps a linked list of all syntax nodes allocated, which are deleted by the SQLParse destructor.
- A class SQLSyntaxError is thrown in yyabandon and is caught in SQLParse::parse. It has no other function.
- Parse.cpp and dsql.tab.h have been removed from the Vulcan CVS tree. Bison is now required to build Vulcan.
- Dsql.tab.h has been renamed parse.h so makefile dependencies work
- The "sed" mangling step has been eliminated from the build. Bison is now the only non-native Windows utility required to build Vulcan on Windows.
- The only changes to the actual parse code was around some lookahead which copies the parse state. The code in question is probably unsupportable, and should be replaced with proper Bison productions.
I don't know what version of Bison is required. The oldest I have around is 1.28, which works just fine.