Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.javatools.parser.plsql.old
Class PlsqlLexer

java.lang.Object
  extended by oracle.javatools.parser.AbstractLexer
      extended by oracle.javatools.parser.plsql.old.PlsqlLexer

All Implemented Interfaces:
Lexer, PlsqlTokens

public class PlsqlLexer
extends AbstractLexer
implements PlsqlTokens

Based on the JavaLexer. Functional version. Mostly unoptimized...


Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.javatools.parser.AbstractLexer
AbstractLexer.DefaultLexerToken

 

Field Summary

 

Fields inherited from class oracle.javatools.parser.AbstractLexer
currentPos, textBuffer

 

Fields inherited from interface oracle.javatools.parser.plsql.old.PlsqlTokens
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

 

Fields inherited from interface oracle.javatools.parser.Lexer
TK_EOF, TK_NOT_FOUND

 

Constructor Summary
PlsqlLexer()
          Constructs a default PlsqlLexer with a starting position of 0.

 

Method Summary
 void backup()
          Unlexes the last found token.
static boolean isDecimalDigit(char digit)
          Utility routine to check whether the given digit is a decimal digit.
 int lex(LexerToken lexedToken)
          Scans the text buffer at the current position and returns the token that was found.
 void setPosition(int offset)
          Sets the current lex (read) position to the given offset in the buffer.
 void setSkipComments(boolean skipComments)
          Sets whether the PlsqlLexer should generate tokens for Java comments.
static java.lang.String tokenToString(int token)
           
static java.lang.String tokenToText(int token)
          Utility routine to map the token to the original text (if retrievable) of the token (for debug printing.)

 

Methods inherited from class oracle.javatools.parser.AbstractLexer
createLexerToken, getTextBuffer, setTextBuffer

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PlsqlLexer

public PlsqlLexer()
Constructs a default PlsqlLexer with a starting position of 0. Clients must call setTextBuffer() to initialize the text buffer used for the Lexer. To start lexing from an offset other than 0, call setPosition().

Method Detail

setSkipComments

public void setSkipComments(boolean skipComments)
Sets whether the PlsqlLexer should generate tokens for Java comments.
Parameters:
skipComments - true to ignore comments in token generation

lex

public int lex(LexerToken lexedToken)
Scans the text buffer at the current position and returns the token that was found. The token and offset information is also stored in the lexedToken instance passed in to the call.
Specified by:
lex in interface Lexer
Specified by:
lex in class AbstractLexer
Parameters:
lexedToken - the instance passed in where token info is stored
Returns:
the token that was found, same as calling lexedToken.getToken() (for convenience)

backup

public void backup()
Unlexes the last found token. The next call to lex() will return the last token and offset information found.
Specified by:
backup in interface Lexer
Specified by:
backup in class AbstractLexer

setPosition

public void setPosition(int offset)
Sets the current lex (read) position to the given offset in the buffer. It is the clients responsibility to ensure that this offset corresponds to the start of a token, otherwise unexpected (and incorrect) results may occur.
Specified by:
setPosition in interface Lexer
Overrides:
setPosition in class AbstractLexer
Parameters:
offset - the offset for the next lex() operation.

isDecimalDigit

public static boolean isDecimalDigit(char digit)
Utility routine to check whether the given digit is a decimal digit.
Parameters:
digit - the digit to check

tokenToString

public static java.lang.String tokenToString(int token)

tokenToText

public static java.lang.String tokenToText(int token)
Utility routine to map the token to the original text (if retrievable) of the token (for debug printing.)
Parameters:
token - the token to map
Returns:
a printable representation of the token

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


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