C# Class Antlr4.Runtime.Atn.ParserATNSimulator

Inheritance: ATNSimulator
Show file Open project: antlr/antlr4 Class Usage Examples

Public Properties

Property Type Description
debug bool
debug_list_atn_decisions bool
decisionToDFA Antlr4.Runtime.Dfa.DFA[]
dfa_debug bool
retry_debug bool

Protected Properties

Property Type Description
context ParserRuleContext
input ITokenStream
mergeCache MergeCache
parser Parser
startIndex int
thisDfa Antlr4.Runtime.Dfa.DFA

Public Methods

Method Description
AdaptivePredict ( ITokenStream input, int decision, ParserRuleContext outerContext ) : int
ClearDFA ( ) : void
DumpDeadEndConfigs ( NoViableAltException nvae ) : void
GetLookaheadName ( ITokenStream input ) : string
GetRuleName ( int index ) : string
GetTokenName ( int t ) : string
ParserATNSimulator ( ATN atn, DFA decisionToDFA, PredictionContextCache sharedContextCache ) : System
ParserATNSimulator ( Parser parser, ATN atn, DFA decisionToDFA, PredictionContextCache sharedContextCache ) : System
PrecedenceTransition ( ATNConfig config, PrecedencePredicateTransition pt, bool collectPredicates, bool inContext, bool fullCtx ) : ATNConfig
Reset ( ) : void
getParser ( ) : Parser

Protected Methods

Method Description
ActionTransition ( ATNConfig config, ActionTransition t ) : ATNConfig
AddDFAEdge ( DFA dfa, DFAState from, int t, DFAState to ) : DFAState
AddDFAState ( DFA dfa, DFAState D ) : DFAState
ApplyPrecedenceFilter ( ATNConfigSet configSet ) : ATNConfigSet
CanDropLoopEntryEdgeInLeftRecursiveRule ( ATNConfig config ) : bool
Closure ( ATNConfig config, ATNConfigSet configs, HashSet closureBusy, bool collectPredicates, bool fullCtx, bool treatEofAsEpsilon ) : void
ClosureCheckingStopState ( ATNConfig config, ATNConfigSet configSet, HashSet closureBusy, bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon ) : void
Closure_ ( ATNConfig config, ATNConfigSet configs, HashSet closureBusy, bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon ) : void
ComputeReachSet ( ATNConfigSet closure, int t, bool fullCtx ) : ATNConfigSet
ComputeStartState ( ATNState p, RuleContext ctx, bool fullCtx ) : ATNConfigSet
ComputeTargetState ( DFA dfa, DFAState previousD, int t ) : DFAState
EvalSemanticContext ( PredPrediction predPredictions, ParserRuleContext outerContext, bool complete ) : BitSet
EvalSemanticContext ( SemanticContext pred, ParserRuleContext parserCallStack, int alt, bool fullCtx ) : bool
ExecATN ( DFA dfa, DFAState s0, ITokenStream input, int startIndex, ParserRuleContext outerContext ) : int
ExecATNWithFullContext ( DFA dfa, DFAState D, ATNConfigSet s0, ITokenStream input, int startIndex, ParserRuleContext outerContext ) : int
GetConflictingAlts ( ATNConfigSet configSet ) : BitSet
GetConflictingAltsOrUniqueAlt ( ATNConfigSet configSet ) : BitSet
GetEpsilonTarget ( ATNConfig config, Transition t, bool collectPredicates, bool inContext, bool fullCtx, bool treatEofAsEpsilon ) : ATNConfig
GetExistingTargetState ( DFAState previousD, int t ) : DFAState
GetPredicatePredictions ( BitSet ambigAlts, SemanticContext altToPred ) : PredPrediction[]
GetPredsForAmbigAlts ( BitSet ambigAlts, ATNConfigSet configSet, int nalts ) : SemanticContext[]
GetReachableTarget ( Transition trans, int ttype ) : ATNState
GetSynValidOrSemInvalidAltThatFinishedDecisionEntryRule ( ATNConfigSet configs, ParserRuleContext outerContext ) : int
GetUniqueAlt ( ATNConfigSet configSet ) : int
NoViableAlt ( ITokenStream input, ParserRuleContext outerContext, ATNConfigSet configs, int startIndex ) : NoViableAltException
PredTransition ( ATNConfig config, PredicateTransition pt, bool collectPredicates, bool inContext, bool fullCtx ) : ATNConfig
PredicateDFAState ( DFAState dfaState, DecisionState decisionState ) : void
RemoveAllConfigsNotInRuleStopState ( ATNConfigSet configSet, bool lookToEndOfRule ) : ATNConfigSet
ReportAmbiguity ( DFA dfa, DFAState D, int startIndex, int stopIndex, bool exact, BitSet ambigAlts, ATNConfigSet configs ) : void
ReportAttemptingFullContext ( DFA dfa, BitSet conflictingAlts, ATNConfigSet configs, int startIndex, int stopIndex ) : void
ReportContextSensitivity ( DFA dfa, int prediction, ATNConfigSet configs, int startIndex, int stopIndex ) : void
RuleTransition ( ATNConfig config, RuleTransition t ) : ATNConfig
SplitAccordingToSemanticValidity ( ATNConfigSet configSet, ParserRuleContext outerContext ) : ATNConfigSet>.Pair
getAltThatFinishedDecisionEntryRule ( ATNConfigSet configSet ) : int

