|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.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 LexersetTextBuffer in class AbstractLexertextBuffer - the text buffer to usepublic void setPosition(int offset)
AbstractLexer
setPosition in interface LexersetPosition in class AbstractLexeroffset - 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)
FastLexerFastLexer should generate tokens
for Source comments.
setSkipComments in class FastLexerskipComments - true to ignore comments in token generationprotected boolean isComment(int tk)
FastLexer
isComment in class FastLexerpublic int getToken()
LexerTokenLexerToken. You must refer to the language-specific
Lexer that was responsible for filling this
LexerToken instance to interpret the token.
getToken in interface LexerTokengetToken in class FastLexerpublic int getStartOffset()
LexerTokenReadTextBuffer 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 LexerTokengetStartOffset in class FastLexerpublic int getEndOffset()
LexerTokenReadTextBuffer being lexed. Note that the end offset is
exclusive (similar to end offsets in the String class.)
getEndOffset in interface LexerTokengetEndOffset in class FastLexerpublic int getTokenIndex()
public int lex()
FastLexer
lex in class FastLexerpublic int lex(LexerToken lexerToken)
AbstractLexerlexedToken instance passed in to the
call.
lex in interface Lexerlex in class FastLexerlexerToken - 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.4.0) E13403-05 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||