C# Class Antlr4.Runtime.ParserInterpreter

A parser simulator that mimics what ANTLR's generated parser code does.
A parser simulator that mimics what ANTLR's generated parser code does. A ParserATNSimulator is used to make predictions via adaptivePredict but this class moves a pointer through the ATN to simulate parsing. ParserATNSimulator just makes us efficient rather than having to backtrack, for example. This properly creates parse trees even for left recursive rules. We rely on the left recursive rule invocation and special predicate transitions to make left recursive rules work. See TestParserInterpreter for examples.
Inheritance: Parser
Afficher le fichier Open project: antlr/antlr4 Class Usage Examples

Protected Properties

Свойство Type Description
pushRecursionContextStates Antlr4.Runtime.Sharpen.BitSet

Méthodes publiques

Méthode Description
EnterRecursionRule ( ParserRuleContext localctx, int state, int ruleIndex, int precedence ) : void
Parse ( int startRuleIndex ) : ParserRuleContext

Begin parsing at startRuleIndex

ParserInterpreter ( string grammarFileName, IVocabulary vocabulary, IEnumerable ruleNames, ATN atn, ITokenStream input ) : System

Méthodes protégées

Méthode Description
VisitRuleStopState ( ATNState p ) : void
VisitState ( ATNState p ) : void

Method Details

EnterRecursionRule() public méthode

public EnterRecursionRule ( ParserRuleContext localctx, int state, int ruleIndex, int precedence ) : void
localctx ParserRuleContext
state int
ruleIndex int
precedence int
Résultat void

Parse() public méthode

Begin parsing at startRuleIndex
public Parse ( int startRuleIndex ) : ParserRuleContext
startRuleIndex int
Résultat ParserRuleContext

ParserInterpreter() public méthode

public ParserInterpreter ( string grammarFileName, IVocabulary vocabulary, IEnumerable ruleNames, ATN atn, ITokenStream input ) : System
grammarFileName string
vocabulary IVocabulary
ruleNames IEnumerable
atn Antlr4.Runtime.Atn.ATN
input ITokenStream
Résultat System

VisitRuleStopState() protected méthode

protected VisitRuleStopState ( ATNState p ) : void
p Antlr4.Runtime.Atn.ATNState
Résultat void

VisitState() protected méthode

protected VisitState ( ATNState p ) : void
p Antlr4.Runtime.Atn.ATNState
Résultat void

Property Details

pushRecursionContextStates protected_oe property

protected BitSet,Antlr4.Runtime.Sharpen pushRecursionContextStates
Résultat Antlr4.Runtime.Sharpen.BitSet