Method Details

ActionTransition() protected method

protected ActionTransition ( ATNConfig config, ActionTransition t ) : ATNConfig
config ATNConfig
t ActionTransition
return ATNConfig

AdaptivePredict() public method

public AdaptivePredict ( ITokenStream input, int decision, ParserRuleContext outerContext ) : int
input ITokenStream
decision int
outerContext ParserRuleContext
return int

AddDFAEdge() protected method

protected AddDFAEdge ( DFA dfa, DFAState from, int t, DFAState to ) : DFAState
dfa Antlr4.Runtime.Dfa.DFA
from Antlr4.Runtime.Dfa.DFAState
t int
to Antlr4.Runtime.Dfa.DFAState
return Antlr4.Runtime.Dfa.DFAState

AddDFAState() protected method

protected AddDFAState ( DFA dfa, DFAState D ) : DFAState
dfa Antlr4.Runtime.Dfa.DFA
D Antlr4.Runtime.Dfa.DFAState
return Antlr4.Runtime.Dfa.DFAState

ApplyPrecedenceFilter() protected method

protected ApplyPrecedenceFilter ( ATNConfigSet configSet ) : ATNConfigSet
configSet ATNConfigSet
return ATNConfigSet

CanDropLoopEntryEdgeInLeftRecursiveRule() protected method

protected CanDropLoopEntryEdgeInLeftRecursiveRule ( ATNConfig config ) : bool
config ATNConfig
return bool

ClearDFA() public method

public ClearDFA ( ) : void
return void

Closure() protected method

protected Closure ( ATNConfig config, ATNConfigSet configs, HashSet closureBusy, bool collectPredicates, bool fullCtx, bool treatEofAsEpsilon ) : void
config ATNConfig
configs ATNConfigSet
closureBusy HashSet
collectPredicates bool
fullCtx bool
treatEofAsEpsilon bool
return void

ClosureCheckingStopState() protected method

protected ClosureCheckingStopState ( ATNConfig config, ATNConfigSet configSet, HashSet closureBusy, bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon ) : void
config ATNConfig
configSet ATNConfigSet
closureBusy HashSet
collectPredicates bool
fullCtx bool
depth int
treatEofAsEpsilon bool
return void

Closure_() protected method

protected Closure_ ( ATNConfig config, ATNConfigSet configs, HashSet closureBusy, bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon ) : void
config ATNConfig
configs ATNConfigSet
closureBusy HashSet
collectPredicates bool
fullCtx bool
depth int
treatEofAsEpsilon bool
return void

ComputeReachSet() protected method

protected ComputeReachSet ( ATNConfigSet closure, int t, bool fullCtx ) : ATNConfigSet
closure ATNConfigSet
t int
fullCtx bool
return ATNConfigSet

ComputeStartState() protected method

protected ComputeStartState ( ATNState p, RuleContext ctx, bool fullCtx ) : ATNConfigSet
p ATNState
ctx RuleContext
fullCtx bool
return ATNConfigSet

ComputeTargetState() protected method

protected ComputeTargetState ( DFA dfa, DFAState previousD, int t ) : DFAState
dfa Antlr4.Runtime.Dfa.DFA
previousD Antlr4.Runtime.Dfa.DFAState
t int
return Antlr4.Runtime.Dfa.DFAState

DumpDeadEndConfigs() public method

public DumpDeadEndConfigs ( NoViableAltException nvae ) : void
nvae NoViableAltException
return void

