|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
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.ArrayedLexer
public final class ArrayedLexer
Lexer based on a precalculated array of tokens.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.javatools.parser.AbstractLexer |
---|
AbstractLexer.DefaultLexerToken |
Field Summary |
---|
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_EOF, TK_NOT_FOUND |
Constructor Summary | |
---|---|
ArrayedLexer(TokenArray tokens,
FastLexer baseLexer)
|
Method Summary | |
---|---|
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 . |
int |
getTokenIndex()
Calling getTokenIndex() before the initial lex() will produce an unpredictable result. |
protected boolean |
isComment(int tk)
Used by the ArrayedLexer. |
int |
lex()
Calls lex( LexerToken ) but does not call fillLexerToken. |
int |
lex(LexerToken lexerToken)
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 FastLexer should generate tokens
for Source comments. |
void |
setTextBuffer(ReadTextBuffer textBuffer)
Sets the text buffer that is to be used by this Lexer. |
void |
setTokenIndex(int index)
|
Methods inherited from class oracle.javatools.parser.java.v2.scanner.FastLexer |
---|
backup |
Methods inherited from class oracle.javatools.parser.AbstractLexer |
---|
createLexerToken, getTextBuffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayedLexer(TokenArray tokens, FastLexer baseLexer)
Method Detail |
---|
public void setTextBuffer(ReadTextBuffer textBuffer)
AbstractLexer
setTextBuffer
in interface Lexer
setTextBuffer
in class AbstractLexer
textBuffer
- the text buffer to usepublic void setPosition(int offset)
AbstractLexer
setPosition
in interface Lexer
setPosition
in class AbstractLexer
offset
- The start offset of (or in the whitespace previous
to) the next token to be returned by lex().public void setTokenIndex(int index)
index
- Token index of the next token to be returned by lex().public void setSkipComments(boolean skipComments)
FastLexer
FastLexer
should generate tokens
for Source comments.
setSkipComments
in class FastLexer
skipComments
- true to ignore comments in token generationprotected 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 getTokenIndex()
public int lex()
FastLexer
lex
in class FastLexer
public int lex(LexerToken lexerToken)
AbstractLexer
lexedToken
instance passed in to the
call.
lex
in interface Lexer
lex
in class FastLexer
lexerToken
- the instance passed in where token info is stored
lexedToken.getToken()
(for convenience)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |