|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.parser.AbstractLexer
oracle.javatools.parser.java.v2.scanner.FastLexer
oracle.javatools.parser.java.v2.scanner.JavaLexer
public class JavaLexer
The JavaLexer
is an implementation of the Lexer
interface for the Source language. Details of the Source Language taken from Source Language Specification
Lexer
, JavaTokens
Nested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.javatools.parser.AbstractLexer |
---|
AbstractLexer.DefaultLexerToken |
Field Summary | |
---|---|
static KeywordTable |
keyword13Table The keyword table for j2se 1.3. |
static KeywordTable |
keyword14Table The keyword table for j2se 1.4. |
static KeywordTable |
keyword15Table The keyword table for j2se 1.5. |
Fields inherited from class oracle.javatools.parser.java.v2.scanner.FastLexer |
---|
skipComments |
Fields inherited from class oracle.javatools.parser.AbstractLexer |
---|
currentPos, textBuffer |
Fields inherited from interface oracle.javatools.parser.Lexer |
---|
TK_NOT_FOUND |
Constructor Summary | |
---|---|
JavaLexer() Constructs a default JavaLexer with a starting position of 0. |
|
JavaLexer(byte j2se) Constructs a default JavaLexer with a starting position of 0. |
Method Summary | |
---|---|
void |
backup() Unlexes the last found token. |
int |
getEndOffset() Fetches the end offset of the token (offset relative to the original ReadTextBuffer being lexed. |
int |
getStartOffset() Fetches the start offset of the token (offset relative to the original ReadTextBuffer being lexed. |
int |
getToken() Fetches the (language-specific) token represented by this LexerToken . |
protected boolean |
isComment(int tk) Used by the ArrayedLexer. |
static boolean |
isDecimalDigit(char digit) Utility routine to check whether the given digit is a decimal digit. |
static boolean |
isHexDigit(char digit) Utility routine to check whether the given digit is a hexadecimal digit. |
static boolean |
isOctalDigit(char digit) Utility routine to check whether the given digit is an octal digit. |
int |
lex() Calls lex( LexerToken ) but does not call fillLexerToken. |
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 |
setRecognizeSQLJ(boolean recognizeSQLJ) Sets whether the JavaLexer should recognize SQLJ statements and return a single token for them (instead of trying to lex it as Source.) |
Methods inherited from class oracle.javatools.parser.java.v2.scanner.FastLexer |
---|
setSkipComments |
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 |
Field Detail |
---|
public static final KeywordTable keyword13Table
public static final KeywordTable keyword14Table
public static final KeywordTable keyword15Table
Constructor Detail |
---|
public JavaLexer()
JavaLexer
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()
.public JavaLexer(byte j2se)
JavaLexer
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()
.
j2se
- Indicates which j2se version this lexer will support.Method Detail |
---|
public void setPosition(int offset)
AbstractLexer
setPosition
in interface Lexer
setPosition
in class AbstractLexer
offset
- the offset for the next lex()
operation.public void setRecognizeSQLJ(boolean recognizeSQLJ)
JavaLexer
should recognize SQLJ statements and return a single token for them (instead of trying to lex it as Source.)recognizeSQLJ
- true to recognize SQLJ statements as a tokenprotected boolean isComment(int tk)
FastLexer
isComment
in class FastLexer
public int getToken()
LexerToken
LexerToken
. You must refer to the language-specific Lexer that was responsible for filling this LexerToken
instance to interpret the token.getToken
in interface LexerToken
getToken
in class FastLexer
public int getStartOffset()
LexerToken
ReadTextBuffer
being lexed. Note that the start offset is inclusive (compare to end offset which is exclusive), to match the behavior in the String
class.getStartOffset
in interface LexerToken
getStartOffset
in class FastLexer
public int getEndOffset()
LexerToken
ReadTextBuffer
being lexed. Note that the end offset is exclusive (similar to end offsets in the String class.)getEndOffset
in interface LexerToken
getEndOffset
in class FastLexer
public int lex()
lex
in class FastLexer
public int lex(LexerToken lexedToken)
lexedToken
instance passed in to the call.lex
in interface Lexer
lex
in class FastLexer
lexedToken
- the instance passed in where token info is storedlexedToken.getToken()
(for convenience)public void backup()
FastLexer
lex()
will return the last token and offset information found.backup
in interface Lexer
backup
in class FastLexer
public static boolean isDecimalDigit(char digit)
digit
- the digit to checkpublic static boolean isOctalDigit(char digit)
digit
- the digit to checkpublic static boolean isHexDigit(char digit)
digit
- the digit to check
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |