Example usage for org.antlr.v4.runtime.atn ATN INVALID_ALT_NUMBER

List of usage examples for org.antlr.v4.runtime.atn ATN INVALID_ALT_NUMBER

Introduction

In this page you can find the example usage for org.antlr.v4.runtime.atn ATN INVALID_ALT_NUMBER.

Prototype

int INVALID_ALT_NUMBER

To view the source code for org.antlr.v4.runtime.atn ATN INVALID_ALT_NUMBER.

Click Source Link

Usage

From source file:BrahmsParser.java

License:Open Source License

private ExpressionContext expression(int _p) throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState);
    ExpressionContext _prevctx = _localctx;
    int _startState = 148;
    enterRecursionRule(_localctx, 148, RULE_expression, _p);
    int _la;//  ww  w. ja va 2s .  c o  m
    try {
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                setState(868);
                term(0);
            }
            _ctx.stop = _input.LT(-1);
            setState(875);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 77, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        {
                            _localctx = new ExpressionContext(_parentctx, _parentState);
                            pushNewRecursionContext(_localctx, _startState, RULE_expression);
                            setState(870);
                            if (!(precpred(_ctx, 2)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 2)");
                            setState(871);
                            _la = _input.LA(1);
                            if (!(_la == T__59 || _la == T__60)) {
                                _errHandler.recoverInline(this);
                            } else {
                                consume();
                            }
                            setState(872);
                            expression(3);
                        }
                    }
                }
                setState(877);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 77, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}

From source file:BrahmsParser.java

License:Open Source License

private TermContext term(int _p) throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    TermContext _localctx = new TermContext(_ctx, _parentState);
    TermContext _prevctx = _localctx;/*from  ww w  .  j ava 2s  .co m*/
    int _startState = 150;
    enterRecursionRule(_localctx, 150, RULE_term, _p);
    int _la;
    try {
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                setState(879);
                factor(0);
            }
            _ctx.stop = _input.LT(-1);
            setState(886);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 78, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        {
                            _localctx = new TermContext(_parentctx, _parentState);
                            pushNewRecursionContext(_localctx, _startState, RULE_term);
                            setState(881);
                            if (!(precpred(_ctx, 2)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 2)");
                            setState(882);
                            _la = _input.LA(1);
                            if (!(((((_la - 5)) & ~0x3f) == 0
                                    && ((1L << (_la - 5)) & ((1L << (T__4 - 5)) | (1L << (T__61 - 5))
                                            | (1L << (T__62 - 5)) | (1L << (T__63 - 5)))) != 0))) {
                                _errHandler.recoverInline(this);
                            } else {
                                consume();
                            }
                            setState(883);
                            term(3);
                        }
                    }
                }
                setState(888);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 78, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}

From source file:BrahmsParser.java

License:Open Source License

private FactorContext factor(int _p) throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    FactorContext _localctx = new FactorContext(_ctx, _parentState);
    FactorContext _prevctx = _localctx;/*from  ww w.ja  v a  2  s .  c  o  m*/
    int _startState = 152;
    enterRecursionRule(_localctx, 152, RULE_factor, _p);
    try {
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                setState(890);
                primary();
            }
            _ctx.stop = _input.LT(-1);
            setState(897);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 79, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        {
                            _localctx = new FactorContext(_parentctx, _parentState);
                            pushNewRecursionContext(_localctx, _startState, RULE_factor);
                            setState(892);
                            if (!(precpred(_ctx, 1)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 1)");
                            setState(893);
                            match(T__64);
                            setState(894);
                            primary();
                        }
                    }
                }
                setState(899);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 79, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}

From source file:BrahmsParser.java

License:Open Source License

public final QualifiedNameContext qualifiedName() throws RecognitionException {
    QualifiedNameContext _localctx = new QualifiedNameContext(_ctx, getState());
    enterRule(_localctx, 208, RULE_qualifiedName);
    try {//ww w  .  j a  v  a 2 s . c o m
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            setState(1015);
            match(Identifier);
            setState(1020);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 89, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    {
                        {
                            setState(1016);
                            match(T__3);
                            setState(1017);
                            match(Identifier);
                        }
                    }
                }
                setState(1022);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 89, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        exitRule();
    }
    return _localctx;
}

From source file:br.unicamp.cst.representation.owrl.grammar.OwrlParser.java

License:Open Source License

