schemaSQLParser.visitor
Class TreeFormatter

java.lang.Object
  |
  +--schemaSQLParser.visitor.DepthFirstVisitor
        |
        +--schemaSQLParser.visitor.TreeFormatter
All Implemented Interfaces:
Visitor

public class TreeFormatter
extends DepthFirstVisitor

A skeleton output formatter for your language grammar. Using the add() method along with force(), indent(), and outdent(), you can easily specify how this visitor will format the given syntax tree. See the JTB documentation for more details. Pass your syntax tree to this visitor, and then to the TreeDumper visitor in order to "pretty print" your tree.


Field Summary
private  java.util.Vector cmdQueue
           
private  int curColumn
           
private  int curIndent
           
private  int curLine
           
private  int indentAmt
           
private  boolean lineWrap
           
private  int wrapWidth
           
 
Constructor Summary
TreeFormatter()
          The default constructor assumes an indentation amount of 3 spaces and no line-wrap.
TreeFormatter(int indentAmt, int wrapWidth)
          This constructor accepts an indent amount and a line width which is used to wrap long lines.
 
Method Summary
protected  void add(FormatCommand cmd)
          Use this method to add FormatCommands to the command queue to be executed when the next token in the tree is visited.
protected  FormatCommand force()
          A Force command inserts a line break and indents the next line to the current indentation level.
protected  FormatCommand force(int i)
           
protected  FormatCommand indent()
          An Indent command increases the indentation level by one (or a user-specified amount).
protected  FormatCommand indent(int i)
           
protected  FormatCommand outdent()
          An Outdent command is the reverse of the Indent command: it reduces the indentation level.
protected  FormatCommand outdent(int i)
           
private  void placeToken(schemaSQLParser.syntaxtree.NodeToken n, int line, int column)
          Inserts token location (beginLine, beginColumn, endLine, endColumn) information into the NodeToken.
protected  void processList(schemaSQLParser.syntaxtree.NodeListInterface n)
          Accepts a NodeListInterface object and performs an optional format command between each node in the list (but not after the last node).
protected  void processList(schemaSQLParser.syntaxtree.NodeListInterface n, FormatCommand cmd)
           
protected  FormatCommand space()
          A Space command simply adds one or a user-specified number of spaces between tokens.
