|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Lexer
Interface for breaking a file into a sequence of tokens.
| Method Summary | |
|---|---|
void |
advance()
Advances the lexer to the next token. |
char[] |
getBuffer()
Returns the buffer over which the lexer is running. |
int |
getBufferEnd()
Returns the offset at which the lexer will stop lexing. |
LexerPosition |
getCurrentPosition()
Returns the current position and state of the lexer. |
int |
getState()
Returns the current state of the lexer. |
int |
getTokenEnd()
Returns the end offset of the current token. |
int |
getTokenStart()
Returns the start offset of the current token. |
IElementType |
getTokenType()
Returns the token at the current position of the lexer. |
void |
restore(LexerPosition position)
Restores the lexer to the specified state and position. |
void |
start(char[] buffer)
Prepare for lexing character data from buffer passed. |
void |
start(char[] buffer,
int startOffset,
int endOffset)
Prepare for lexing character data from buffer passed. |
void |
start(char[] buffer,
int startOffset,
int endOffset,
int initialState)
Prepare for lexing character data from buffer passed. |
| Method Detail |
|---|
void start(char[] buffer)
buffer passed. Lexing should be performed starting from offset 0 and
terminated (EOFed) at offset buffer.length. Internal lexer state is supposed to be initial.
YY_INITIAL for JLex and JFlex generated lexer.
buffer - character data for lexing.
void start(char[] buffer,
int startOffset,
int endOffset)
buffer passed. Lexing should be performed starting from offset startOffset and
terminated (EOFed) at offset endOffset. Internal lexer state is supposed to be initial. YY_INITIAL for JLex and JFlex generated
lexer.
buffer - character data for lexing.startOffset - offset to start lexing fromendOffset - offset to stop lexing at
void start(char[] buffer,
int startOffset,
int endOffset,
int initialState)
buffer passed. Lexing should be performed starting from offset startOffset> and
terminated (EOFed) at offset endOffset. Internal lexer state is supposed to be initialState. It is guaranteed
that the value of initialState has been returned by getState() method of this Lexer at condition startOffset=getTokenStart()
This method is used to incrementally relex changed characters using lexing data acquired from this particular lexer sometime in the past.
- Parameters:
buffer - character data for lexing.startOffset - offset to start lexing fromendOffset - offset to stop lexing atinitialState - the initial state of the lexer.
int getState()
IElementType getTokenType()
int getTokenStart()
int getTokenEnd()
void advance()
LexerPosition getCurrentPosition()
void restore(LexerPosition position)
position - the state and position to restore to.char[] getBuffer()
start() method.
int getBufferEnd()
endOffset parameter
to the start() method.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||