EvalSemanticContext() protected method

protected EvalSemanticContext ( PredPrediction predPredictions, ParserRuleContext outerContext, bool complete ) : BitSet
predPredictions PredPrediction
outerContext ParserRuleContext
complete bool
return Antlr4.Runtime.Sharpen.BitSet

EvalSemanticContext() protected method

protected EvalSemanticContext ( SemanticContext pred, ParserRuleContext parserCallStack, int alt, bool fullCtx ) : bool
pred SemanticContext
parserCallStack ParserRuleContext
alt int
fullCtx bool
return bool

ExecATN() protected method

protected ExecATN ( DFA dfa, DFAState s0, ITokenStream input, int startIndex, ParserRuleContext outerContext ) : int
dfa Antlr4.Runtime.Dfa.DFA
s0 Antlr4.Runtime.Dfa.DFAState
input ITokenStream
startIndex int
outerContext ParserRuleContext
return int

ExecATNWithFullContext() protected method

protected ExecATNWithFullContext ( DFA dfa, DFAState D, ATNConfigSet s0, ITokenStream input, int startIndex, ParserRuleContext outerContext ) : int
dfa Antlr4.Runtime.Dfa.DFA
D Antlr4.Runtime.Dfa.DFAState
s0 ATNConfigSet
input ITokenStream
startIndex int
outerContext ParserRuleContext
return int

GetConflictingAlts() protected method

protected GetConflictingAlts ( ATNConfigSet configSet ) : BitSet
configSet ATNConfigSet
return Antlr4.Runtime.Sharpen.BitSet

GetConflictingAltsOrUniqueAlt() protected method

protected GetConflictingAltsOrUniqueAlt ( ATNConfigSet configSet ) : BitSet
configSet ATNConfigSet
return Antlr4.Runtime.Sharpen.BitSet

GetEpsilonTarget() protected method

protected GetEpsilonTarget ( ATNConfig config, Transition t, bool collectPredicates, bool inContext, bool fullCtx, bool treatEofAsEpsilon ) : ATNConfig
config ATNConfig
t Transition
collectPredicates bool
inContext bool
fullCtx bool
treatEofAsEpsilon bool
return ATNConfig

GetExistingTargetState() protected method

protected GetExistingTargetState ( DFAState previousD, int t ) : DFAState
previousD Antlr4.Runtime.Dfa.DFAState
t int
return Antlr4.Runtime.Dfa.DFAState

GetLookaheadName() public method

public GetLookaheadName ( ITokenStream input ) : string
input ITokenStream
return string

GetPredicatePredictions() protected method

protected GetPredicatePredictions ( BitSet ambigAlts, SemanticContext altToPred ) : PredPrediction[]
ambigAlts Antlr4.Runtime.Sharpen.BitSet
altToPred SemanticContext
return PredPrediction[]

GetPredsForAmbigAlts() protected method

protected GetPredsForAmbigAlts ( BitSet ambigAlts, ATNConfigSet configSet, int nalts ) : SemanticContext[]
ambigAlts Antlr4.Runtime.Sharpen.BitSet
configSet ATNConfigSet
nalts int
return SemanticContext[]

GetReachableTarget() protected method

protected GetReachableTarget ( Transition trans, int ttype ) : ATNState
trans Transition
ttype int
return ATNState

GetRuleName() public method

public GetRuleName ( int index ) : string
index int
return string

GetSynValidOrSemInvalidAltThatFinishedDecisionEntryRule() protected method

protected GetSynValidOrSemInvalidAltThatFinishedDecisionEntryRule ( ATNConfigSet configs, ParserRuleContext outerContext ) : int
configs ATNConfigSet
outerContext ParserRuleContext
return int

GetTokenName() public method

public GetTokenName ( int t ) : string
t int
return string

GetUniqueAlt() protected static method

protected static GetUniqueAlt ( ATNConfigSet configSet ) : int
configSet ATNConfigSet
return int

NoViableAlt() protected method

protected NoViableAlt ( ITokenStream input, ParserRuleContext outerContext, ATNConfigSet configs, int startIndex ) : NoViableAltException
input ITokenStream
outerContext ParserRuleContext
configs ATNConfigSet
startIndex int
return NoViableAltException

ParserATNSimulator() public method

public ParserATNSimulator ( ATN atn, DFA decisionToDFA, PredictionContextCache sharedContextCache ) : System
atn ATN
decisionToDFA Antlr4.Runtime.Dfa.DFA
sharedContextCache PredictionContextCache
return System

