public virtual void ReportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, SimulatorState conflictState) { foreach (IAntlrErrorListener <IToken> listener in Delegates) { if (!(listener is IParserErrorListener)) { continue; } IParserErrorListener parserErrorListener = (IParserErrorListener)listener; parserErrorListener.ReportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, conflictState); } }
public virtual void ReportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, SimulatorState acceptState) { foreach (IAntlrErrorListener <IToken> listener in Delegates) { if (!(listener is IParserErrorListener)) { continue; } IParserErrorListener parserErrorListener = (IParserErrorListener)listener; parserErrorListener.ReportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, acceptState); } }
public virtual void ReportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, bool exact, BitSet ambigAlts, ATNConfigSet configs) { foreach (IAntlrErrorListener <IToken> listener in Delegates) { if (!(listener is IParserErrorListener)) { continue; } IParserErrorListener parserErrorListener = (IParserErrorListener)listener; parserErrorListener.ReportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs); } }
protected override IParseTree Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener) { //Cannot use a switch because PredictionMode.Ll is not a constant. if (predictionMode == PredictionMode.Ll) { return(_llFunction()); } if (predictionMode == PredictionMode.Sll) { return(_sllFunction()); } throw new System.ComponentModel.InvalidEnumArgumentException(); }
protected override IParseTree Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener) { var parser = new VBAParser(tokenStream); parser.Interpreter.PredictionMode = predictionMode; parser.AddErrorListener(errorListener); return(parser.startRule()); }
protected abstract IParseTree Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener);
protected override IParseTree Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener) { var parser = new VBAConditionalCompilationParser(tokenStream); parser.Interpreter.PredictionMode = predictionMode; parser.AddErrorListener(errorListener); return(parser.compilationUnit()); }