protected  FormatCommand space(int i)
           
 void visit(schemaSQLParser.syntaxtree.Arguments n)
          plSqlExpressionList -> PlSqlExpressionList()
 void visit(schemaSQLParser.syntaxtree.AssignmentStatement n)
          nodeChoice -> ( ( [ "." ] ":=" PlSqlExpression() ) | ( ":=" PlSqlExpression() ) ) nodeToken -> ";"
 void visit(schemaSQLParser.syntaxtree.BasicDataTypeDeclaration n)
          nodeChoice -> ( "CHAR" | "VARCHAR" | "VARCHAR2" | "INTEGER" | "NUMBER" | "NATURAL" | "REAL" | "FLOAT" ) [ "(" [ "," ] ")" ] | "DATE" | "BINARY_INTEGER" | "BOOLEAN"
 void visit(schemaSQLParser.syntaxtree.BeginEndBlock n)
          nodeToken -> "BEGIN" sequenceOfStatements -> SequenceOfStatements() nodeOptional -> [ ExceptionBlock() ] nodeToken1 -> "END" nodeOptional1 -> [ ] nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.CloseStatement n)
          nodeToken -> "CLOSE" nodeToken1 -> nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.ColumnAlias n)
          nodeToken ->
 void visit(schemaSQLParser.syntaxtree.ColumnValues n)
          tableColumn -> TableColumn() nodeToken -> "=" updatedValue -> UpdatedValue() nodeListOptional -> ( "," TableColumn() "=" UpdatedValue() )*
 void visit(schemaSQLParser.syntaxtree.CommitStatement n)
          nodeToken -> "COMMIT" nodeOptional -> [ "WORK" ] nodeOptional1 -> [ "COMMENT" ] nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.CompilationUnit n)
          nodeChoice -> ProcedureDeclaration() | FunctionDeclaration() | SequenceOfStatements()
 void visit(schemaSQLParser.syntaxtree.ConnectClause n)
          nodeSequence -> ( [ "START" "WITH" SQLExpression() ] "CONNECT" "BY" SQLExpression() [ "START" "WITH" SQLExpression() ] )
 void visit(schemaSQLParser.syntaxtree.ConstantDeclaration n)
          nodeToken -> "CONSTANT" typeDeclaration -> TypeDeclaration() nodeOptional -> [ "NOT" "NULL" ] nodeChoice -> ( ":=" | "DEFAULT" ) plSqlExpression -> PlSqlExpression()
 void visit(schemaSQLParser.syntaxtree.CreateViewClause n)
          nodeToken -> "CREATE" nodeToken1 -> "VIEW" viewReference -> ViewReference() createViewList -> CreateViewList() nodeToken2 -> "AS"
 void visit(schemaSQLParser.syntaxtree.CreateViewItem n)
          oracleObjectName -> OracleObjectName()
 void visit(schemaSQLParser.syntaxtree.CreateViewList n)
          nodeToken -> "(" createViewItem -> CreateViewItem() nodeListOptional -> ( "," CreateViewItem() )* nodeToken1 -> ")"
 void visit(schemaSQLParser.syntaxtree.CursorDeclaration n)
          nodeToken -> "CURSOR" nodeToken1 -> nodeOptional -> [ "(" ParameterList() ")" ] nodeToken2 -> "IS" selectStatement -> SelectStatement()
 void visit(schemaSQLParser.syntaxtree.CursorForLoop n)
          nodeToken -> "FOR" nodeToken1 -> nodeToken2 -> "IN" nodeChoice -> ( [ "(" Arguments() ")" ] | "(" SelectStatement() ")" ) normalLoop -> NormalLoop()
 void visit(schemaSQLParser.syntaxtree.Declarations n)
          nodeList -> ( ( IdentifierDeclaration() | CursorDeclaration() | PragmaDeclaration() ) ";" )+ nodeListOptional -> ( ProcedureDeclaration() | FunctionDeclaration() )*
 void visit(schemaSQLParser.syntaxtree.DeclarationSection n)
          nodeToken -> "DECLARE" declarations -> Declarations()
 void visit(schemaSQLParser.syntaxtree.DeleteStatement n)
          nodeToken -> "DELETE" nodeOptional -> [ "FROM" ] tableReference -> TableReference() nodeOptional1 -> [ ] nodeOptional2 -> [ "WHERE" ( SQLExpression() | "CURRENT" "OF" ) ] nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.ExceptionBlock n)
          nodeToken -> "EXCEPTION" nodeList -> ( ExceptionHandler() )+
 void visit(schemaSQLParser.syntaxtree.ExceptionDeclaration n)
          nodeToken -> "EXCEPTION"
 void visit(schemaSQLParser.syntaxtree.ExceptionHandler n)
          nodeToken -> "WHEN" nodeChoice -> ( ( "OR" )* | "OTHERS" ) nodeToken1 -> "THEN" sequenceOfStatements -> SequenceOfStatements()
 void visit(schemaSQLParser.syntaxtree.ExistsClause n)
          nodeOptional -> [ "NOT" ] nodeToken -> "EXISTS" nodeToken1 -> "(" subQuery -> SubQuery() nodeToken2 -> ")"
 void visit(schemaSQLParser.syntaxtree.ExitStatement n)
          nodeToken -> "EXIT" nodeOptional -> [ ] nodeOptional1 -> [ "WHEN" PlSqlExpression() ] nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.FetchStatement n)
          nodeToken -> "FETCH" nodeSequence -> ( ) nodeToken1 -> "INTO" nodeChoice -> ( | ) nodeListOptional -> ( "," ( | ) )* nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.ForLoop n)
          nodeChoice -> NumericForLoop() | CursorForLoop()
 void visit(schemaSQLParser.syntaxtree.ForUpdateClause n)
          nodeToken -> "FOR" nodeToken1 -> "UPDATE" nodeToken2 -> "OF" tableColumn -> TableColumn() nodeListOptional -> ( "," TableColumn() )*
 void visit(schemaSQLParser.syntaxtree.FromClause n)
          nodeToken -> "FROM" schemaSQLFromItem -> SchemaSQLFromItem() nodeListOptional -> ( "," SchemaSQLFromItem() )*
 void visit(schemaSQLParser.syntaxtree.FromItem n)
          tableReference -> TableReference() nodeOptional -> [ TableAlias() ]
 void visit(schemaSQLParser.syntaxtree.FunctionBody n)
          nodeOptional -> [ Declarations() ] beginEndBlock -> BeginEndBlock()
 void visit(schemaSQLParser.syntaxtree.FunctionCall n)
          oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() [ "." OracleObjectName() ] ] nodeToken -> "(" nodeOptional1 -> [ [ "DISTINCT" | "ALL" ] ( SQLArguments() | "*" ) ] nodeToken1 -> ")"
 void visit(schemaSQLParser.syntaxtree.FunctionDeclaration n)
          nodeToken -> "FUNCTION" nodeToken1 -> nodeOptional -> [ "(" ParameterList() ")" ] nodeToken2 -> "RETURN" typeDeclaration -> TypeDeclaration() nodeChoice -> ( ";" | "IS" FunctionBody() )
 void visit(schemaSQLParser.syntaxtree.GotoStatement n)
          nodeToken -> "GOTO" nodeToken1 -> nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.GroupByClause n)
          nodeToken -> "GROUP" nodeToken1 -> "BY" sQLExpressionList -> SQLExpressionList() nodeOptional -> [ "HAVING" SQLExpression() ]
 void visit(schemaSQLParser.syntaxtree.IdentifierDeclaration n)
          nodeToken -> nodeChoice -> ( ConstantDeclaration() | VariableDeclaration() | ExceptionDeclaration() )
 void visit(schemaSQLParser.syntaxtree.IfStatement n)
          nodeToken -> "IF" plSqlExpression -> PlSqlExpression() nodeToken1 -> "THEN" sequenceOfStatements -> SequenceOfStatements() nodeListOptional -> ( "ELSIF" PlSqlExpression() "THEN" SequenceOfStatements() )* nodeOptional -> [ "ELSE" SequenceOfStatements() ] nodeToken2 -> "END" nodeToken3 -> "IF" nodeOptional1 -> [ ] nodeToken4 -> ";"
 void visit(schemaSQLParser.syntaxtree.InsertStatement n)
          nodeToken -> "INSERT" nodeToken1 -> "INTO" tableReference -> TableReference() nodeOptional -> [ "(" TableColumn() ( "," TableColumn() )* ")" ] nodeChoice -> ( "VALUES" "(" PlSqlExpressionList() ")" | SelectStatement() ) nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.IntoClause n)
          nodeToken -> "INTO" intoItem -> IntoItem() nodeListOptional -> ( "," IntoItem() )*
 void visit(schemaSQLParser.syntaxtree.IntoItem n)
          nodeChoice -> ( [ "." ] ) | ( )
 void visit(schemaSQLParser.syntaxtree.IsNullClause n)
          nodeToken -> "IS" nodeOptional -> [ "NOT" ] nodeToken1 -> "NULL"
 void visit(schemaSQLParser.syntaxtree.LabelDeclaration n)
          nodeToken -> "<<" nodeToken1 -> nodeToken2 -> ">>"
 void visit(schemaSQLParser.syntaxtree.LockMode n)
          nodeChoice -> ( "ROW" ( "SHARE" | "EXCLUSIVE" ) ) | ( "SHARE" [ "UPDATE" | ( "ROW" "EXCLUSIVE" ) ] ) | ( "EXCLUSIVE" )
 void visit(schemaSQLParser.syntaxtree.LockTableStatement n)
          nodeToken -> "LOCK" nodeToken1 -> "TABLE" tableReference -> TableReference() nodeListOptional -> ( "," TableReference() )* nodeToken2 -> "IN" lockMode -> LockMode() nodeToken3 -> "MODE" nodeOptional -> [ "NOWAIT" ] nodeToken4 -> ";"
 void visit(schemaSQLParser.syntaxtree.LoopStatement n)
          nodeChoice -> NormalLoop() | WhileLoop() | ForLoop()
 void visit(schemaSQLParser.syntaxtree.NodeToken n)
          Executes the commands waiting in the command queue, then inserts the proper location information into the current NodeToken.
 void visit(schemaSQLParser.syntaxtree.NormalLoop n)
          nodeToken -> "LOOP" sequenceOfStatements -> SequenceOfStatements() nodeToken1 -> "END" nodeToken2 -> "LOOP" nodeOptional -> [ ] nodeToken3 -> ";"
 void visit(schemaSQLParser.syntaxtree.NullStatement n)
          nodeToken -> "NULL" nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.NumericForLoop n)
          nodeToken -> "FOR" nodeToken1 -> nodeToken2 -> "IN" nodeOptional -> [ "REVERSE" ] plSqlSimpleExpression -> PlSqlSimpleExpression() nodeToken3 -> ".." plSqlSimpleExpression1 -> PlSqlSimpleExpression() normalLoop -> NormalLoop()
 void visit(schemaSQLParser.syntaxtree.NumericForLoopLookahead n)
          nodeToken -> "FOR" nodeToken1 -> nodeToken2 -> "IN" nodeOptional -> [ "REVERSE" ] plSqlSimpleExpression -> PlSqlSimpleExpression() nodeToken3 -> ".."
 void visit(schemaSQLParser.syntaxtree.NumOrID n)
          nodeChoice -> | ( [ "+" | "-" ] )
 void visit(schemaSQLParser.syntaxtree.OpenStatement n)
          nodeToken -> "OPEN" nodeToken1 -> nodeOptional -> [ "(" Arguments() ")" ] nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.OracleObjectName n)
          nodeChoice -> |
 void visit(schemaSQLParser.syntaxtree.OrderByClause n)
          nodeToken -> "ORDER" nodeToken1 -> "BY" sQLSimpleExpression -> SQLSimpleExpression() nodeOptional -> [ "ASC" | "DESC" ] nodeListOptional -> ( "," SQLSimpleExpression() [ "ASC" | "DESC" ] )*
 void visit(schemaSQLParser.syntaxtree.OuterJoinExpression n)
          oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() [ "." OracleObjectName() ] ] nodeToken -> "(" nodeToken1 -> "+" nodeToken2 -> ")"
 void visit(schemaSQLParser.syntaxtree.Parameter n)
          nodeToken -> nodeOptional -> [ [ "IN" ] [ "OUT" ] TypeDeclaration() [ ( ":=" | "DEFAULT" ) PlSqlExpression() ] ]
 void visit(schemaSQLParser.syntaxtree.ParameterList n)
          parameter -> Parameter() nodeListOptional -> ( "," Parameter() )*
 void visit(schemaSQLParser.syntaxtree.PlSqlAndExpression n)
          plSqlUnaryLogicalExpression -> PlSqlUnaryLogicalExpression() nodeListOptional -> ( "AND" PlSqlUnaryLogicalExpression() )*
 void visit(schemaSQLParser.syntaxtree.PlSqlBetweenClause n)
          nodeOptional -> [ "NOT" ] nodeToken -> "BETWEEN" plSqlSimpleExpression -> PlSqlSimpleExpression() nodeToken1 -> "AND" plSqlSimpleExpression1 -> PlSqlSimpleExpression()
 void visit(schemaSQLParser.syntaxtree.PlSqlExpotentExpression n)
          plSqlUnaryExpression -> PlSqlUnaryExpression() nodeListOptional -> ( "**" PlSqlUnaryExpression() )*
 void visit(schemaSQLParser.syntaxtree.PlSqlExpression n)
          plSqlAndExpression -> PlSqlAndExpression() nodeListOptional -> ( "OR" PlSqlAndExpression() )*
 void visit(schemaSQLParser.syntaxtree.PlSqlExpressionList n)
          plSqlExpression -> PlSqlExpression() nodeListOptional -> ( "," PlSqlExpression() )*
 void visit(schemaSQLParser.syntaxtree.PlSqlInClause n)
          nodeOptional -> [ "NOT" ] nodeToken -> "IN" nodeToken1 -> "(" plSqlExpressionList -> PlSqlExpressionList() nodeToken2 -> ")"
 void visit(schemaSQLParser.syntaxtree.PlSqlLikeClause n)
          nodeOptional -> [ "NOT" ] nodeToken -> "LIKE" plSqlSimpleExpression -> PlSqlSimpleExpression()
 void visit(schemaSQLParser.syntaxtree.PlSqlMultiplicativeExpression n)
          plSqlExpotentExpression -> PlSqlExpotentExpression() nodeListOptional -> ( ( "*" | "/" ) PlSqlExpotentExpression() )*
 void visit(schemaSQLParser.syntaxtree.PlSqlPrimaryExpression n)
          nodeChoice -> "NULL" | ( ( "%FOUND" | "%NOTFOUND" | "%ISOPEN" | "%ROWCOUNT" ) ) | ( "(" Arguments() ")" ) | ( [ "." ] ) | ( "SQL" ( "%FOUND" | "%NOTFOUND" | "%ISOPEN" | "%ROWCOUNT" ) ) | | | | "(" PlSqlExpression() ")"
 void visit(schemaSQLParser.syntaxtree.PlSqlRelationalExpression n)
          plSqlSimpleExpression -> PlSqlSimpleExpression() nodeOptional -> ( Relop() PlSqlSimpleExpression() | PlSqlInClause() | PlSqlBetweenClause() | PlSqlLikeClause() | IsNullClause() )?
 void visit(schemaSQLParser.syntaxtree.PlSqlSimpleExpression n)
          plSqlMultiplicativeExpression -> PlSqlMultiplicativeExpression() nodeListOptional -> ( ( "+" | "-" | "||" ) PlSqlMultiplicativeExpression() )*
 void visit(schemaSQLParser.syntaxtree.PLSQLStatement n)
          nodeChoice -> SubroutineCall() | AssignmentStatement() | ExitStatement() | GotoStatement() | IfStatement() | LoopStatement() | NullStatement() | RaiseStatement() | ReturnStatement() | SQLStatement() | LabelDeclaration() | [ DeclarationSection() ] BeginEndBlock()
 void visit(schemaSQLParser.syntaxtree.PlSqlUnaryExpression n)
          nodeChoice -> ( ( "+" | "-" ) PlSqlPrimaryExpression() ) | PlSqlPrimaryExpression()
 void visit(schemaSQLParser.syntaxtree.PlSqlUnaryLogicalExpression n)
          nodeOptional -> [ "NOT" ] plSqlRelationalExpression -> PlSqlRelationalExpression()
 void visit(schemaSQLParser.syntaxtree.PragmaDeclaration n)
          nodeToken -> "PRAGMA" nodeToken1 -> "EXCEPTION_INIT" nodeToken2 -> "(" numOrID -> NumOrID() nodeToken3 -> "," numOrID1 -> NumOrID() nodeToken4 -> ")"
 void visit(schemaSQLParser.syntaxtree.ProcedureBody n)
          nodeOptional -> [ Declarations() ] beginEndBlock -> BeginEndBlock()
 void visit(schemaSQLParser.syntaxtree.ProcedureDeclaration n)
          nodeToken -> "PROCEDURE" nodeToken1 -> nodeOptional -> [ "(" ParameterList() ")" ] nodeChoice -> ( ";" | "IS" ProcedureBody() )
 void visit(schemaSQLParser.syntaxtree.QueryStatement n)
          nodeOptional -> [ CreateViewClause() ] selectStatement -> SelectStatement() nodeToken -> ";"
 void visit(schemaSQLParser.syntaxtree.RaiseStatement n)
          nodeToken -> "RAISE" nodeOptional -> [ ] nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.Relop n)
          nodeChoice -> "=" | "!=" | "#" | "<>" | ">" | ">=" | "<" | "<="
 void visit(schemaSQLParser.syntaxtree.ReturnStatement n)
          nodeToken -> "RETURN" nodeOptional -> [ PlSqlExpression() ] nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.RollbackStatement n)
          nodeToken -> "ROLLBACK" nodeOptional -> [ "WORK" ] nodeOptional1 -> [ "TO" [ "SAVEPOINT" ] ] nodeOptional2 -> [ "COMMENT" ] nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.SavepointStatement n)
          nodeToken -> "SAVEPOINT" nodeToken1 -> nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.SchemaSQL_AttributeNames n)
          tableReference -> TableReference() nodeToken -> columnAlias -> ColumnAlias()
 void visit(schemaSQLParser.syntaxtree.SchemaSQL_RelationNames n)
          nodeToken -> tableAlias -> TableAlias()
 void visit(schemaSQLParser.syntaxtree.SchemaSQLFromItem n)
          nodeChoice -> SchemaSQL_RelationNames() | SchemaSQL_AttributeNames() | FromItem()
 void visit(schemaSQLParser.syntaxtree.SelectItem n)
          nodeChoice -> OracleObjectName() ".*" | OracleObjectName() "." OracleObjectName() ".*" | SQLSimpleExpression() [ ColumnAlias() ]
 void visit(schemaSQLParser.syntaxtree.SelectList n)
          nodeChoice -> "*" | SelectItem() ( "," SelectItem() )*
 void visit(schemaSQLParser.syntaxtree.SelectStatement n)
          selectWithoutOrder -> SelectWithoutOrder() nodeOptional -> [ OrderByClause() ] nodeOptional1 -> [ ForUpdateClause() ]
 void visit(schemaSQLParser.syntaxtree.SelectWithoutOrder n)
          nodeToken -> "SELECT" nodeOptional -> [ "ALL" | "DISTINCT" ] selectList -> SelectList() nodeOptional1 -> [ IntoClause() ] fromClause -> FromClause() nodeOptional2 -> [ WhereClause() ] nodeOptional3 -> [ ConnectClause() ] nodeOptional4 -> [ GroupByClause() ] nodeOptional5 -> [ SetClause() ]
 void visit(schemaSQLParser.syntaxtree.SequenceOfStatements n)
          nodeList -> ( PLSQLStatement() )+
 void visit(schemaSQLParser.syntaxtree.SetClause n)
          nodeChoice -> ( ( "UNION" [ "ALL" ] ) | "INTERSECT" | "MINUS" ) nodeChoice1 -> ( ( "(" SelectWithoutOrder() ")" ) | SelectWithoutOrder() )
 void visit(schemaSQLParser.syntaxtree.SetTransactionStatement n)
          nodeToken -> "SET" nodeToken1 -> "TRANSACTION" nodeChoice -> ( ( "READ" ( "ONLY" | "WRITE" ) ) | ( "USE" "ROLLBACK" "SEGMENT" ) ) nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.SQLAndExpression n)
          sQLUnaryLogicalExpression -> SQLUnaryLogicalExpression() nodeListOptional -> ( "AND" SQLUnaryLogicalExpression() )*
 void visit(schemaSQLParser.syntaxtree.SQLArguments n)
          sQLExpressionList -> SQLExpressionList()
 void visit(schemaSQLParser.syntaxtree.SQLBetweenClause n)
          nodeOptional -> [ "NOT" ] nodeToken -> "BETWEEN" sQLSimpleExpression -> SQLSimpleExpression() nodeToken1 -> "AND" sQLSimpleExpression1 -> SQLSimpleExpression()
 void visit(schemaSQLParser.syntaxtree.SQLExpotentExpression n)
          sQLUnaryExpression -> SQLUnaryExpression() nodeListOptional -> ( "**" SQLUnaryExpression() )*
 void visit(schemaSQLParser.syntaxtree.SQLExpression n)
          sQLAndExpression -> SQLAndExpression() nodeListOptional -> ( "OR" SQLAndExpression() )*
 void visit(schemaSQLParser.syntaxtree.SQLExpressionList n)
          sQLSimpleExpression -> SQLSimpleExpression() nodeListOptional -> ( "," SQLSimpleExpression() )*
 void visit(schemaSQLParser.syntaxtree.SQLInClause n)
          nodeOptional -> [ "NOT" ] nodeToken -> "IN" nodeToken1 -> "(" nodeChoice -> ( SQLExpressionList() | SubQuery() ) nodeToken2 -> ")"
 void visit(schemaSQLParser.syntaxtree.SQLLikeClause n)
          nodeOptional -> [ "NOT" ] nodeToken -> "LIKE" sQLSimpleExpression -> SQLSimpleExpression()
 void visit(schemaSQLParser.syntaxtree.SQLMultiplicativeExpression n)
          sQLExpotentExpression -> SQLExpotentExpression() nodeListOptional -> ( ( "*" | "/" ) SQLExpotentExpression() )*
 void visit(schemaSQLParser.syntaxtree.SQLPrimaryExpression n)
          nodeChoice -> "NULL" | FunctionCall() | OuterJoinExpression() | TableColumn() | | | | "(" SQLExpression() ")"
 void visit(schemaSQLParser.syntaxtree.SQLRelationalExpression n)
          nodeChoice -> ( "(" SQLExpressionList() ")" | ( [ "PRIOR" ] SQLSimpleExpression() ) ) nodeOptional -> ( SQLRelationalOperatorExpression() | ( SQLInClause() ) | ( SQLBetweenClause() ) | ( SQLLikeClause() ) | IsNullClause() )?
 void visit(schemaSQLParser.syntaxtree.SQLRelationalOperatorExpression n)
          relop -> Relop() nodeChoice -> ( ( [ "ALL" | "ANY" ] "(" SubQuery() ")" ) | [ "PRIOR" ] SQLSimpleExpression() )
 void visit(schemaSQLParser.syntaxtree.SQLSimpleExpression n)
          sQLMultiplicativeExpression -> SQLMultiplicativeExpression() nodeListOptional -> ( ( "+" | "-" | "||" ) SQLMultiplicativeExpression() )*
 void visit(schemaSQLParser.syntaxtree.SQLStatement n)
          nodeChoice -> CloseStatement() | CommitStatement() | DeleteStatement() | FetchStatement() | InsertStatement() | LockTableStatement() | OpenStatement() | RollbackStatement() | SavepointStatement() | QueryStatement() | SetTransactionStatement() | UpdateStatement()
 void visit(schemaSQLParser.syntaxtree.SQLUnaryExpression n)
          nodeOptional -> [ "+" | "-" ] sQLPrimaryExpression -> SQLPrimaryExpression()
 void visit(schemaSQLParser.syntaxtree.SQLUnaryLogicalExpression n)
          nodeChoice -> ExistsClause() | ( [ "NOT" ] SQLRelationalExpression() )
 void visit(schemaSQLParser.syntaxtree.SubQuery n)
          selectWithoutOrder -> SelectWithoutOrder()
 void visit(schemaSQLParser.syntaxtree.SubroutineCall n)
          nodeToken -> nodeOptional -> [ "." ] nodeOptional1 -> [ "(" Arguments() ")" ] nodeToken1 -> ";"
 void visit(schemaSQLParser.syntaxtree.TableAlias n)
          nodeToken ->
 void visit(schemaSQLParser.syntaxtree.TableColumn n)
          oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() [ "." OracleObjectName() ] ]
 void visit(schemaSQLParser.syntaxtree.TableReference n)
          oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() ]
 void visit(schemaSQLParser.syntaxtree.TypeDeclaration n)
          nodeChoice -> BasicDataTypeDeclaration() | ( ( "%TYPE" | "%ROWTYPE" ) ) | TableColumn() "%TYPE" |
 void visit(schemaSQLParser.syntaxtree.UpdatedValue n)
          nodeChoice -> "(" SelectStatement() ")" | PlSqlExpression()
 void visit(schemaSQLParser.syntaxtree.UpdateStatement n)
          nodeToken -> "UPDATE" tableReference -> TableReference() nodeOptional -> [ ] nodeToken1 -> "SET" columnValues -> ColumnValues() nodeOptional1 -> [ "WHERE" ( SQLExpression() | "CURRENT" "OF" ) ] nodeToken2 -> ";"
 void visit(schemaSQLParser.syntaxtree.VariableDeclaration n)
          typeDeclaration -> TypeDeclaration() nodeOptional -> [ "NOT" "NULL" ] nodeOptional1 -> [ ( ":=" | "DEFAULT" ) PlSqlExpression() ]
 void visit(schemaSQLParser.syntaxtree.ViewReference n)
          oracleObjectName -> OracleObjectName()
 void visit(schemaSQLParser.syntaxtree.WhereClause n)
          nodeToken -> "WHERE" sQLExpression -> SQLExpression()
 void visit(schemaSQLParser.syntaxtree.WhileLoop n)
          nodeToken -> "WHILE" plSqlExpression -> PlSqlExpression() normalLoop -> NormalLoop()
 
