|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
oracle.javatools.parser.AbstractLexer
public abstract class AbstractLexer
The AbstractLexer is a basic abstract implementation which takes care of common functionality across all Lexers, such as the buffer and offset issues, and for providing a basic LexerToken object which just stores token and offset information.
Lexer, AbstractLexer.DefaultLexerToken| Nested Class Summary | |
|---|---|
protected static class |
AbstractLexer.DefaultLexerTokenThe DefaultLexerToken just implements a basic LexerToken which stores a token and start/end offsets. |
| Field Summary | |
|---|---|
protected int |
currentPosThe current position in the buffer where the next lex operation will occur (assuming that backup() has not been called.) |
protected ReadTextBuffer |
textBufferThe underlying text buffer we are lexing. |
| Fields inherited from interface oracle.javatools.parser.Lexer |
|---|
TK_EOF, TK_NOT_FOUND |
| Constructor Summary | |
|---|---|
AbstractLexer() |
|
| Method Summary | |
|---|---|
abstract void |
backup()Unlexes the last found token. |
LexerToken |
createLexerToken()Creates an empty LexerToken for a specific Lexer implementation to be passed in to the lex() call to be filled in. |
ReadTextBuffer |
getTextBuffer()Gets the text buffer that is being used by this Lexer. |
abstract 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 |
setTextBuffer(ReadTextBuffer buffer)Sets the text buffer that is to be used by this Lexer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ReadTextBuffer textBuffer
protected int currentPos
backup() has not been called.)| Constructor Detail |
|---|
public AbstractLexer()
| Method Detail |
|---|
public void setTextBuffer(ReadTextBuffer buffer)
setTextBuffer in interface Lexerbuffer - the text buffer to usepublic ReadTextBuffer getTextBuffer()
getTextBuffer in interface Lexerpublic void setPosition(int offset)
setPosition in interface Lexeroffset - the offset for the next lex() operation.public LexerToken createLexerToken()
LexerToken for a specific Lexer implementation to be passed in to the lex() call to be filled in.createLexerToken in interface Lexerpublic abstract int lex(LexerToken lexedToken)
lexedToken instance passed in to the call.lex in interface LexerlexedToken - the instance passed in where token info is storedlexedToken.getToken() (for convenience)public abstract void backup()
lex() will return the last token and offset information found.backup in interface Lexer
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||