public class FilterLexer extends DelegateLexer
Modifier and Type | Class and Description |
---|---|
static interface |
FilterLexer.Filter |
static class |
FilterLexer.SetFilter |
myDelegate
Constructor and Description |
---|
FilterLexer(Lexer original,
FilterLexer.Filter filter) |
FilterLexer(Lexer original,
FilterLexer.Filter filter,
boolean[] stateFilter) |
Modifier and Type | Method and Description |
---|---|
void |
advance()
Advances the lexer to the next token.
|
LexerPosition |
getCurrentPosition()
Returns the current position and state of the lexer.
|
Lexer |
getOriginal() |
int |
getPrevTokenEnd() |
void |
locateToken() |
void |
restore(LexerPosition position)
Restores the lexer to the specified state and position.
|
void |
start(java.lang.CharSequence buffer,
int startOffset,
int endOffset,
int initialState)
Prepare for lexing character data from
buffer passed. |
getBufferEnd, getBufferSequence, getDelegate, getState, getTokenEnd, getTokenStart, getTokenType
getTokenSequence, getTokenText, start, start
public FilterLexer(Lexer original, FilterLexer.Filter filter, boolean[] stateFilter)
public FilterLexer(Lexer original, FilterLexer.Filter filter)
public Lexer getOriginal()
public void start(java.lang.CharSequence buffer, int startOffset, int endOffset, int initialState)
Lexer
buffer
passed. Internal lexer state is supposed to be initialState
. It is guaranteed
that the value of initialState is the same as returned by Lexer.getState()
method of this lexer at condition startOffset=getTokenStart()
.
This method is used to incrementally re-lex changed characters using lexing data acquired from this particular lexer sometime in the past.start
in class DelegateLexer
buffer
- character data for lexing.startOffset
- offset to start lexing fromendOffset
- offset to stop lexing atinitialState
- the initial state of the lexer.public void advance()
Lexer
advance
in class DelegateLexer
public int getPrevTokenEnd()
public LexerPosition getCurrentPosition()
Lexer
getCurrentPosition
in class LexerBase
public void restore(LexerPosition position)
Lexer
public final void locateToken()