Methods inherited from class schemaSQLParser.visitor.DepthFirstVisitor
visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cmdQueue

private java.util.Vector cmdQueue

lineWrap

private boolean lineWrap

wrapWidth

private int wrapWidth

indentAmt

private int indentAmt

curLine

private int curLine

curColumn

private int curColumn

curIndent

private int curIndent
Constructor Detail

TreeFormatter

public TreeFormatter()
The default constructor assumes an indentation amount of 3 spaces and no line-wrap. You may alternately use the other constructor to specify your own indentation amount and line width.

TreeFormatter

public TreeFormatter(int indentAmt,
                     int wrapWidth)
This constructor accepts an indent amount and a line width which is used to wrap long lines. If a token's beginColumn value is greater than the specified wrapWidth, it will be moved to the next line and indented one extra level. To turn off line-wrapping, specify a wrapWidth of 0.
Parameters:
indentAmt - Amount of spaces per indentation level.
wrapWidth - Wrap lines longer than wrapWidth. 0 for no wrap.
Method Detail

processList

protected void processList(schemaSQLParser.syntaxtree.NodeListInterface n)
Accepts a NodeListInterface object and performs an optional format command between each node in the list (but not after the last node).

processList

protected void processList(schemaSQLParser.syntaxtree.NodeListInterface n,
                           FormatCommand cmd)

force

protected FormatCommand force()
A Force command inserts a line break and indents the next line to the current indentation level. Use "add(force());".

force

protected FormatCommand force(int i)

indent

protected FormatCommand indent()
An Indent command increases the indentation level by one (or a user-specified amount). Use "add(indent());".

indent

protected FormatCommand indent(int i)

outdent

protected FormatCommand outdent()
An Outdent command is the reverse of the Indent command: it reduces the indentation level. Use "add(outdent());".

outdent

protected FormatCommand outdent(int i)

space

protected FormatCommand space()
A Space command simply adds one or a user-specified number of spaces between tokens. Use "add(space());".

space

protected FormatCommand space(int i)

add

protected void add(FormatCommand cmd)
Use this method to add FormatCommands to the command queue to be executed when the next token in the tree is visited.

visit

public void visit(schemaSQLParser.syntaxtree.NodeToken n)
Executes the commands waiting in the command queue, then inserts the proper location information into the current NodeToken. If there are any special tokens preceding this token, they will be given the current location information. The token will follow on the next line, at the proper indentation level. If this is not the behavior you want from special tokens, feel free to modify this method.
Overrides:
visit in class DepthFirstVisitor

placeToken

private void placeToken(schemaSQLParser.syntaxtree.NodeToken n,
                        int line,
                        int column)
