|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.intellij.lexer.LexerBase
com.intellij.lexer.MergingLexerAdapter
public class MergingLexerAdapter
| Field Summary | |
|---|---|
protected Lexer |
myOriginal
|
protected int |
myState
|
protected int |
myTokenStart
|
protected IElementType |
myTokenType
|
| Constructor Summary | |
|---|---|
MergingLexerAdapter(Lexer original,
TokenSet tokensToMerge)
|
|
| 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. |
Lexer |
getOriginal()
|
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. |
protected void |
locateToken()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Lexer myOriginal
protected IElementType myTokenType
protected int myState
protected int myTokenStart
| Constructor Detail |
|---|
public MergingLexerAdapter(Lexer original,
TokenSet tokensToMerge)
| Method Detail |
|---|
public void start(char[] buffer)
Lexerbuffer 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.
public void start(char[] buffer,
int startOffset,
int endOffset)
Lexerbuffer 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
public void start(char[] buffer,
int startOffset,
int endOffset,
int initialState)
Lexerbuffer 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 Lexer.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.
public int getState()
Lexer
public IElementType getTokenType()
Lexer
public int getTokenStart()
Lexer
public int getTokenEnd()
Lexer
public void advance()
Lexer
public char[] getBuffer()
Lexerstart() method.
public int getBufferEnd()
LexerendOffset parameter
to the start() method.
protected void locateToken()
public Lexer getOriginal()
public void restore(LexerPosition position)
Lexer
restore in interface Lexerrestore in class LexerBaseposition - the state and position to restore to.public LexerPosition getCurrentPosition()
Lexer
getCurrentPosition in interface LexergetCurrentPosition in class LexerBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||