-
字段概要
字段修饰符和类型字段说明protected CharSequenceprotected intprotected intprotected final IElementTypeprotected final charprotected intstatic final char -
构造器概要
构造器构造器说明StringLiteralLexer(char quoteChar, IElementType originalLiteralToken) StringLiteralLexer(char quoteChar, IElementType originalLiteralToken, boolean canEscapeEolOrFramingSpaces, String additionalValidEscapes) StringLiteralLexer(char quoteChar, IElementType originalLiteralToken, boolean canEscapeEolOrFramingSpaces, String additionalValidEscapes, boolean allowOctal, boolean allowHex) -
方法概要
修饰符和类型方法说明voidadvance()Advances the lexer to the next token.intReturns the offset at which the lexer will stop lexing.@NotNull CharSequenceReturns the buffer sequence over which the lexer is running.intgetState()Returns the current state of the lexer.intReturns the end offset of the current token.intReturns the start offset of the current token.Returns the token at the current position of the lexer ornullif lexing is finished.protected @NotNull IElementTypeprotected @NotNull IElementTypeprotected intlocateAdditionalEscapeSequence(int start, int indexOfCharAfterSlash) Locates the end of an additional (non-standard) escape sequence.protected intlocateHexEscapeSequence(int start, int i) protected intlocateUnicodeEscapeSequence(int start, int i) protected booleanvoidstart(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) Prepare for lexing character data frombufferpassed.toString()从类继承的方法 com.intellij.lexer.LexerBase
getCurrentPosition, restore从类继承的方法 com.intellij.lexer.Lexer
getTokenSequence, getTokenText, start, start
-
字段详细资料
-
NO_QUOTE_CHAR
public static final char NO_QUOTE_CHAR- 另请参阅:
-
myBuffer
-
myStart
protected int myStart -
myEnd
protected int myEnd -
myBufferEnd
protected int myBufferEnd -
myQuoteChar
protected final char myQuoteChar -
myOriginalLiteralToken
-
-
构造器详细资料
-
StringLiteralLexer
-
StringLiteralLexer
public StringLiteralLexer(char quoteChar, IElementType originalLiteralToken, boolean canEscapeEolOrFramingSpaces, String additionalValidEscapes) -
StringLiteralLexer
public StringLiteralLexer(char quoteChar, IElementType originalLiteralToken, boolean canEscapeEolOrFramingSpaces, String additionalValidEscapes, boolean allowOctal, boolean allowHex) - 参数:
canEscapeEolOrFramingSpaces-trueif following sequences are acceptable:
*'\'at the end of the buffer (meaning escaped end of line)
*'\ '(escaped space) at the beginning and ath the end of the buffer (meaning escaped space, to avoid auto trimming on load)
-
-
方法详细资料
-
start
public void start(@NotNull @NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) 从类复制的说明:LexerPrepare for lexing character data frombufferpassed. Internal lexer state is supposed to beinitialState. It is guaranteed that the value of initialState is the same as returned byLexer.getState()method of this lexer at conditionstartOffset=getTokenStart(). This method is used to incrementally re-lex changed characters using lexing data acquired from this particular lexer sometime in the past. -
getState
public int getState()从类复制的说明:LexerReturns the current state of the lexer. -
getTokenType
从类复制的说明:LexerReturns the token at the current position of the lexer ornullif lexing is finished.- 指定者:
getTokenType在类中Lexer- 返回:
- the current token.
-
shouldAllowSlashZero
protected boolean shouldAllowSlashZero() -
handleSingleSlashEscapeSequence
-
getUnicodeEscapeSequenceType
-
getTokenStart
public int getTokenStart()从类复制的说明:LexerReturns the start offset of the current token.- 指定者:
getTokenStart在类中Lexer- 返回:
- the current token start offset.
-
getTokenEnd
public int getTokenEnd()从类复制的说明:LexerReturns the end offset of the current token.- 指定者:
getTokenEnd在类中Lexer- 返回:
- the current token end offset.
-
locateHexEscapeSequence
protected int locateHexEscapeSequence(int start, int i) -
locateUnicodeEscapeSequence
protected int locateUnicodeEscapeSequence(int start, int i) -
locateAdditionalEscapeSequence
protected int locateAdditionalEscapeSequence(int start, int indexOfCharAfterSlash) Locates the end of an additional (non-standard) escape sequence. The sequence is considered to begin with a backslash symbol located at the
startindex of the lexer's buffer.Override this method if your language supports non-standard escape sequences. For example, in Go language Unicode escapes look like '\U12345678'. To locate this escape sequence, the implementation should check that
indexOfCharAfterSlashpoints to the 'U' symbol in the buffer and returnstart + 8(or the end index of the buffer if it is too short). Otherwise, the implementations should return -1 to indicate that the current buffer starting at the indexstartdoesn't represent an additional escape sequence.When overriding this method, you most likely will need to also override
getTokenType()to return proper type for the sequences located here. -
advance
public void advance()从类复制的说明:LexerAdvances the lexer to the next token. -
getBufferSequence
从类复制的说明:LexerReturns the buffer sequence over which the lexer is running. This method should return the same buffer instance which was passed to thestart()method.- 指定者:
getBufferSequence在类中Lexer- 返回:
- the lexer buffer.
-
getBufferEnd
public int getBufferEnd()从类复制的说明:LexerReturns the offset at which the lexer will stop lexing. This method should return the length of the buffer or the value passed in theendOffsetparameter to thestart()method.- 指定者:
getBufferEnd在类中Lexer- 返回:
- the lexing end offset
-
toString
-