public final PropertyContext property() throws RecognitionException {
    PropertyContext _localctx = new PropertyContext(_ctx, getState());
    enterRule(_localctx, 14, RULE_property);
    try {/*from w w  w. j  a  v  a2s.  com*/
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            setState(95);
            match(T__2);
            setState(96);
            match(ID);
            setState(97);
            match(T__3);
            setState(99);
            _errHandler.sync(this);
            _alt = 1;
            do {
                switch (_alt) {
                case 1: {
                    {
                        setState(98);
                        qualitydimension();
                    }
                }
                    break;
                default:
                    throw new NoViableAltException(this);
                }
                setState(101);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 8, _ctx);
            } while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER);
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        exitRule();
    }
    return _localctx;
}

From source file:com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser.java

License:Open Source License

private LogicalOrExpressionContext logicalOrExpression(int _p) throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    LogicalOrExpressionContext _localctx = new LogicalOrExpressionContext(_ctx, _parentState);
    LogicalOrExpressionContext _prevctx = _localctx;
    int _startState = 2;
    enterRecursionRule(_localctx, 2, RULE_logicalOrExpression, _p);
    try {//from   w ww. j a v a  2  s. c om
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                _localctx = new ToLogicalAndExpressionContext(_localctx);
                _ctx = _localctx;
                _prevctx = _localctx;

                setState(36);
                logicalAndExpression(0);
            }
            _ctx.stop = _input.LT(-1);
            setState(43);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 0, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        {
                            _localctx = new OrExpressionContext(
                                    new LogicalOrExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_logicalOrExpression);
                            setState(38);
                            if (!(precpred(_ctx, 2)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 2)");
                            setState(39);
                            match(OR);
                            setState(40);
                            logicalAndExpression(0);
                        }
                    }
                }
                setState(45);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 0, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}

From source file:com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser.java

License:Open Source License

private LogicalAndExpressionContext logicalAndExpression(int _p) throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    LogicalAndExpressionContext _localctx = new LogicalAndExpressionContext(_ctx, _parentState);
    LogicalAndExpressionContext _prevctx = _localctx;
    int _startState = 4;
    enterRecursionRule(_localctx, 4, RULE_logicalAndExpression, _p);
    try {/*from   w  ww .j a  v a2  s . co m*/
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                _localctx = new ToEqualityExpressionContext(_localctx);
                _ctx = _localctx;
                _prevctx = _localctx;

                setState(47);
                equalityExpression(0);
            }
            _ctx.stop = _input.LT(-1);
            setState(54);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 1, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        {
                            _localctx = new AndExpressionContext(
                                    new LogicalAndExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_logicalAndExpression);
                            setState(49);
                            if (!(precpred(_ctx, 2)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 2)");
                            setState(50);
                            match(AND);
                            setState(51);
                            equalityExpression(0);
                        }
                    }
                }
                setState(56);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 1, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}

From source file:com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser.java

License:Open Source License

private EqualityExpressionContext equalityExpression(int _p) throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    EqualityExpressionContext _localctx = new EqualityExpressionContext(_ctx, _parentState);
    EqualityExpressionContext _prevctx = _localctx;
    int _startState = 6;
    enterRecursionRule(_localctx, 6, RULE_equalityExpression, _p);
    try {//ww w  .jav a2s .  com
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                _localctx = new ToComparisonExpressionContext(_localctx);
                _ctx = _localctx;
                _prevctx = _localctx;

                setState(58);
                comparisonExpression(0);
            }
            _ctx.stop = _input.LT(-1);
            setState(68);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 3, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        setState(66);
                        switch (getInterpreter().adaptivePredict(_input, 2, _ctx)) {
                        case 1: {
                            _localctx = new EqualsExpressionContext(
                                    new EqualityExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_equalityExpression);
                            setState(60);
                            if (!(precpred(_ctx, 3)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 3)");
                            setState(61);
                            match(EQ);
                            setState(62);
                            comparisonExpression(0);
                        }
                            break;

                        case 2: {
                            _localctx = new NotEqualsExpressionContext(
                                    new EqualityExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_equalityExpression);
                            setState(63);
                            if (!(precpred(_ctx, 2)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 2)");
                            setState(64);
                            match(NEQ);
                            setState(65);
                            comparisonExpression(0);
                        }
                            break;
                        }
                    }
                }
                setState(70);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 3, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}

From source file:com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser.java

License:Open Source License

