Top Fields Constructors Methods
io.github.kusoroadeolu.veneer

pack-priv abstract Class PythonLexerBase

extends Lexer
Class Inheritance
Known Direct Subclasses
io.github.kusoroadeolu.veneer.PythonLexer
Imports
java.util.*, java.util.regex.Matcher, .Pattern, org.antlr.v4.runtime.*, io.github.kusoroadeolu.veneer.PythonLexer

Field Summary

Modifier and TypeField and Description
private Deque<String>
private int
private Token
private final String
private Token
private Deque<Integer>
private final int
private int
private Deque<Integer>
private int
private Deque<Integer>
private Deque<Token>
private String
private int
private boolean
private boolean
private boolean
Inherited from org.antlr.v4.runtime.Lexer:
_channel_factory_hitEOF_input_mode_modeStack_text_token_tokenFactorySourcePair_tokenStartCharIndex_tokenStartCharPositionInLine_tokenStartLine_typeDEFAULT_MODEDEFAULT_TOKEN_CHANNELHIDDENMAX_CHAR_VALUEMIN_CHAR_VALUEMORESKIP

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private void
private void
createAndAddPendingToken(final int ttype, final int channel, final String text, final Token sampleToken)

private void
createNewCurToken(final int type, final String text, final int channel)

private void
private String
getEncodingName(final String commentText)

private int
getIndentationLength(final String indentText)

private String
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
init()

private void
private void
insertIndentOrDedentToken(final int indentLength)

private void
private void
public Token
nextToken()

Overrides org.antlr.v4.runtime.Lexer.nextToken.

Implements org.antlr.v4.runtime.TokenSource.nextToken.

Return a token from this source; i.e., match a token on the char stream.

private void
private void
private void
pushLexerMode(final int mode)

private void
reportError(final String errMsg)

private void
reportLexerError(final String errMsg)

public void
private void
private void
private void
private void
private void
trimLastCharAddPendingTokenSetCurToken(final int type, final String text, final int channel)

Inherited from org.antlr.v4.runtime.Lexer:
emitemitemitEOFgetAllTokensgetChannelgetChannelNamesgetCharErrorDisplaygetCharIndexgetCharPositionInLinegetErrorDisplaygetErrorDisplaygetInputStreamgetLinegetModeNamesgetSourceNamegetTextgetTokengetTokenFactorygetTokenNamesgetTypemodemorenotifyListenerspopModepushModerecoverrecoversetChannelsetCharPositionInLinesetInputStreamsetLinesetTextsetTokensetTokenFactorysetTypeskip

Field Detail

braceExpressionStackback to summary
private Deque<String> braceExpressionStack
curLexerModeback to summary
private int curLexerMode
curTokenback to summary
private Token curToken
ERR_TXTback to summary
private final String ERR_TXT
ffgTokenback to summary
private Token ffgToken
indentLengthStackback to summary
private Deque<Integer> indentLengthStack
INVALID_LENGTHback to summary
private final int INVALID_LENGTH
lastPendingTokenTypeFromDefaultChannelback to summary
private int lastPendingTokenTypeFromDefaultChannel
lexerModeStackback to summary
private Deque<Integer> lexerModeStack
openedback to summary
private int opened
paren_or_bracket_openedStackback to summary
private Deque<Integer> paren_or_bracket_openedStack
pendingTokensback to summary
private Deque<Token> pendingTokens
prevBraceExpressionback to summary
private String prevBraceExpression
previousPendingTokenTypeback to summary
private int previousPendingTokenType
wasIndentationMixedWithSpacesAndTabsback to summary
private boolean wasIndentationMixedWithSpacesAndTabs
wasSpaceIndentationback to summary
private boolean wasSpaceIndentation
wasTabIndentationback to summary
private boolean wasTabIndentation

Constructor Detail

PythonLexerBaseback to summary
protected PythonLexerBase(CharStream input)

Method Detail

addPendingTokenback to summary
private void addPendingToken(final Token tkn)
appendToBraceExpressionback to summary
private void appendToBraceExpression(String text)
checkCurTokenback to summary
private void checkCurToken()
checkNextTokenback to summary
private void checkNextToken()
createAndAddPendingTokenback to summary
private void createAndAddPendingToken(final int ttype, final int channel, final String text, final Token sampleToken)
createNewCurTokenback to summary
private void createNewCurToken(final int type, final String text, final int channel)
decrementBraceStackback to summary
private void decrementBraceStack()
getEncodingNameback to summary
private String getEncodingName(final String commentText)
getIndentationLengthback to summary
private int getIndentationLength(final String indentText)
getLastTwoCharsOfTheCurTokenTextback to summary
private String getLastTwoCharsOfTheCurTokenText()
handleCOLONEQUALtokenInFStringback to summary
private void handleCOLONEQUALtokenInFString()
handleEOFtokenback to summary
private void handleEOFtoken()
handleFORMAT_SPECIFICATION_MODEback to summary
private void handleFORMAT_SPECIFICATION_MODE()
handleFSTRING_MIDDLEtokenWithDoubleBraceback to summary
private void handleFSTRING_MIDDLEtokenWithDoubleBrace()
handleFSTRING_MIDDLEtokenWithQuoteAndLBraceback to summary
private void handleFSTRING_MIDDLEtokenWithQuoteAndLBrace()
handleNEWLINEtokenback to summary
private void handleNEWLINEtoken()
handleStartOfInputback to summary
private void handleStartOfInput()
hideAndAddPendingTokenback to summary
private void hideAndAddPendingToken(final Token tkn)
incrementBraceStackback to summary
private void incrementBraceStack()
initback to summary
private void init()
insertENCODINGtokenback to summary
private void insertENCODINGtoken()
insertIndentOrDedentTokenback to summary
private void insertIndentOrDedentToken(final int indentLength)
insertLeadingIndentTokenback to summary
private void insertLeadingIndentToken()
insertTrailingTokensback to summary
private void insertTrailingTokens()
nextTokenback to summary
public Token nextToken()

Overrides org.antlr.v4.runtime.Lexer.nextToken.

Implements org.antlr.v4.runtime.TokenSource.nextToken.

Doc from org.antlr.v4.runtime.Lexer.nextToken.

Return a token from this source; i.e., match a token on the char stream.

Annotations
@Override
popByBRACEback to summary
private void popByBRACE()
popLexerModeback to summary
private void popLexerMode()
pushLexerModeback to summary
private void pushLexerMode(final int mode)
reportErrorback to summary
private void reportError(final String errMsg)
reportLexerErrorback to summary
private void reportLexerError(final String errMsg)
resetback to summary
public void reset()

Overrides org.antlr.v4.runtime.Lexer.reset.

Annotations
@Override
setCurrentAndFollowingTokensback to summary
private void setCurrentAndFollowingTokens()
setLexerModeAfterRBRACEtokenback to summary
private void setLexerModeAfterRBRACEtoken()
setLexerModeByCOLONorCOLONEQUALtokenback to summary
private void setLexerModeByCOLONorCOLONEQUALtoken()
setLexerModeByFSTRING_STARTtokenback to summary
private void setLexerModeByFSTRING_STARTtoken()
trimLastCharAddPendingTokenSetCurTokenback to summary
private void trimLastCharAddPendingTokenSetCurToken(final int type, final String text, final int channel)