コード例 #1
0
    public StmtContext stmt()
    {
        StmtContext _localctx = new StmtContext(Context, State);

        EnterRule(_localctx, 2, RULE_stmt);
        try {
            State = 42;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 1, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 40; def_stmt();
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 41; link_stmt();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #2
0
    public PowContext pow()
    {
        PowContext _localctx = new PowContext(Context, State);

        EnterRule(_localctx, 8, RULE_pow);
        try {
            _localctx = new PowerContext(_localctx);
            EnterOuterAlt(_localctx, 1);
            {
                State = 58; unaryMinus();
                State = 61;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 6, Context))
                {
                case 1:
                {
                    State = 59; Match(POW);
                    State = 60; pow();
                }
                break;
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #3
0
    public ExpContext exp()
    {
        ExpContext _localctx = new ExpContext(Context, State);

        EnterRule(_localctx, 8, RULE_exp);
        int _la;

        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 27;
                ErrorHandler.Sync(this);
                _la = TokenStream.La(1);
                do
                {
                    {
                        State = 27;
                        switch (Interpreter.AdaptivePredict(TokenStream, 0, Context))
                        {
                        case 1:
                        {
                            State = 23; block();
                        }
                        break;

                        case 2:
                        {
                            State = 24; token();
                        }
                        break;

                        case 3:
                        {
                            State = 25; opdef();
                        }
                        break;

                        case 4:
                        {
                            State = 26; Match(NEWLINE);
                        }
                        break;
                        }
                    }
                    State = 29;
                    ErrorHandler.Sync(this);
                    _la = TokenStream.La(1);
                } while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__10) | (1L << T__11) | (1L << TRUE) | (1L << FALSE) | (1L << STRING) | (1L << INT) | (1L << FLOAT) | (1L << ID) | (1L << OP) | (1L << NATIVE) | (1L << OPEN_PAREN) | (1L << OPEN_BRACK) | (1L << NEWLINE))) != 0));
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #4
0
        public DialogContext dialog()
        {
            DialogContext _localctx = new DialogContext(_ctx, State);

            EnterRule(_localctx, 2, RULE_dialog);
            try {
                State = 24;
                _errHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(_input, 1, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 22; messageDialog();
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 23; selectionDialog();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #5
0
    public ImportDefinitionContext importDefinition()
    {
        ImportDefinitionContext _localctx = new ImportDefinitionContext(Context, State);

        EnterRule(_localctx, 6, RULE_importDefinition);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 40; Match(IMPORT);
                State = 42;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 3, Context))
                {
                case 1:
                {
                    State = 41; Match(NEWLINE);
                }
                break;
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #6
0
ファイル: CsvParser.cs プロジェクト: chwlili/FBSEditor
    public CsvEndColContext csvEndCol()
    {
        CsvEndColContext _localctx = new CsvEndColContext(Context, State);

        EnterRule(_localctx, 6, RULE_csvEndCol);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 30;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 3, Context))
                {
                case 1:
                {
                    State = 29; _localctx.content = csvTxt();
                }
                break;
                }
                State = 32; Match(ROWEND);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #7
0
    public OptionDefinitionContext optionDefinition()
    {
        OptionDefinitionContext _localctx = new OptionDefinitionContext(Context, State);

        EnterRule(_localctx, 8, RULE_optionDefinition);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 44; Match(OPTION);
                State = 46;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 4, Context))
                {
                case 1:
                {
                    State = 45; Match(NEWLINE);
                }
                break;
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #8
0
    public ErrorDefinitionContext errorDefinition()
    {
        ErrorDefinitionContext _localctx = new ErrorDefinitionContext(Context, State);

        EnterRule(_localctx, 10, RULE_errorDefinition);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 48; Match(INVALID_LINE);
                State = 50;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 5, Context))
                {
                case 1:
                {
                    State = 49; Match(NEWLINE);
                }
                break;
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #9
0
    public TemplateNameLineContext templateNameLine()
    {
        TemplateNameLineContext _localctx = new TemplateNameLineContext(Context, State);

        EnterRule(_localctx, 14, RULE_templateNameLine);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 55; Match(TEMPLATE_NAME_LINE);
                State = 57;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 6, Context))
                {
                case 1:
                {
                    State = 56; Match(NEWLINE);
                }
                break;
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #10
0
    public CommentDefinitionContext commentDefinition()
    {
        CommentDefinitionContext _localctx = new CommentDefinitionContext(Context, State);

        EnterRule(_localctx, 4, RULE_commentDefinition);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 36; Match(COMMENT);
                State = 38;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 2, Context))
                {
                case 1:
                {
                    State = 37; Match(NEWLINE);
                }
                break;
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #11
0
        public ItemContext item()
        {
            ItemContext _localctx = new ItemContext(_ctx, State);

            EnterRule(_localctx, 2, RULE_item);
            try {
                State = 17;
                switch (Interpreter.AdaptivePredict(_input, 1, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 15; range();
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 16; one();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #12
0
	public FeatureContext feature() {
		FeatureContext _localctx = new FeatureContext(Context, State);
		EnterRule(_localctx, 4, RULE_feature);
		try {
			State = 46;
			ErrorHandler.Sync(this);
			switch ( Interpreter.AdaptivePredict(TokenStream,3,Context) ) {
			case 1:
				_localctx = new F_attrContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 44; attr();
				}
				break;
			case 2:
				_localctx = new F_methodContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 45; method();
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}
コード例 #13
0
    public Square_valueContext square_value()
    {
        Square_valueContext _localctx = new Square_valueContext(Context, State);

        EnterRule(_localctx, 10, RULE_square_value);
        try {
            State = 53;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 4, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 51; square_value_without_spaces();
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 52; square_value_with_spaces();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #14
0
        public ExprContext expr()
        {
            ExprContext _localctx = new ExprContext(_ctx, State);

            EnterRule(_localctx, 6, RULE_expr);
            try {
                EnterOuterAlt(_localctx, 1);
                {
                    State = 65;
                    _errHandler.Sync(this);
                    switch (Interpreter.AdaptivePredict(_input, 1, _ctx))
                    {
                    case 1:
                    {
                        State = 46; checarEtiq();
                        State = 47; checarInstru();
                        State = 48; checarOp();
                        State = 49; Match(ENTER);
                    }
                    break;

                    case 2:
                    {
                        State = 51; checarEtiq();
                        State = 52; checarRsub();
                        State = 53; Match(ENTER);
                    }
                    break;

                    case 3:
                    {
                        State = 55; checarEtiq();
                        State = 56; checarDirec();
                        State = 57; checarOp();
                        State = 58; Match(ENTER);
                    }
                    break;

                    case 4:
                    {
                        State = 60; checarEtiq();
                        State = 61; checarByte();
                        State = 62; checarOpbyte();
                        State = 63; Match(ENTER);
                    }
                    break;
                    }
                    i++;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #15
0
    public PseudoSelectorContext pseudoSelector()
    {
        PseudoSelectorContext _localctx = new PseudoSelectorContext(Context, State);

        EnterRule(_localctx, 12, RULE_pseudoSelector);
        try {
            State = 100;
            switch (Interpreter.AdaptivePredict(TokenStream, 15, Context))
            {
            case 1:
                _localctx = new PseudoSelectorWithConstantContext(_localctx);
                EnterOuterAlt(_localctx, 1);
                {
                    State = 85; Match(COLON);
                    State = 86; Match(ID);
                    State = 91;
                    switch (Interpreter.AdaptivePredict(TokenStream, 13, Context))
                    {
                    case 1:
                    {
                        State = 87; Match(LEFT_BRACKET);
                        State = 88; constant();
                        State = 89; Match(RIGHT_BRACKET);
                    }
                    break;
                    }
                }
                break;

            case 2:
                _localctx = new PseudoSelectorWithIdentifierContext(_localctx);
                EnterOuterAlt(_localctx, 2);
                {
                    State = 93; Match(COLON);
                    State = 94; Match(ID);
                    State = 98;
                    switch (Interpreter.AdaptivePredict(TokenStream, 14, Context))
                    {
                    case 1:
                    {
                        State = 95; Match(LEFT_BRACKET);
                        State = 96; Match(ID);
                        State = 97; Match(RIGHT_BRACKET);
                    }
                    break;
                    }
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #16
0
ファイル: ProfaneParser.cs プロジェクト: stevehayles/Profane
    public ExprContext expr()
    {
        ExprContext _localctx = new ExprContext(Context, State);

        EnterRule(_localctx, 14, RULE_expr);
        try {
            State = 74;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 4, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 72; term();
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 73; opExpression();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #17
0
    public FactorContext factor()
    {
        FactorContext _localctx = new FactorContext(Context, State);

        EnterRule(_localctx, 6, RULE_factor);
        try {
            State = 46;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 5, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 44; Match(FACTOR);
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #18
0
ファイル: VBALikeParser.cs プロジェクト: vaginessa/Rubberduck
        public LikePatternCharlistElementContext likePatternCharlistElement()
        {
            LikePatternCharlistElementContext _localctx = new LikePatternCharlistElementContext(_ctx, State);

            EnterRule(_localctx, 10, RULE_likePatternCharlistElement);
            try {
                State = 54;
                switch (Interpreter.AdaptivePredict(_input, 6, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 52; likePatternCharlistChar();
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 53; likePatternCharlistRange();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #19
0
        public PropositionContext proposition()
        {
            PropositionContext _localctx = new PropositionContext(_ctx, State);

            EnterRule(_localctx, 10, RULE_proposition);
            try {
                State = 60;
                _errHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(_input, 5, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 58; instruction();
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 59; directive();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #20
0
        public ChecarOpContext checarOp()
        {
            ChecarOpContext _localctx = new ChecarOpContext(_ctx, State);

            EnterRule(_localctx, 14, RULE_checarOp);
            int _la;

            try {
                State = 87;
                _errHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(_input, 5, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 84;
                        _la   = _input.La(1);
                        if (_la <= 0 || (_la == OPERANDO))
                        {
                            _errHandler.RecoverInline(this);
                        }
                        else
                        {
                            if (_input.La(1) == TokenConstants.Eof)
                            {
                                matchedEOF = true;
                            }

                            _errHandler.ReportMatch(this);
                            Consume();
                        }
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 85; Match(OPERANDO);
                    }
                    break;

                case 3:
                    EnterOuterAlt(_localctx, 3);
                    {
                        State = 86; checarEtiq();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #21
0
    public CondContext cond()
    {
        CondContext _localctx = new CondContext(Context, State);

        EnterRule(_localctx, 10, RULE_cond);
        try {
            State = 56;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 2, Context))
            {
            case 1:
                _localctx = new CondNoElseContext(_localctx);
                EnterOuterAlt(_localctx, 1);
                {
                    State = 42;
                    Match(IF);
                    State = 43;
                    Match(LP);
                    State = 44;
                    expr();
                    State = 45;
                    Match(RP);
                    State = 46;
                    braceblock();
                }
                break;

            case 2:
                _localctx = new CondElseContext(_localctx);
                EnterOuterAlt(_localctx, 2);
                {
                    State = 48;
                    Match(IF);
                    State = 49;
                    Match(LP);
                    State = 50;
                    expr();
                    State = 51;
                    Match(RP);
                    State = 52;
                    braceblock();
                    State = 53;
                    Match(ELSE);
                    State = 54;
                    braceblock();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #22
0
        private PropositionsContext propositions(int _p)
        {
            ParserRuleContext _parentctx  = _ctx;
            int _parentState              = State;
            PropositionsContext _localctx = new PropositionsContext(_ctx, _parentState);
            PropositionsContext _prevctx  = _localctx;
            int _startState = 8;

            EnterRecursionRule(_localctx, 8, RULE_propositions, _p);
            try {
                int _alt;
                EnterOuterAlt(_localctx, 1);
                {
                    {
                        State = 49; proposition();
                    }
                    _ctx.stop = _input.Lt(-1);
                    State     = 55;
                    _errHandler.Sync(this);
                    _alt = Interpreter.AdaptivePredict(_input, 4, _ctx);
                    while (_alt != 2 && _alt != global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber)
                    {
                        if (_alt == 1)
                        {
                            if (_parseListeners != null)
                            {
                                TriggerExitRuleEvent();
                            }
                            _prevctx = _localctx;
                            {
                                {
                                    _localctx = new PropositionsContext(_parentctx, _parentState);
                                    PushNewRecursionContext(_localctx, _startState, RULE_propositions);
                                    State = 51;
                                    if (!(Precpred(_ctx, 2)))
                                    {
                                        throw new FailedPredicateException(this, "Precpred(_ctx, 2)");
                                    }
                                    State = 52; proposition();
                                }
                            }
                        }
                        State = 57;
                        _errHandler.Sync(this);
                        _alt = Interpreter.AdaptivePredict(_input, 4, _ctx);
                    }
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                UnrollRecursionContexts(_parentctx);
            }
            return(_localctx);
        }
コード例 #23
0
    public BodyContext body()
    {
        BodyContext _localctx = new BodyContext(Context, State);

        EnterRule(_localctx, 2, RULE_body);
        int _la;

        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 23;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 0, Context))
                {
                case 1:
                {
                    State = 21; query_seq();
                }
                break;

                case 2:
                {
                    State = 22; restrictions();
                }
                break;
                }
                State = 26;
                ErrorHandler.Sync(this);
                _la = TokenStream.LA(1);
                if (_la == T__0)
                {
                    {
                        State = 25; Match(T__0);
                    }
                }

                State = 30;
                ErrorHandler.Sync(this);
                _la = TokenStream.LA(1);
                if (_la == InWin)
                {
                    {
                        State = 28; Match(InWin);
                        State = 29; number();
                    }
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #24
0
    public StmtContext stmt()
    {
        StmtContext _localctx = new StmtContext(Context, State);

        EnterRule(_localctx, 4, RULE_stmt);
        try {
            State = 56;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 4, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 48; node_stmt();
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 49; edge_stmt();
                }
                break;

            case 3:
                EnterOuterAlt(_localctx, 3);
                {
                    State = 50; attr_stmt();
                }
                break;

            case 4:
                EnterOuterAlt(_localctx, 4);
                {
                    State = 51; id();
                    State = 52; Match(T__3);
                    State = 53; id();
                }
                break;

            case 5:
                EnterOuterAlt(_localctx, 5);
                {
                    State = 55; subgraph();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #25
0
        public ContentContext content()
        {
            ContentContext _localctx = new ContentContext(_ctx, State);

            EnterRule(_localctx, 2, RULE_content);
            int _la;

            try {
                int _alt;
                EnterOuterAlt(_localctx, 1);
                {
                    State = 17;
                    _la   = _input.La(1);
                    if (_la == SEA_WS || _la == TEXT)
                    {
                        {
                            State = 16; chardata();
                        }
                    }

                    State = 25;
                    _errHandler.Sync(this);
                    _alt = Interpreter.AdaptivePredict(_input, 2, _ctx);
                    while (_alt != 2 && _alt != -1)
                    {
                        if (_alt == 1)
                        {
                            {
                                {
                                    State = 19; element();
                                    State = 21;
                                    _la   = _input.La(1);
                                    if (_la == SEA_WS || _la == TEXT)
                                    {
                                        {
                                            State = 20; chardata();
                                        }
                                    }
                                }
                            }
                        }
                        State = 27;
                        _errHandler.Sync(this);
                        _alt = Interpreter.AdaptivePredict(_input, 2, _ctx);
                    }
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #26
0
    public FunctionContext function()
    {
        FunctionContext _localctx = new FunctionContext(Context, State);

        EnterRule(_localctx, 4, RULE_function);
        int _la;

        try {
            State = 70;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 4, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 56; Match(IDENTIFIER);
                    State = 57; Match(T__17);
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 58; Match(IDENTIFIER);
                    State = 59; Match(T__2);
                    State = 60; expr(0);
                    State = 65;
                    ErrorHandler.Sync(this);
                    _la = TokenStream.LA(1);
                    while (_la == T__16)
                    {
                        {
                            {
                                State = 61; Match(T__16);
                                State = 62; expr(0);
                            }
                        }
                        State = 67;
                        ErrorHandler.Sync(this);
                        _la = TokenStream.LA(1);
                    }
                    State = 68; Match(T__3);
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #27
0
ファイル: Combined1Parser.cs プロジェクト: ulukacher/TpDiuj
        public IndicadorContext indicador()
        {
            IndicadorContext _localctx = new IndicadorContext(_ctx, State);

            EnterRule(_localctx, 0, RULE_indicador);
            int _la;

            try {
                State = 15;
                _errHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(_input, 0, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 10; producto();
                        {
                            State = 11;
                            _la   = _input.La(1);
                            if (!(_la == T__0 || _la == T__1))
                            {
                                _errHandler.RecoverInline(this);
                            }
                            else
                            {
                                if (_input.La(1) == TokenConstants.Eof)
                                {
                                    matchedEOF = true;
                                }

                                _errHandler.ReportMatch(this);
                                Consume();
                            }
                            State = 12; indicador();
                        }
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 14; producto();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #28
0
ファイル: Combined1Parser.cs プロジェクト: ulukacher/TpDiuj
        public ProductoContext producto()
        {
            ProductoContext _localctx = new ProductoContext(_ctx, State);

            EnterRule(_localctx, 2, RULE_producto);
            int _la;

            try {
                State = 22;
                _errHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(_input, 1, _ctx))
                {
                case 1:
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 17; factor();
                        {
                            State = 18;
                            _la   = _input.La(1);
                            if (!(_la == T__2 || _la == T__3))
                            {
                                _errHandler.RecoverInline(this);
                            }
                            else
                            {
                                if (_input.La(1) == TokenConstants.Eof)
                                {
                                    matchedEOF = true;
                                }

                                _errHandler.ReportMatch(this);
                                Consume();
                            }
                            State = 19; producto();
                        }
                    }
                    break;

                case 2:
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 21; factor();
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
コード例 #29
0
    public SignedAtomContext signedAtom()
    {
        SignedAtomContext _localctx = new SignedAtomContext(Context, State);

        EnterRule(_localctx, 8, RULE_signedAtom);
        try {
            State = 51;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 3, Context))
            {
            case 1:
                _localctx = new PlusAtomContext(_localctx);
                EnterOuterAlt(_localctx, 1);
                {
                    State = 45; Match(PLUS);
                    State = 46; atom();
                }
                break;

            case 2:
                _localctx = new NegativeAtomContext(_localctx);
                EnterOuterAlt(_localctx, 2);
                {
                    State = 47; Match(MINUS);
                    State = 48; atom();
                }
                break;

            case 3:
                _localctx = new FunctionContext(_localctx);
                EnterOuterAlt(_localctx, 3);
                {
                    State = 49; func();
                }
                break;

            case 4:
                _localctx = new UnsignedAtomContext(_localctx);
                EnterOuterAlt(_localctx, 4);
                {
                    State = 50; atom();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #30
0
    public OBjEcTContext oBjEcT()
    {
        OBjEcTContext _localctx = new OBjEcTContext(Context, State);

        EnterRule(_localctx, 4, RULE_oBjEcT);
        int _la;

        try {
            State = 40;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 3, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 27; Match(T__3);
                    State = 28; pair();
                    State = 33;
                    ErrorHandler.Sync(this);
                    _la = TokenStream.LA(1);
                    while (_la == T__1)
                    {
                        {
                            {
                                State = 29; Match(T__1);
                                State = 30; pair();
                            }
                        }
                        State = 35;
                        ErrorHandler.Sync(this);
                        _la = TokenStream.LA(1);
                    }
                    State = 36; Match(T__4);
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 38; Match(T__3);
                    State = 39; Match(T__4);
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }