CandidParser class

Constructors

CandidParser(TokenStream input)

Properties

ATNWithBypassAlts → ATN
The ATN with bypass alternatives is expensive to create so we create it lazily.
no setterinherited
buildParseTree bool
Specifies whether or not the parser should construct a parse tree during the parsing process. The default value is true.
getter/setter pairinherited
bypassAltsAtnCache ↔ ATN?
This field maps from the serialized ATN string to the deserialized ATN with bypass alternatives.
getter/setter pairinherited
context ↔ ParserRuleContext?
The ParserRuleContext object for the currently executing rule. This is always non-null during the parsing process.
getter/setter pairinherited
currentToken → Token
Match needs to return the current input symbol, which gets put into the label for the associated token ref; e.g., x=ID.
no setterinherited
dfaStrings List<String>
For debugging and other purposes.
no setterinherited
errorHandler ↔ ErrorStrategy
The error handling strategy for the parser. The default value is a new instance of DefaultErrorStrategy.
getter/setter pairinherited
errorListenerDispatch → ErrorListener
no setterinherited
errorListeners List<ErrorListener>
no setterinherited
expectedTokens → IntervalSet
Computes the set of input symbols which could follow the current parser state and context, as given by {@link #getState} and {@link #getContext}, respectively.
no setterinherited
expectedTokensWithinCurrentRule → IntervalSet
no setterinherited
grammarFileName String
For debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.
no setter
hashCode int
The hash code for this object.
no setterinherited
inputStream ↔ TokenStream
covariantgetter/setter pairinherited
interpreter ↔ ParserATNSimulator?
The ATN interpreter used by the recognizer for prediction.
getter/setter pairinherited
matchedEOF bool
Indicates parser has match()ed EOF token. See {@link #exitRule()}. */
getter/setter pairinherited
numberOfSyntaxErrors int
Gets the number of syntax errors reported during parsing. This value is incremented each time {@link #notifyErrorListeners} is called.
no setterinherited
parseInfo → ParseInfo?
If profiling during the parse/lex, this will return DecisionInfo records for each decision in recognizer in a ParseInfo object.
no setterinherited
parseListeners List<ParseTreeListener>?
no setterinherited
precedence int
Get the precedence level for the top-most precedence rule.
no setterinherited
ruleContext → ParserRuleContext
no setterinherited
ruleIndexMap Map<String, int>
Get a map from rule names to rule indexes.
no setterinherited
ruleInvocationStack List<String>
no setterinherited
ruleNames List<String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializedATN List<int>
If this recognizer was generated, it will have a serialized ATN representation of the grammar.
no setter
sourceName String
no setterinherited
state int
getter/setter pairinherited
tokenFactory ↔ TokenFactory<Token>
Tell our token source and error strategy about a new way to create tokens.
getter/setter pairinherited
tokenStream → TokenStream
no setterinherited
tokenTypeMap Map<String, int>
Get a map from token names to token types.
no setterinherited
trimParseTree bool
@return true if the {@link ParserRuleContext#children} list is trimmed using the default {@link Parser.TrimToSizeListener} during the parse process.
getter/setter pairinherited
vocabulary → Vocabulary
Get the vocabulary used by the recognizer.
no setter

Methods

action(RuleContext? _localctx, int ruleIndex, int actionIndex) → void
inherited
actor() ActorContext
actorType() ActorTypeContext
addContextToParseTree() → void
inherited
addErrorListener(ErrorListener listener) → void
inherited
addParseListener(ParseTreeListener listener) → void
Registers listener to receive events during the parsing process.
inherited
blobType() BlobTypeContext
boolType() BoolTypeContext
compileParseTreePattern(String pattern, int patternRuleIndex, [Lexer? lexer]) → ParseTreePattern
The preferred method of getting a tree pattern. For example, here's a sample use:
inherited
consume() → Token
Consume and return the {@linkplain #getCurrentToken current symbol}.
inherited
createErrorNode(ParserRuleContext parent, Token t) → ErrorNode
How to create an error node, given a token, associated with a parent. Typically, the error node to create is not a function of the parent.
inherited
createTerminalNode(ParserRuleContext parent, Token t) → TerminalNode
How to create a token leaf node associated with a parent. Typically, the terminal node to create is not a function of the parent.
inherited
dataType() DataTypeContext
def() DefContext
dumpDFA() → void
For debugging and other purposes. */
inherited
emptyType() EmptyTypeContext
enterOuterAlt(ParserRuleContext localctx, int altNum) → void
inherited
enterRecursionRule(ParserRuleContext localctx, int state, int ruleIndex, int precedence) → void
inherited
enterRule(ParserRuleContext localctx, int state, int ruleIndex) → void
Always called by generated parsers upon entry to a rule. Access field {@link #_ctx} get the current context.
inherited
exitRule() → void
inherited
exprType() ExprTypeContext
floatType() FloatTypeContext
funcAnn() FuncAnnContext
funcType() FuncTypeContext
getATN() → ATN
Get the ATN used by the recognizer for prediction.
getErrorHeader(RecognitionException<IntStream> e) String
What is the error header, normally line/character position information? */
inherited
getInvokingContext(int ruleIndex) → ParserRuleContext?
inherited
getRuleIndex(String ruleName) int
Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found. */
inherited
getRuleInvocationStack([RuleContext? p]) List<String>
Return List<String> of the rule names in your parser instance leading up to a call to the current rule. You could override if you want more details such as the file/line info of where in the ATN a rule is invoked.
inherited
getTokenType(String tokenName) int
inherited
id() IdContext
idType() IdTypeContext
imp() ImpContext
importPart() ImportPartContext
inContext(String context) bool
inherited
intType() IntTypeContext
isExpectedToken(int symbol) bool
Checks whether or not symbol can follow the current state in the ATN. The behavior of this method is equivalent to the following, but is implemented such that the complete context-sensitive follow set does not need to be explicitly constructed.
inherited
isMatchedEOF() bool
inherited
isTrace() bool
Gets whether a TraceListener is registered as a parse listener for the parser.
inherited
match(int ttype) → Token
Match current input symbol against ttype. If the symbol type matches, {@link ANTLRErrorStrategy#reportMatch} and {@link #consume} are called to complete the match process.
inherited
matchWildcard() → Token
Match current input symbol as a wildcard. If the symbol type matches (i.e. has a value greater than 0), {@link ANTLRErrorStrategy#reportMatch} and {@link #consume} are called to complete the match process.
inherited
methType() MethTypeContext
natType() NatTypeContext
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyErrorListeners(String msg, [Token? offendingToken, RecognitionException<IntStream>? e]) → void
inherited
null_() NullContext
numberType() NumberTypeContext
optType() OptTypeContext
pairType() PairTypeContext
precpred(RuleContext? localctx, int precedence) bool
inherited
primType() PrimTypeContext
principalType() PrincipalTypeContext
prog() ProgContext
pushNewRecursionContext(ParserRuleContext localctx, int state, int? ruleIndex) → void
Like {@link #enterRule} but for recursive rules. Make the current context the child of the incoming localctx.
inherited
recordType() RecordTypeContext
refType() RefTypeContext
removeErrorListener(ErrorListener listener) → void
inherited
removeErrorListeners() → void
inherited
removeParseListener(ParseTreeListener? listener) → void
Remove listener from the list of parse listeners.
inherited
removeParseListeners() → void
Remove all parse listeners.
inherited
reservedType() ReservedTypeContext
reset([bool resetInput = true]) → void
reset the parser's state */
inherited
sempred(RuleContext? _localctx, int ruleIndex, int actionIndex) bool
inherited
setProfile(bool profile) → void
@since 4.3
inherited
setTokenStream(TokenStream input) → void
Set the token stream and reset the parser. */
inherited
setTrace(bool trace) → void
During a parse is sometimes useful to listen in on the rule entry and exit events as well as token matches. This is for quick and dirty debugging.
inherited
textType() TextTypeContext
toString() String
A string representation of this object.
inherited
triggerEnterRuleEvent() → void
Notify any parse listeners of an enter rule event.
inherited
triggerExitRuleEvent() → void
Notify any parse listeners of an exit rule event.
inherited
tupleType() TupleTypeContext
unrollRecursionContexts(ParserRuleContext? _parentctx) → void
inherited
variantType() VariantTypeContext
vecType() VecTypeContext

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

checkVersion → void Function()
final
VOCABULARY → Vocabulary
final

Constants

TOKEN_EOF → const int
TOKEN_IDENTIFIER → const int
TOKEN_IMPORT_LETTER → const int
TOKEN_MULTI_LINE_COMMENT → const int
TOKEN_SINGLE_LINE_COMMENT → const int
TOKEN_T__0 → const int
TOKEN_T__1 → const int
TOKEN_T__2 → const int
TOKEN_T__3 → const int
TOKEN_T__4 → const int
TOKEN_T__5 → const int
TOKEN_T__6 → const int
TOKEN_T__7 → const int
TOKEN_T__8 → const int
TOKEN_T__9 → const int
TOKEN_T__10 → const int
TOKEN_T__11 → const int
TOKEN_T__12 → const int
TOKEN_T__13 → const int
TOKEN_T__14 → const int
TOKEN_T__15 → const int
TOKEN_T__16 → const int
TOKEN_T__17 → const int
TOKEN_T__18 → const int
TOKEN_T__19 → const int
TOKEN_T__20 → const int
TOKEN_T__21 → const int
TOKEN_T__22 → const int
TOKEN_T__23 → const int
TOKEN_T__24 → const int
TOKEN_T__25 → const int
TOKEN_T__26 → const int
TOKEN_T__27 → const int
TOKEN_T__28 → const int
TOKEN_T__29 → const int
TOKEN_T__30 → const int
TOKEN_T__31 → const int
TOKEN_T__32 → const int
TOKEN_T__33 → const int
TOKEN_T__34 → const int
TOKEN_T__35 → const int
TOKEN_T__36 → const int
TOKEN_T__37 → const int
TOKEN_T__38 → const int
TOKEN_T__39 → const int
TOKEN_WHITESPACE → const int