Menu

SQLParser_Implemented

silex6
There is a newer version of this page. You can find it here.

SQL Parser

Goal of the SQL parser is to convert some SQL source code to an internal representation. The current implementation convert the source code to a set of objects using classes implemented in the runtime package.

The current implementation use the ANTLR tool - a parser generator. With ANTLR, a configuration file define the vocabulary and the grammar rules for the language. The tool then generate the source code of the parser that will parse a text and retrieve the different rules used in the SQL source code. When parsing a source text, the ANTLR runtime will call a visitor method for each grammar rules used in the source code.

SQL parser is included in org.whitebear.sql package and is currently under development

Main classes

  • SqlVisitor define the available visitor methods - interface file generated by ANTLR
  • Translator, StatementTranslator, and ExpressionTranslator. Implements the interface above - the visitor methods that instantiate objects of the runtime package - internal representation of the related SQL construct