public class PlsqlTreeGenerator extends java.lang.Object implements PlsqlSyntaxCodes, SyntaxListener
The TreeGenerator is the glue between the SyntaxRecognizer and the SymbolFactory. When a syntax token indicates a new element, we create a new parse tree node. When a syntax token indicates the close of an element, we finish off the corresponding parse tree node. For details and specifics of the underlying parse data structure, see the JavaSymbolFactory.
The idea is to generate the entire tree by maintaining a single stack. Start by pushing a root node onto the stack and generate the rest of the tree in an in-order depth-first fashion.
JavaSyntaxRecognizer
,
JavaSymbolFactory
,
PlsqlSymbol
SYNTAX_ARGUMENTS, SYNTAX_BLOCK, SYNTAX_BLOCK_STATEMENT, SYNTAX_CURSOR_DECL, SYNTAX_DATATYPE, SYNTAX_ELSE_CLAUSE, SYNTAX_ELSIF_CLAUSE, SYNTAX_EXCEPTION_HANDLER, SYNTAX_EXP_INNER, SYNTAX_EXP_MIDDLE, SYNTAX_EXP_OUTER, SYNTAX_EXP_STATEMENT, SYNTAX_EXPRESSION, SYNTAX_FOR_LOOP, SYNTAX_FUNCTION, SYNTAX_IF_STATEMENT, SYNTAX_INFIX_OPERATOR, SYNTAX_INSERT_EXPRESSION, SYNTAX_ITEM_DECL, SYNTAX_LABEL, SYNTAX_LITERAL, SYNTAX_LOOP, SYNTAX_LOOP_STATEMENT, SYNTAX_OBJECT_TYPE, SYNTAX_PACKAGE, SYNTAX_PARAMETER, SYNTAX_PARAMETER_LIST, SYNTAX_PAREN_EXPRESSION, SYNTAX_PLSQL_ROOT, SYNTAX_POSTFIX_OPERATOR, SYNTAX_PREFIX_OPERATOR, SYNTAX_PRIMARY, SYNTAX_PRIMARY_NAME, SYNTAX_PROCEDURE, SYNTAX_SCHEMA_NAME, SYNTAX_SELECT_EXPRESSION, SYNTAX_SIMPLE_NAME, SYNTAX_SPECIAL_OPERATOR, SYNTAX_SQL_EXPRESSION, SYNTAX_STATEMENT, SYNTAX_TYPE_CURSOR_DECL, SYNTAX_TYPE_DECL, SYNTAX_TYPE_RECORD_DECL, SYNTAX_TYPE_TABLE_DECL, SYNTAX_TYPE_VARRAY_DECL, SYNTAX_UNPARSED_EXPRESSION, SYNTAX_UNPARSED_LOOP, SYNTAX_UNPARSED_STMT, SYNTAX_VARIABLE_DECL, SYNTAX_WHILE_LOOP
Constructor and Description |
---|
PlsqlTreeGenerator() |
Modifier and Type | Method and Description |
---|---|
CommonRoot |
generate()
Entry-point into the generate mechanism.
|
PlsqlSyntaxRecognizer |
getRecognizer() |
void |
initialize(PlsqlSyntaxRecognizer t) |
void |
receive(SyntaxToken token,
int syntaxCode)
Receive one token from the syntax stream.
|
public void initialize(PlsqlSyntaxRecognizer t)
public PlsqlSyntaxRecognizer getRecognizer()
public CommonRoot generate()
public void receive(SyntaxToken token, int syntaxCode)
receive
in interface SyntaxListener