private IToken LT(ITokenStream stream, int k) { #if ANTLR_STANDARD return(stream.LT(k)); #else return(stream.Lt(k)); #endif }
protected override DFAState CreateDFAState(DFA dfa, ATNConfigSet configs) { int t = _input.La(1); if (t == AntlrV4.CaretToken.CaretTokenType && !_computingStartState) { _caretToken = (ICaretToken)_input.Lt(1); throw NoViableAlt(_input, _outerContext, configs, _startIndex); } return(base.CreateDFAState(dfa, configs)); }
/// <summary>Always called by generated parsers upon entry to a rule.</summary> /// <remarks> /// Always called by generated parsers upon entry to a rule. Access field /// <see cref="_ctx"/> /// get the current context. /// </remarks> public virtual void EnterRule([NotNull] ParserRuleContext localctx, int state, int ruleIndex) { State = state; _ctx = localctx; _ctx.start = _input.Lt(1); if (_buildParseTrees) { AddContextToParseTree(); } if (_parseListeners != null) { TriggerEnterRuleEvent(); } }
public static IToken LT(this ITokenStream stream, int k) { return(stream.Lt(k)); }
private IToken LT(ITokenStream stream, int k) { return(stream.Lt(k)); }
/// <summary> /// Whether the previous token value equals to str /// </summary> protected bool prev(string str) { return(_input.Lt(-1).Text.Equals(str)); }