示例#1
0
 private IToken LT(ITokenStream stream, int k)
 {
 #if ANTLR_STANDARD
     return(stream.LT(k));
 #else
     return(stream.Lt(k));
 #endif
 }
示例#2
0
        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));
        }
示例#3
0
 /// <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();
     }
 }
示例#4
0
 public static IToken LT(this ITokenStream stream, int k)
 {
     return(stream.Lt(k));
 }
示例#5
0
 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));
 }