ParserATNSimulator() public method

public ParserATNSimulator ( Parser parser, ATN atn, DFA decisionToDFA, PredictionContextCache sharedContextCache ) : System
parser Parser
atn ATN
decisionToDFA Antlr4.Runtime.Dfa.DFA
sharedContextCache PredictionContextCache
return System

PrecedenceTransition() public method

public PrecedenceTransition ( ATNConfig config, PrecedencePredicateTransition pt, bool collectPredicates, bool inContext, bool fullCtx ) : ATNConfig
config ATNConfig
pt PrecedencePredicateTransition
collectPredicates bool
inContext bool
fullCtx bool
return ATNConfig

PredTransition() protected method

protected PredTransition ( ATNConfig config, PredicateTransition pt, bool collectPredicates, bool inContext, bool fullCtx ) : ATNConfig
config ATNConfig
pt PredicateTransition
collectPredicates bool
inContext bool
fullCtx bool
return ATNConfig

PredicateDFAState() protected method

protected PredicateDFAState ( DFAState dfaState, DecisionState decisionState ) : void
dfaState Antlr4.Runtime.Dfa.DFAState
decisionState DecisionState
return void

RemoveAllConfigsNotInRuleStopState() protected method

protected RemoveAllConfigsNotInRuleStopState ( ATNConfigSet configSet, bool lookToEndOfRule ) : ATNConfigSet
configSet ATNConfigSet
lookToEndOfRule bool
return ATNConfigSet

ReportAmbiguity() protected method

protected ReportAmbiguity ( DFA dfa, DFAState D, int startIndex, int stopIndex, bool exact, BitSet ambigAlts, ATNConfigSet configs ) : void
dfa Antlr4.Runtime.Dfa.DFA
D Antlr4.Runtime.Dfa.DFAState
startIndex int
stopIndex int
exact bool
ambigAlts Antlr4.Runtime.Sharpen.BitSet
configs ATNConfigSet
return void

ReportAttemptingFullContext() protected method

protected ReportAttemptingFullContext ( DFA dfa, BitSet conflictingAlts, ATNConfigSet configs, int startIndex, int stopIndex ) : void
dfa Antlr4.Runtime.Dfa.DFA
conflictingAlts Antlr4.Runtime.Sharpen.BitSet
configs ATNConfigSet
startIndex int
stopIndex int
return void

ReportContextSensitivity() protected method

protected ReportContextSensitivity ( DFA dfa, int prediction, ATNConfigSet configs, int startIndex, int stopIndex ) : void
dfa Antlr4.Runtime.Dfa.DFA
prediction int
configs ATNConfigSet
startIndex int
stopIndex int
return void

Reset() public method

public Reset ( ) : void
return void

RuleTransition() protected method

protected RuleTransition ( ATNConfig config, RuleTransition t ) : ATNConfig
config ATNConfig
t RuleTransition
return ATNConfig

SplitAccordingToSemanticValidity() protected method

protected SplitAccordingToSemanticValidity ( ATNConfigSet configSet, ParserRuleContext outerContext ) : ATNConfigSet>.Pair
configSet ATNConfigSet
outerContext ParserRuleContext
return ATNConfigSet>.Pair

getAltThatFinishedDecisionEntryRule() protected method

protected getAltThatFinishedDecisionEntryRule ( ATNConfigSet configSet ) : int
configSet ATNConfigSet
return int

getParser() public method

public getParser ( ) : Parser
return Parser

Property Details

context protected property

protected ParserRuleContext context
return ParserRuleContext

debug public static property

public static bool debug
return bool

debug_list_atn_decisions public static property

public static bool debug_list_atn_decisions
return bool

decisionToDFA public property

public DFA[],Antlr4.Runtime.Dfa decisionToDFA
return Antlr4.Runtime.Dfa.DFA[]

dfa_debug public static property

public static bool dfa_debug
return bool

input protected property

protected ITokenStream input
return ITokenStream

mergeCache protected property

protected MergeCache,Antlr4.Runtime.Atn mergeCache
return MergeCache

parser protected property

protected Parser parser
return Parser

retry_debug public static property

public static bool retry_debug
return bool

startIndex protected property

protected int startIndex
return int

thisDfa protected property

protected DFA,Antlr4.Runtime.Dfa thisDfa
return Antlr4.Runtime.Dfa.DFA