private ComparisonExpressionContext comparisonExpression(int _p) throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    ComparisonExpressionContext _localctx = new ComparisonExpressionContext(_ctx, _parentState);
    ComparisonExpressionContext _prevctx = _localctx;
    int _startState = 8;
    enterRecursionRule(_localctx, 8, RULE_comparisonExpression, _p);
    try {//from   w  w w  . j  a  v  a  2s.  c  o m
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                _localctx = new ToBooleanUnaryExpressionContext(_localctx);
                _ctx = _localctx;
                _prevctx = _localctx;

                setState(72);
                booleanUnaryExpression();
            }
            _ctx.stop = _input.LT(-1);
            setState(88);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 5, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        setState(86);
                        switch (getInterpreter().adaptivePredict(_input, 4, _ctx)) {
                        case 1: {
                            _localctx = new GreaterThanExpressionContext(
                                    new ComparisonExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_comparisonExpression);
                            setState(74);
                            if (!(precpred(_ctx, 5)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 5)");
                            setState(75);
                            match(GT);
                            setState(76);
                            additionOrSubtractionExpression(0);
                        }
                            break;

                        case 2: {
                            _localctx = new GreaterThanOrEqualsExpressionContext(
                                    new ComparisonExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_comparisonExpression);
                            setState(77);
                            if (!(precpred(_ctx, 4)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 4)");
                            setState(78);
                            match(GE);
                            setState(79);
                            additionOrSubtractionExpression(0);
                        }
                            break;

                        case 3: {
                            _localctx = new LessThanExpressionContext(
                                    new ComparisonExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_comparisonExpression);
                            setState(80);
                            if (!(precpred(_ctx, 3)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 3)");
                            setState(81);
                            match(LT);
                            setState(82);
                            additionOrSubtractionExpression(0);
                        }
                            break;

                        case 4: {
                            _localctx = new LessThanOrEqualsExpressionContext(
                                    new ComparisonExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState, RULE_comparisonExpression);
                            setState(83);
                            if (!(precpred(_ctx, 2)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 2)");
                            setState(84);
                            match(LE);
                            setState(85);
                            additionOrSubtractionExpression(0);
                        }
                            break;
                        }
                    }
                }
                setState(90);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 5, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}

From source file:com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser.java

License:Open Source License

private AdditionOrSubtractionExpressionContext additionOrSubtractionExpression(int _p)
        throws RecognitionException {
    ParserRuleContext _parentctx = _ctx;
    int _parentState = getState();
    AdditionOrSubtractionExpressionContext _localctx = new AdditionOrSubtractionExpressionContext(_ctx,
            _parentState);//from  w  w w. j a  v a 2  s .  c  o  m
    AdditionOrSubtractionExpressionContext _prevctx = _localctx;
    int _startState = 16;
    enterRecursionRule(_localctx, 16, RULE_additionOrSubtractionExpression, _p);
    try {
        int _alt;
        enterOuterAlt(_localctx, 1);
        {
            {
                _localctx = new ToMultOrDivContext(_localctx);
                _ctx = _localctx;
                _prevctx = _localctx;

                setState(109);
                multiplicationOrDivisionExpression(0);
            }
            _ctx.stop = _input.LT(-1);
            setState(119);
            _errHandler.sync(this);
            _alt = getInterpreter().adaptivePredict(_input, 10, _ctx);
            while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
                if (_alt == 1) {
                    if (_parseListeners != null)
                        triggerExitRuleEvent();
                    _prevctx = _localctx;
                    {
                        setState(117);
                        switch (getInterpreter().adaptivePredict(_input, 9, _ctx)) {
                        case 1: {
                            _localctx = new AdditionExpressionContext(
                                    new AdditionOrSubtractionExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState,
                                    RULE_additionOrSubtractionExpression);
                            setState(111);
                            if (!(precpred(_ctx, 3)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 3)");
                            setState(112);
                            match(PLUS);
                            setState(113);
                            multiplicationOrDivisionExpression(0);
                        }
                            break;

                        case 2: {
                            _localctx = new SubtractionExpressionContext(
                                    new AdditionOrSubtractionExpressionContext(_parentctx, _parentState));
                            pushNewRecursionContext(_localctx, _startState,
                                    RULE_additionOrSubtractionExpression);
                            setState(114);
                            if (!(precpred(_ctx, 2)))
                                throw new FailedPredicateException(this, "precpred(_ctx, 2)");
                            setState(115);
                            match(MINUS);
                            setState(116);
                            multiplicationOrDivisionExpression(0);
                        }
                            break;
                        }
                    }
                }
                setState(121);
                _errHandler.sync(this);
                _alt = getInterpreter().adaptivePredict(_input, 10, _ctx);
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        unrollRecursionContexts(_parentctx);
    }
    return _localctx;
}