Exemple #1
0
 private bool condicion_sempred(CondicionContext _localctx, int predIndex)
 {
     switch (predIndex)
     {
     case 0: return(Precpred(Context, 4));
     }
     return(true);
 }
Exemple #2
0
    private CondicionContext condicion(int _p)
    {
        ParserRuleContext _parentctx = Context;
        int _parentState             = State;
        CondicionContext _localctx   = new CondicionContext(Context, _parentState);
        CondicionContext _prevctx    = _localctx;
        int _startState = 2;

        EnterRecursionRule(_localctx, 2, RULE_condicion, _p);
        try {
            int _alt;
            EnterOuterAlt(_localctx, 1);
            {
                State = 23;
                ErrorHandler.Sync(this);
                switch (TokenStream.LA(1))
                {
                case T__4:
                {
                    State = 16; numericAttribute();
                    State = 17; comparisionNumeric();
                    State = 18; Match(INT);
                }
                break;

                case T__2:
                case T__3:
                {
                    State = 20; booleanAttribute();
                }
                break;

                case T__1:
                {
                    State = 21; Match(T__1);
                    State = 22; booleanAttribute();
                }
                break;

                default:
                    throw new NoViableAltException(this);
                }
                Context.Stop = TokenStream.LT(-1);
                State        = 31;
                ErrorHandler.Sync(this);
                _alt = Interpreter.AdaptivePredict(TokenStream, 1, Context);
                while (_alt != 2 && _alt != global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER)
                {
                    if (_alt == 1)
                    {
                        if (ParseListeners != null)
                        {
                            TriggerExitRuleEvent();
                        }
                        _prevctx = _localctx;
                        {
                            {
                                _localctx = new CondicionContext(_parentctx, _parentState);
                                PushNewRecursionContext(_localctx, _startState, RULE_condicion);
                                State = 25;
                                if (!(Precpred(Context, 4)))
                                {
                                    throw new FailedPredicateException(this, "Precpred(Context, 4)");
                                }
                                State = 26; connector();
                                State = 27; condicion(5);
                            }
                        }
                    }
                    State = 33;
                    ErrorHandler.Sync(this);
                    _alt = Interpreter.AdaptivePredict(TokenStream, 1, Context);
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            UnrollRecursionContexts(_parentctx);
        }
        return(_localctx);
    }