public abstract class BaseHtmlLexer extends DelegateLexer
Modifier and Type | Class and Description |
---|---|
static interface |
BaseHtmlLexer.TokenHandler |
class |
BaseHtmlLexer.XmlNameHandler |
Modifier and Type | Field and Description |
---|---|
protected static int |
BASE_STATE_MASK |
protected static int |
BASE_STATE_SHIFT |
protected boolean |
caseInsensitive |
protected static Language |
ourDefaultStyleLanguage |
protected java.lang.String |
scriptType |
protected boolean |
seenAttribute |
protected boolean |
seenContentType |
protected boolean |
seenScript |
protected boolean |
seenStyle |
protected boolean |
seenStylesheetType |
protected boolean |
seenTag |
protected java.lang.String |
styleType |
myDelegate
Modifier | Constructor and Description |
---|---|
protected |
BaseHtmlLexer(Lexer _baseLexer,
boolean _caseInsensitive) |
Modifier and Type | Method and Description |
---|---|
void |
advance()
Advances the lexer to the next token.
|
protected boolean |
endOfTheEmbeddment(java.lang.String name) |
protected HtmlScriptContentProvider |
findScriptContentProvider(java.lang.String mimeType) |
protected int |
getBaseStateShift() |
protected IElementType |
getCurrentScriptElementType() |
protected IElementType |
getCurrentStylesheetElementType() |
protected char |
getFirstChar(Lexer lexer) |
protected Language |
getScriptLanguage() |
int |
getState()
Returns the current state of the lexer.
|
protected Language |
getStyleLanguage() |
protected boolean |
hasSeenAttribute() |
protected boolean |
hasSeenScript() |
protected boolean |
hasSeenStyle() |
protected boolean |
hasSeenTag() |
protected abstract boolean |
isHtmlTagState(int state) |
protected boolean |
isValidAttributeValueTokenType(IElementType tokenType) |
protected void |
popScriptStyle() |
protected void |
pushScriptStyle(boolean script,
boolean style) |
protected void |
registerHandler(IElementType elementType,
BaseHtmlLexer.TokenHandler value) |
protected int |
skipToTheEndOfTheEmbeddment() |
void |
start(java.lang.CharSequence buffer,
int startOffset,
int endOffset,
int initialState)
Prepare for lexing character data from
buffer passed. |
getBufferEnd, getBufferSequence, getDelegate, getTokenEnd, getTokenStart, getTokenType
getCurrentPosition, restore
getTokenSequence, getTokenText, start, start
protected static final int BASE_STATE_MASK
protected static final int BASE_STATE_SHIFT
protected static final Language ourDefaultStyleLanguage
protected boolean seenTag
protected boolean seenAttribute
protected boolean seenStyle
protected boolean seenScript
protected java.lang.String scriptType
protected java.lang.String styleType
protected final boolean caseInsensitive
protected boolean seenContentType
protected boolean seenStylesheetType
protected BaseHtmlLexer(Lexer _baseLexer, boolean _caseInsensitive)
protected char getFirstChar(Lexer lexer)
protected void pushScriptStyle(boolean script, boolean style)
protected void popScriptStyle()
protected Language getScriptLanguage()
protected Language getStyleLanguage()
protected IElementType getCurrentScriptElementType()
protected IElementType getCurrentStylesheetElementType()
protected HtmlScriptContentProvider findScriptContentProvider(java.lang.String mimeType)
protected void registerHandler(IElementType elementType, BaseHtmlLexer.TokenHandler value)
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.protected int skipToTheEndOfTheEmbeddment()
protected boolean endOfTheEmbeddment(java.lang.String name)
protected boolean isValidAttributeValueTokenType(IElementType tokenType)
public void advance()
Lexer
advance
in class DelegateLexer
public int getState()
Lexer
getState
in class DelegateLexer
protected final boolean hasSeenStyle()
protected final boolean hasSeenAttribute()
protected final boolean hasSeenTag()
protected boolean hasSeenScript()
protected int getBaseStateShift()
protected abstract boolean isHtmlTagState(int state)