C# Class Antlr4.Runtime.Atn.LL1Analyzer

Mostra file Open project: antlr/antlr4 Class Usage Examples

Public Methods

Method Description
LL1Analyzer ( ATN atn ) : System.Collections.Generic

Protected Methods

Method Description
Look ( ATNState s, ATNState stopState, PredictionContext ctx, IntervalSet look, HashSet lookBusy, BitSet calledRuleStack, bool seeThruPreds, bool addEOF ) : void

Compute set of tokens that can follow s in the ATN in the specified ctx .

If ctx is PredictionContext.EmptyLocal and stopState or the end of the rule containing s is reached, TokenConstants.EPSILON is added to the result set. If ctx is not PredictionContext.EmptyLocal and addEOF is and stopState or the end of the outermost rule is reached, TokenConstants.EOF is added to the result set.

Private Methods

Method Description
GetDecisionLookahead ( ATNState s ) : Antlr4.Runtime.Misc.IntervalSet[]
Look ( ATNState s, ATNState stopState, RuleContext ctx ) : IntervalSet
Look ( ATNState s, RuleContext ctx ) : IntervalSet

Method Details

LL1Analyzer() public method

public LL1Analyzer ( ATN atn ) : System.Collections.Generic
atn ATN
return System.Collections.Generic

Look() protected method

Compute set of tokens that can follow s in the ATN in the specified ctx .

If ctx is PredictionContext.EmptyLocal and stopState or the end of the rule containing s is reached, TokenConstants.EPSILON is added to the result set. If ctx is not PredictionContext.EmptyLocal and addEOF is and stopState or the end of the outermost rule is reached, TokenConstants.EOF is added to the result set.

protected Look ( ATNState s, ATNState stopState, PredictionContext ctx, IntervalSet look, HashSet lookBusy, BitSet calledRuleStack, bool seeThruPreds, bool addEOF ) : void
s ATNState the ATN state.
stopState ATNState /// the ATN state to stop at. This can be a /// /// to detect epsilon paths through a closure. ///
ctx PredictionContext /// The outer context, or /// /// if /// the outer context should not be used. ///
look Antlr4.Runtime.Misc.IntervalSet The result lookahead set.
lookBusy HashSet /// A set used for preventing epsilon closures in the ATN /// from causing a stack overflow. Outside code should pass /// new HashSet<ATNConfig> /// for this argument. ///
calledRuleStack Sharpen.BitSet /// A set used for preventing left recursion in the /// ATN from causing a stack overflow. Outside code should pass /// new BitSet() /// for this argument. ///
seeThruPreds bool /// /// /// to true semantic predicates as /// implicitly /// /// and "see through them", otherwise /// /// to treat semantic predicates as opaque and add /// /// to the /// result if one is encountered. ///
addEOF bool /// Add /// /// to the result if the end of the /// outermost context is reached. This parameter has no effect if /// /// is /// /// . ///
return void