Inserts token location (beginLine, beginColumn, endLine, endColumn) information into the NodeToken. Takes into account line-wrap. Does not update curLine and curColumn.

visit

public void visit(schemaSQLParser.syntaxtree.CompilationUnit n)
nodeChoice -> ProcedureDeclaration() | FunctionDeclaration() | SequenceOfStatements()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.DeclarationSection n)
nodeToken -> "DECLARE" declarations -> Declarations()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.Declarations n)
nodeList -> ( ( IdentifierDeclaration() | CursorDeclaration() | PragmaDeclaration() ) ";" )+ nodeListOptional -> ( ProcedureDeclaration() | FunctionDeclaration() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.IdentifierDeclaration n)
nodeToken -> nodeChoice -> ( ConstantDeclaration() | VariableDeclaration() | ExceptionDeclaration() )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.CursorDeclaration n)
nodeToken -> "CURSOR" nodeToken1 -> nodeOptional -> [ "(" ParameterList() ")" ] nodeToken2 -> "IS" selectStatement -> SelectStatement()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ProcedureDeclaration n)
nodeToken -> "PROCEDURE" nodeToken1 -> nodeOptional -> [ "(" ParameterList() ")" ] nodeChoice -> ( ";" | "IS" ProcedureBody() )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ProcedureBody n)
nodeOptional -> [ Declarations() ] beginEndBlock -> BeginEndBlock()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.FunctionDeclaration n)
nodeToken -> "FUNCTION" nodeToken1 -> nodeOptional -> [ "(" ParameterList() ")" ] nodeToken2 -> "RETURN" typeDeclaration -> TypeDeclaration() nodeChoice -> ( ";" | "IS" FunctionBody() )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.FunctionBody n)
nodeOptional -> [ Declarations() ] beginEndBlock -> BeginEndBlock()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PragmaDeclaration n)
nodeToken -> "PRAGMA" nodeToken1 -> "EXCEPTION_INIT" nodeToken2 -> "(" numOrID -> NumOrID() nodeToken3 -> "," numOrID1 -> NumOrID() nodeToken4 -> ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.VariableDeclaration n)
typeDeclaration -> TypeDeclaration() nodeOptional -> [ "NOT" "NULL" ] nodeOptional1 -> [ ( ":=" | "DEFAULT" ) PlSqlExpression() ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ConstantDeclaration n)
nodeToken -> "CONSTANT" typeDeclaration -> TypeDeclaration() nodeOptional -> [ "NOT" "NULL" ] nodeChoice -> ( ":=" | "DEFAULT" ) plSqlExpression -> PlSqlExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.TypeDeclaration n)
nodeChoice -> BasicDataTypeDeclaration() | ( ( "%TYPE" | "%ROWTYPE" ) ) | TableColumn() "%TYPE" |
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.BasicDataTypeDeclaration n)
nodeChoice -> ( "CHAR" | "VARCHAR" | "VARCHAR2" | "INTEGER" | "NUMBER" | "NATURAL" | "REAL" | "FLOAT" ) [ "(" [ "," ] ")" ] | "DATE" | "BINARY_INTEGER" | "BOOLEAN"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ExceptionDeclaration n)
nodeToken -> "EXCEPTION"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.BeginEndBlock n)
nodeToken -> "BEGIN" sequenceOfStatements -> SequenceOfStatements() nodeOptional -> [ ExceptionBlock() ] nodeToken1 -> "END" nodeOptional1 -> [ ] nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SequenceOfStatements n)
nodeList -> ( PLSQLStatement() )+
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ExceptionBlock n)
nodeToken -> "EXCEPTION" nodeList -> ( ExceptionHandler() )+
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ExceptionHandler n)
nodeToken -> "WHEN" nodeChoice -> ( ( "OR" )* | "OTHERS" ) nodeToken1 -> "THEN" sequenceOfStatements -> SequenceOfStatements()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PLSQLStatement n)
nodeChoice -> SubroutineCall() | AssignmentStatement() | ExitStatement() | GotoStatement() | IfStatement() | LoopStatement() | NullStatement() | RaiseStatement() | ReturnStatement() | SQLStatement() | LabelDeclaration() | [ DeclarationSection() ] BeginEndBlock()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.LabelDeclaration n)
nodeToken -> "<<" nodeToken1 -> nodeToken2 -> ">>"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLStatement n)
nodeChoice -> CloseStatement() | CommitStatement() | DeleteStatement() | FetchStatement() | InsertStatement() | LockTableStatement() | OpenStatement() | RollbackStatement() | SavepointStatement() | QueryStatement() | SetTransactionStatement() | UpdateStatement()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SubroutineCall n)
nodeToken -> nodeOptional -> [ "." ] nodeOptional1 -> [ "(" Arguments() ")" ] nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.AssignmentStatement n)
nodeChoice -> ( ( [ "." ] ":=" PlSqlExpression() ) | ( ":=" PlSqlExpression() ) ) nodeToken -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ExitStatement n)
nodeToken -> "EXIT" nodeOptional -> [ ] nodeOptional1 -> [ "WHEN" PlSqlExpression() ] nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.GotoStatement n)
nodeToken -> "GOTO" nodeToken1 -> nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.IfStatement n)
nodeToken -> "IF" plSqlExpression -> PlSqlExpression() nodeToken1 -> "THEN" sequenceOfStatements -> SequenceOfStatements() nodeListOptional -> ( "ELSIF" PlSqlExpression() "THEN" SequenceOfStatements() )* nodeOptional -> [ "ELSE" SequenceOfStatements() ] nodeToken2 -> "END" nodeToken3 -> "IF" nodeOptional1 -> [ ] nodeToken4 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.LoopStatement n)
nodeChoice -> NormalLoop() | WhileLoop() | ForLoop()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.NormalLoop n)
nodeToken -> "LOOP" sequenceOfStatements -> SequenceOfStatements() nodeToken1 -> "END" nodeToken2 -> "LOOP" nodeOptional -> [ ] nodeToken3 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.WhileLoop n)
nodeToken -> "WHILE" plSqlExpression -> PlSqlExpression() normalLoop -> NormalLoop()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ForLoop n)
nodeChoice -> NumericForLoop() | CursorForLoop()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.NumericForLoopLookahead n)
nodeToken -> "FOR" nodeToken1 -> nodeToken2 -> "IN" nodeOptional -> [ "REVERSE" ] plSqlSimpleExpression -> PlSqlSimpleExpression() nodeToken3 -> ".."
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.NumericForLoop n)
nodeToken -> "FOR" nodeToken1 -> nodeToken2 -> "IN" nodeOptional -> [ "REVERSE" ] plSqlSimpleExpression -> PlSqlSimpleExpression() nodeToken3 -> ".." plSqlSimpleExpression1 -> PlSqlSimpleExpression() normalLoop -> NormalLoop()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.CursorForLoop n)
nodeToken -> "FOR" nodeToken1 -> nodeToken2 -> "IN" nodeChoice -> ( [ "(" Arguments() ")" ] | "(" SelectStatement() ")" ) normalLoop -> NormalLoop()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.NullStatement n)
nodeToken -> "NULL" nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.RaiseStatement n)
nodeToken -> "RAISE" nodeOptional -> [ ] nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ReturnStatement n)
nodeToken -> "RETURN" nodeOptional -> [ PlSqlExpression() ] nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.CloseStatement n)
nodeToken -> "CLOSE" nodeToken1 -> nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.CommitStatement n)
nodeToken -> "COMMIT" nodeOptional -> [ "WORK" ] nodeOptional1 -> [ "COMMENT" ] nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.FetchStatement n)
nodeToken -> "FETCH" nodeSequence -> ( ) nodeToken1 -> "INTO" nodeChoice -> ( | ) nodeListOptional -> ( "," ( | ) )* nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.LockTableStatement n)
nodeToken -> "LOCK" nodeToken1 -> "TABLE" tableReference -> TableReference() nodeListOptional -> ( "," TableReference() )* nodeToken2 -> "IN" lockMode -> LockMode() nodeToken3 -> "MODE" nodeOptional -> [ "NOWAIT" ] nodeToken4 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.OpenStatement n)
nodeToken -> "OPEN" nodeToken1 -> nodeOptional -> [ "(" Arguments() ")" ] nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.RollbackStatement n)
nodeToken -> "ROLLBACK" nodeOptional -> [ "WORK" ] nodeOptional1 -> [ "TO" [ "SAVEPOINT" ] ] nodeOptional2 -> [ "COMMENT" ] nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SetTransactionStatement n)
nodeToken -> "SET" nodeToken1 -> "TRANSACTION" nodeChoice -> ( ( "READ" ( "ONLY" | "WRITE" ) ) | ( "USE" "ROLLBACK" "SEGMENT" ) ) nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.LockMode n)
nodeChoice -> ( "ROW" ( "SHARE" | "EXCLUSIVE" ) ) | ( "SHARE" [ "UPDATE" | ( "ROW" "EXCLUSIVE" ) ] ) | ( "EXCLUSIVE" )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SavepointStatement n)
nodeToken -> "SAVEPOINT" nodeToken1 -> nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.UpdateStatement n)
nodeToken -> "UPDATE" tableReference -> TableReference() nodeOptional -> [ ] nodeToken1 -> "SET" columnValues -> ColumnValues() nodeOptional1 -> [ "WHERE" ( SQLExpression() | "CURRENT" "OF" ) ] nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ColumnValues n)
tableColumn -> TableColumn() nodeToken -> "=" updatedValue -> UpdatedValue() nodeListOptional -> ( "," TableColumn() "=" UpdatedValue() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.UpdatedValue n)
nodeChoice -> "(" SelectStatement() ")" | PlSqlExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.InsertStatement n)
nodeToken -> "INSERT" nodeToken1 -> "INTO" tableReference -> TableReference() nodeOptional -> [ "(" TableColumn() ( "," TableColumn() )* ")" ] nodeChoice -> ( "VALUES" "(" PlSqlExpressionList() ")" | SelectStatement() ) nodeToken2 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.DeleteStatement n)
nodeToken -> "DELETE" nodeOptional -> [ "FROM" ] tableReference -> TableReference() nodeOptional1 -> [ ] nodeOptional2 -> [ "WHERE" ( SQLExpression() | "CURRENT" "OF" ) ] nodeToken1 -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.QueryStatement n)
nodeOptional -> [ CreateViewClause() ] selectStatement -> SelectStatement() nodeToken -> ";"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.CreateViewClause n)
nodeToken -> "CREATE" nodeToken1 -> "VIEW" viewReference -> ViewReference() createViewList -> CreateViewList() nodeToken2 -> "AS"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlExpression n)
plSqlAndExpression -> PlSqlAndExpression() nodeListOptional -> ( "OR" PlSqlAndExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlAndExpression n)
plSqlUnaryLogicalExpression -> PlSqlUnaryLogicalExpression() nodeListOptional -> ( "AND" PlSqlUnaryLogicalExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlUnaryLogicalExpression n)
nodeOptional -> [ "NOT" ] plSqlRelationalExpression -> PlSqlRelationalExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlRelationalExpression n)
plSqlSimpleExpression -> PlSqlSimpleExpression() nodeOptional -> ( Relop() PlSqlSimpleExpression() | PlSqlInClause() | PlSqlBetweenClause() | PlSqlLikeClause() | IsNullClause() )?
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlExpressionList n)
plSqlExpression -> PlSqlExpression() nodeListOptional -> ( "," PlSqlExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlInClause n)
nodeOptional -> [ "NOT" ] nodeToken -> "IN" nodeToken1 -> "(" plSqlExpressionList -> PlSqlExpressionList() nodeToken2 -> ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlBetweenClause n)
nodeOptional -> [ "NOT" ] nodeToken -> "BETWEEN" plSqlSimpleExpression -> PlSqlSimpleExpression() nodeToken1 -> "AND" plSqlSimpleExpression1 -> PlSqlSimpleExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlLikeClause n)
nodeOptional -> [ "NOT" ] nodeToken -> "LIKE" plSqlSimpleExpression -> PlSqlSimpleExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.IsNullClause n)
nodeToken -> "IS" nodeOptional -> [ "NOT" ] nodeToken1 -> "NULL"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlSimpleExpression n)
plSqlMultiplicativeExpression -> PlSqlMultiplicativeExpression() nodeListOptional -> ( ( "+" | "-" | "||" ) PlSqlMultiplicativeExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlMultiplicativeExpression n)
plSqlExpotentExpression -> PlSqlExpotentExpression() nodeListOptional -> ( ( "*" | "/" ) PlSqlExpotentExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlExpotentExpression n)
plSqlUnaryExpression -> PlSqlUnaryExpression() nodeListOptional -> ( "**" PlSqlUnaryExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlUnaryExpression n)
nodeChoice -> ( ( "+" | "-" ) PlSqlPrimaryExpression() ) | PlSqlPrimaryExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.PlSqlPrimaryExpression n)
nodeChoice -> "NULL" | ( ( "%FOUND" | "%NOTFOUND" | "%ISOPEN" | "%ROWCOUNT" ) ) | ( "(" Arguments() ")" ) | ( [ "." ] ) | ( "SQL" ( "%FOUND" | "%NOTFOUND" | "%ISOPEN" | "%ROWCOUNT" ) ) | | | | "(" PlSqlExpression() ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.TableColumn n)
oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() [ "." OracleObjectName() ] ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.OracleObjectName n)
nodeChoice -> |
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.Relop n)
nodeChoice -> "=" | "!=" | "#" | "<>" | ">" | ">=" | "<" | "<="
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.TableReference n)
oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ViewReference n)
oracleObjectName -> OracleObjectName()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ParameterList n)
parameter -> Parameter() nodeListOptional -> ( "," Parameter() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.NumOrID n)
nodeChoice -> | ( [ "+" | "-" ] )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.Parameter n)
nodeToken -> nodeOptional -> [ [ "IN" ] [ "OUT" ] TypeDeclaration() [ ( ":=" | "DEFAULT" ) PlSqlExpression() ] ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.Arguments n)
plSqlExpressionList -> PlSqlExpressionList()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SelectStatement n)
selectWithoutOrder -> SelectWithoutOrder() nodeOptional -> [ OrderByClause() ] nodeOptional1 -> [ ForUpdateClause() ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SelectWithoutOrder n)
nodeToken -> "SELECT" nodeOptional -> [ "ALL" | "DISTINCT" ] selectList -> SelectList() nodeOptional1 -> [ IntoClause() ] fromClause -> FromClause() nodeOptional2 -> [ WhereClause() ] nodeOptional3 -> [ ConnectClause() ] nodeOptional4 -> [ GroupByClause() ] nodeOptional5 -> [ SetClause() ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SelectList n)
nodeChoice -> "*" | SelectItem() ( "," SelectItem() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SelectItem n)
nodeChoice -> OracleObjectName() ".*" | OracleObjectName() "." OracleObjectName() ".*" | SQLSimpleExpression() [ ColumnAlias() ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ColumnAlias n)
nodeToken ->
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.CreateViewList n)
nodeToken -> "(" createViewItem -> CreateViewItem() nodeListOptional -> ( "," CreateViewItem() )* nodeToken1 -> ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.CreateViewItem n)
oracleObjectName -> OracleObjectName()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.IntoClause n)
nodeToken -> "INTO" intoItem -> IntoItem() nodeListOptional -> ( "," IntoItem() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.IntoItem n)
nodeChoice -> ( [ "." ] ) | ( )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.FromClause n)
nodeToken -> "FROM" schemaSQLFromItem -> SchemaSQLFromItem() nodeListOptional -> ( "," SchemaSQLFromItem() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SchemaSQLFromItem n)
nodeChoice -> SchemaSQL_RelationNames() | SchemaSQL_AttributeNames() | FromItem()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.FromItem n)
tableReference -> TableReference() nodeOptional -> [ TableAlias() ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SchemaSQL_RelationNames n)
nodeToken -> tableAlias -> TableAlias()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SchemaSQL_AttributeNames n)
tableReference -> TableReference() nodeToken -> columnAlias -> ColumnAlias()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.TableAlias n)
nodeToken ->
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.WhereClause n)
nodeToken -> "WHERE" sQLExpression -> SQLExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ConnectClause n)
nodeSequence -> ( [ "START" "WITH" SQLExpression() ] "CONNECT" "BY" SQLExpression() [ "START" "WITH" SQLExpression() ] )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.GroupByClause n)
nodeToken -> "GROUP" nodeToken1 -> "BY" sQLExpressionList -> SQLExpressionList() nodeOptional -> [ "HAVING" SQLExpression() ]
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SetClause n)
nodeChoice -> ( ( "UNION" [ "ALL" ] ) | "INTERSECT" | "MINUS" ) nodeChoice1 -> ( ( "(" SelectWithoutOrder() ")" ) | SelectWithoutOrder() )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.OrderByClause n)
nodeToken -> "ORDER" nodeToken1 -> "BY" sQLSimpleExpression -> SQLSimpleExpression() nodeOptional -> [ "ASC" | "DESC" ] nodeListOptional -> ( "," SQLSimpleExpression() [ "ASC" | "DESC" ] )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ForUpdateClause n)
nodeToken -> "FOR" nodeToken1 -> "UPDATE" nodeToken2 -> "OF" tableColumn -> TableColumn() nodeListOptional -> ( "," TableColumn() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLExpression n)
sQLAndExpression -> SQLAndExpression() nodeListOptional -> ( "OR" SQLAndExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLAndExpression n)
sQLUnaryLogicalExpression -> SQLUnaryLogicalExpression() nodeListOptional -> ( "AND" SQLUnaryLogicalExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLUnaryLogicalExpression n)
nodeChoice -> ExistsClause() | ( [ "NOT" ] SQLRelationalExpression() )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.ExistsClause n)
nodeOptional -> [ "NOT" ] nodeToken -> "EXISTS" nodeToken1 -> "(" subQuery -> SubQuery() nodeToken2 -> ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLRelationalExpression n)
nodeChoice -> ( "(" SQLExpressionList() ")" | ( [ "PRIOR" ] SQLSimpleExpression() ) ) nodeOptional -> ( SQLRelationalOperatorExpression() | ( SQLInClause() ) | ( SQLBetweenClause() ) | ( SQLLikeClause() ) | IsNullClause() )?
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLExpressionList n)
sQLSimpleExpression -> SQLSimpleExpression() nodeListOptional -> ( "," SQLSimpleExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLRelationalOperatorExpression n)
relop -> Relop() nodeChoice -> ( ( [ "ALL" | "ANY" ] "(" SubQuery() ")" ) | [ "PRIOR" ] SQLSimpleExpression() )
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLInClause n)
nodeOptional -> [ "NOT" ] nodeToken -> "IN" nodeToken1 -> "(" nodeChoice -> ( SQLExpressionList() | SubQuery() ) nodeToken2 -> ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLBetweenClause n)
nodeOptional -> [ "NOT" ] nodeToken -> "BETWEEN" sQLSimpleExpression -> SQLSimpleExpression() nodeToken1 -> "AND" sQLSimpleExpression1 -> SQLSimpleExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLLikeClause n)
nodeOptional -> [ "NOT" ] nodeToken -> "LIKE" sQLSimpleExpression -> SQLSimpleExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLSimpleExpression n)
sQLMultiplicativeExpression -> SQLMultiplicativeExpression() nodeListOptional -> ( ( "+" | "-" | "||" ) SQLMultiplicativeExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLMultiplicativeExpression n)
sQLExpotentExpression -> SQLExpotentExpression() nodeListOptional -> ( ( "*" | "/" ) SQLExpotentExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLExpotentExpression n)
sQLUnaryExpression -> SQLUnaryExpression() nodeListOptional -> ( "**" SQLUnaryExpression() )*
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLUnaryExpression n)
nodeOptional -> [ "+" | "-" ] sQLPrimaryExpression -> SQLPrimaryExpression()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLPrimaryExpression n)
nodeChoice -> "NULL" | FunctionCall() | OuterJoinExpression() | TableColumn() | | | | "(" SQLExpression() ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.FunctionCall n)
oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() [ "." OracleObjectName() ] ] nodeToken -> "(" nodeOptional1 -> [ [ "DISTINCT" | "ALL" ] ( SQLArguments() | "*" ) ] nodeToken1 -> ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SQLArguments n)
sQLExpressionList -> SQLExpressionList()
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.OuterJoinExpression n)
oracleObjectName -> OracleObjectName() nodeOptional -> [ "." OracleObjectName() [ "." OracleObjectName() ] ] nodeToken -> "(" nodeToken1 -> "+" nodeToken2 -> ")"
Overrides:
visit in class DepthFirstVisitor

visit

public void visit(schemaSQLParser.syntaxtree.SubQuery n)
selectWithoutOrder -> SelectWithoutOrder()
Overrides:
visit in class DepthFirstVisitor