public abstract class PlsqlSyntaxRecognizer extends AbstractSyntaxRecognizer implements PlsqlSyntaxCodes, PlsqlTokens
Modifier and Type | Field and Description |
---|---|
static int |
INPUT_EXPRESSION
The input buffer contains an expression.
|
static int |
INPUT_ROOT
The input buffer contains a full Plsql file.
|
static int |
LEVEL_EXPRESSION
In expression level, all parsing options are enabled.
|
static int |
LEVEL_ROOT
In root level, parsing is done on a full Plsql file.
|
protected int |
startLevel |
curLexerToken, curToken, DEBUG_OUTPUT, debugLevel, DEBUGLEVEL_HIGH, DEBUGLEVEL_MINIMAL, INTERNALERR_BACKEDUP_TWICE, INTERNALERR_BACKUP_NOT_IMPLEMENTED_YET, INTERNALERR_CANT_ACCESS_LEXER_TOKEN_ON_BACKUP, lexer, listener, peekingToken, resources, SYNTAX_EOF, SYNTAX_ERROR, SYNTAX_ROOT, SYNTAXERR_SKIPPING, TK_EOF
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
TK_ASG, TK_ASSOC, TK_AT, TK_ATTRIBUTE, TK_BOOLEAN_LITERAL, TK_CHAR_LITERAL, TK_COLON, TK_COMMA, TK_CONCAT, TK_DIV, TK_DOT, TK_EQ, TK_EXPONENT, TK_FLOAT_LITERAL, TK_GE, TK_GT, TK_IDENTIFIER, TK_INT_LITERAL, TK_INVALID, TK_LE, TK_LLABEL, TK_LPAREN, TK_LT, TK_MINUS, TK_MUL, TK_MULTI_COMMENT, TK_NE, TK_NULL_LITERAL, TK_OUTERJOIN, TK_PLUS, TK_QUOTED_IDENTIFIER, TK_RANGE, TK_RLABEL, TK_RPAREN, TK_SEMI, TK_SINGLE_COMMENT, TKKW_ALL, TKKW_ALTER, TKKW_AND, TKKW_ANY, TKKW_ARRAY, TKKW_AS, TKKW_ASC, TKKW_AT, TKKW_AUTHID, TKKW_AVG, TKKW_BEGIN, TKKW_BETWEEN, TKKW_BFILE, TKKW_BINARY_INTEGER, TKKW_BLOB, TKKW_BODY, TKKW_BOOLEAN, TKKW_BULK, TKKW_BY, TKKW_CASE, TKKW_CHAR, TKKW_CHAR_BASE, TKKW_CHECK, TKKW_CLOB, TKKW_CLOSE, TKKW_CLUSTER, TKKW_COALESCE, TKKW_COLLECT, TKKW_COMMENT, TKKW_COMMIT, TKKW_COMPRESS, TKKW_CONNECT, TKKW_CONSTANT, TKKW_CREATE, TKKW_CURRENT, TKKW_CURRVAL, TKKW_CURSOR, TKKW_DATE, TKKW_DAY, TKKW_DEC, TKKW_DECIMAL, TKKW_DECLARE, TKKW_DEFAULT, TKKW_DELETE, TKKW_DESC, TKKW_DISTINCT, TKKW_DO, TKKW_DROP, TKKW_ELSE, TKKW_ELSIF, TKKW_END, TKKW_EXCEPTION, TKKW_EXCLUSIVE, TKKW_EXECUTE, TKKW_EXISTS, TKKW_EXIT, TKKW_EXTENDS, TKKW_EXTRACT, TKKW_FALSE, TKKW_FETCH, TKKW_FLOAT, TKKW_FOR, TKKW_FORALL, TKKW_FROM, TKKW_FUNCTION, TKKW_GOTO, TKKW_GROUP, TKKW_HAVING, TKKW_HEAP, TKKW_HOUR, TKKW_IF, TKKW_IMMEDIATE, TKKW_IN, TKKW_INDEX, TKKW_INDICATOR, TKKW_INSERT, TKKW_INTEGER, TKKW_INTERFACE, TKKW_INTERSECT, TKKW_INTERVAL, TKKW_INTO, TKKW_IS, TKKW_ISOLATION, TKKW_JAVA, TKKW_LEVEL, TKKW_LIKE, TKKW_LIMITED, TKKW_LOCK, TKKW_LONG, TKKW_LOOP, TKKW_MAX, TKKW_MIN, TKKW_MINUS, TKKW_MINUTE, TKKW_MLSLABEL, TKKW_MOD, TKKW_MODE, TKKW_MONTH, TKKW_NATURAL, TKKW_NATURALN, TKKW_NCHAR, TKKW_NCLOB, TKKW_NEW, TKKW_NEXTVAL, TKKW_NOCOPY, TKKW_NOT, TKKW_NOWAIT, TKKW_NULL, TKKW_NULLIF, TKKW_NUMBER, TKKW_NUMBER_BASE, TKKW_NUMERIC, TKKW_NVARCHAR2, TKKW_OCIROWID, TKKW_OF, TKKW_ON, TKKW_OPAQUE, TKKW_OPEN, TKKW_OPERATOR, TKKW_OPTION, TKKW_OR, TKKW_ORDER, TKKW_ORGANIZATION, TKKW_OTHERS, TKKW_OUT, TKKW_PACKAGE, TKKW_PARTITION, TKKW_PCTFREE, TKKW_PLS_INTEGER, TKKW_POSITIVE, TKKW_POSITIVEN, TKKW_PRAGMA, TKKW_PRIOR, TKKW_PRIVATE, TKKW_PROCEDURE, TKKW_PUBLIC, TKKW_RAISE, TKKW_RANGE, TKKW_RAW, TKKW_REAL, TKKW_RECORD, TKKW_REF, TKKW_RELEASE, TKKW_RETURN, TKKW_REVERSE, TKKW_ROLLBACK, TKKW_ROW, TKKW_ROWID, TKKW_ROWNUM, TKKW_ROWTYPE, TKKW_SAVEPOINT, TKKW_SECOND, TKKW_SELECT, TKKW_SEPARATE, TKKW_SET, TKKW_SHARE, TKKW_SMALLINT, TKKW_SPACE, TKKW_SQL, TKKW_SQLCODE, TKKW_SQLERRM, TKKW_START, TKKW_STDDEV, TKKW_SUBTYPE, TKKW_SUCCESSFUL, TKKW_SUM, TKKW_SYNONYM, TKKW_SYSDATE, TKKW_TABLE, TKKW_THEN, TKKW_TIME, TKKW_TIMESTAMP, TKKW_TIMEZONE_ABBR, TKKW_TIMEZONE_HOUR, TKKW_TIMEZONE_MINUTE, TKKW_TIMEZONE_REGION, TKKW_TO, TKKW_TRIGGER, TKKW_TRUE, TKKW_TYPE, TKKW_UID, TKKW_UNION, TKKW_UNIQUE, TKKW_UPDATE, TKKW_USE, TKKW_USER, TKKW_VALIDATE, TKKW_VALUES, TKKW_VARCHAR, TKKW_VARCHAR2, TKKW_VARIANCE, TKKW_VIEW, TKKW_WHEN, TKKW_WHENEVER, TKKW_WHERE, TKKW_WHILE, TKKW_WITH, TKKW_WORK, TKKW_WRITE, TKKW_YEAR, TKKW_ZONE
Constructor and Description |
---|
PlsqlSyntaxRecognizer() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
_codeToString(int code)
Converts the syntax code into a string.
|
static java.lang.String |
codeToString(int code) |
protected void |
errorExpecting(int token)
Generates an error-expecting token.
|
protected void |
finishName() |
protected void |
handleName() |
Lexer |
instantiatePreferredLexer()
Subclasses should instantiate and customize preferred lexers
here.
|
static boolean |
isExpressionStatementPrefix(int token)
Simple expression statements can be described as either "keyword;"
or "keyword expression;".
|
static boolean |
isInfixOperator(int token) |
static boolean |
isKeywordToken(int token) |
static boolean |
isLiteralToken(int token) |
static boolean |
isPrefixOperator(int token) |
static boolean |
isSpecialOperator(int token) |
static boolean |
isSqlStatementPrefix(int token) |
static boolean |
isSuffixOperator(int token) |
static PlsqlSyntaxRecognizer |
newRecognizer()
Instantiates a new recognizer that starts at the root and will do
a full Plsql parse.
|
static PlsqlSyntaxRecognizer |
newRecognizer(int startLevel,
int depthLevel)
Instantiates a new recognizer that starts at the given depth and
will parse down to the given depth.
|
protected void |
nextTokenIdentifier(java.lang.String id) |
protected void |
nextTokenIdentifier(java.lang.String id,
java.lang.String id2) |
protected boolean |
optionalName() |
protected boolean |
optionalTokenIdentifier(java.lang.String id) |
void |
parse()
Does the parse.
|
protected abstract void |
parseExpression() |
protected abstract void |
parseRoot() |
protected void |
parseSchemaName() |
protected void |
parseSimpleName() |
protected abstract void |
parseSqlExpression() |
_assert, copyStartOffset, curTokenToString, errorCheckpoint, errorEof, errorUnexpected, errorUnexpected, finish, finishInherit, finishToken, finishToken, finishToken, getCode, getContextString, getDataValue, getDebugLevel, getLexer, initialize, initialize, initialize, internalError, nextToken, nextToken, notImplementedYet, optionalToken, peekToken, reportSyntaxError, reportSyntaxError, reportSyntaxError, setContextString, setDataValue, setDebugLevel, setListener, skipToken, start, startQuiet
public static final int LEVEL_ROOT
public static final int LEVEL_EXPRESSION
public static final int INPUT_ROOT
public static final int INPUT_EXPRESSION
protected int startLevel
public static PlsqlSyntaxRecognizer newRecognizer()
public static PlsqlSyntaxRecognizer newRecognizer(int startLevel, int depthLevel)
startLevel
- the parse level to start parsing at. LEVEL_ROOT
is for parsing a Plsql file, LEVEL_EXPRESSION is for parsing an expression.depthLevel
- the parse level to parse down to. LEVEL_ROOT
will parse down to but not into code blocks. LEVEL_EXPRESSION will do
a full Java parse.public static final boolean isKeywordToken(int token)
public static final boolean isLiteralToken(int token)
public static final boolean isPrefixOperator(int token)
public static final boolean isSuffixOperator(int token)
public static final boolean isInfixOperator(int token)
public static final boolean isSpecialOperator(int token)
public static final boolean isExpressionStatementPrefix(int token)
public static final boolean isSqlStatementPrefix(int token)
protected final void nextTokenIdentifier(java.lang.String id, java.lang.String id2)
protected final void nextTokenIdentifier(java.lang.String id)
protected final boolean optionalTokenIdentifier(java.lang.String id)
protected final void handleName()
protected final boolean optionalName()
protected final void finishName()
protected final void parseSchemaName()
protected final void parseSimpleName()
protected abstract void parseSqlExpression()
protected abstract void parseExpression()
protected abstract void parseRoot()
public void parse()
AbstractSyntaxRecognizer
parse
in class AbstractSyntaxRecognizer
public Lexer instantiatePreferredLexer()
AbstractSyntaxRecognizer
instantiatePreferredLexer
in class AbstractSyntaxRecognizer
protected void errorExpecting(int token)
AbstractSyntaxRecognizer
errorExpecting
in class AbstractSyntaxRecognizer
public java.lang.String _codeToString(int code)
AbstractSyntaxRecognizer
_codeToString
in class AbstractSyntaxRecognizer
public static java.lang.String codeToString(int code)