Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.parser.plsql.old.symbol
Class PlsqlSymbolFactory

java.lang.Object
  extended by oracle.javatools.parser.plsql.old.symbol.PlsqlSymbolFactory
All Implemented Interfaces:
PlsqlSyntaxCodes

public class PlsqlSymbolFactory
extends java.lang.Object
implements PlsqlSyntaxCodes


Field Summary
 
Fields inherited from interface oracle.javatools.parser.plsql.old.PlsqlSyntaxCodes
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 Summary
PlsqlSymbolFactory()
           
 
Method Summary
 PlsqlSymbol createAndFinishErrorSymbol(SyntaxToken token, CommonRoot root)
           
 PlsqlSymbol createSymbol(int syntaxCode, int startOffset, int endOffset, PlsqlSymbol parent)
          Creates an empty symbol.
 PlsqlSymbol createSymbol(SyntaxToken token, PlsqlSymbol parent)
          Creates an empty symbol.
 void finishSymbol(PlsqlSymbol symbol, ReadTextBuffer buffer)
          Finishes a symbol's setup by looking at the symbol's syntax code and doing the appropriate wiring.
 void finishSymbol(PlsqlSymbol symbol, SyntaxToken token, ReadTextBuffer buffer)
          Finishes a symbol's setup by looking at the symbol's syntax code and doing the appropriate wiring.
 boolean forceFinishSymbol(PlsqlSymbol symbol, int endOffset, ReadTextBuffer buffer)
          Attempts to finish a symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlsqlSymbolFactory

public PlsqlSymbolFactory()
Method Detail

createAndFinishErrorSymbol

public PlsqlSymbol createAndFinishErrorSymbol(SyntaxToken token,
                                              CommonRoot root)
Parameters:
token - The offending syntax token in the parse.
error - The string message for this error
root - The RootSymbol for this parse.
Returns:
The created and finished error symbol.

createSymbol

public PlsqlSymbol createSymbol(SyntaxToken token,
                                PlsqlSymbol parent)
Creates an empty symbol.

Parameters:
token - The syntax token to be used for creation parameters.
parent - The parent node for this symbol. If unknown, set to null.
Returns:
The newly created albeit empty symbol.

createSymbol

public PlsqlSymbol createSymbol(int syntaxCode,
                                int startOffset,
                                int endOffset,
                                PlsqlSymbol parent)
Creates an empty symbol.

Parameters:
syntaxCode - The syntax code of this symbol
startOffset - The start offset into the ReadTextBuffer. (inclusive)
endOffset - The end offset into the ReadTextBuffer. (exclusive) If unknown, set to -1.
parent - The parent node for this symbol. If unknown, set to null.
Returns:
The newly created albeit empty symbol.

forceFinishSymbol

public boolean forceFinishSymbol(PlsqlSymbol symbol,
                                 int endOffset,
                                 ReadTextBuffer buffer)
Attempts to finish a symbol.

Returns:
True, finished without mishap. False, threw an exception.

finishSymbol

public void finishSymbol(PlsqlSymbol symbol,
                         SyntaxToken token,
                         ReadTextBuffer buffer)
Finishes a symbol's setup by looking at the symbol's syntax code and doing the appropriate wiring. Should be called when a symbol's innards have been filled out and it's ready to be wired into the parse tree.

In some case, especially during parsing, the end offset of the symbol is not known until the innards have been hooked up. Thus, this finishSymbol sets the end offset and wires up the symbol.

The buffer is used only to create the name string for the NameSymbols.

Parameters:
symbol - The symbol to be finished.
token - The syntax token to be referenced for the end offset.
buffer - The ReadTextBuffer that this symbol was parsed from.

finishSymbol

public void finishSymbol(PlsqlSymbol symbol,
                         ReadTextBuffer buffer)
Finishes a symbol's setup by looking at the symbol's syntax code and doing the appropriate wiring. Should be called when a symbol's innards have been filled out and it's ready to be wired into the parse tree.

The buffer is used only to create the name string for the NameSymbols.

Parameters:
symbol - The symbol to be finished.
buffer - The ReadTextBuffer that this symbol was parsed from.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.