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:

  1. 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.
  2. A class SQLSyntaxError is thrown in yyabandon and is caught in SQLParse::parse. It has no other function.
  3. Parse.cpp and have been removed from the Vulcan CVS tree. Bison is now required to build Vulcan.
  4. has been renamed parse.h so makefile dependencies work
  5. 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.
  6. 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.