Search in sources :

Example 6 with EarlyExitException

use of org.antlr.runtime.EarlyExitException in project binnavi by google.

the class MemoryExpressionLexer method mNUMBER.

// $ANTLR end "HEX_NUMBER"
// $ANTLR start "NUMBER"
public final void mNUMBER() throws RecognitionException {
    try {
        final int _type = NUMBER;
        final int _channel = DEFAULT_TOKEN_CHANNEL;
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:9:
        // ( ( DIGIT )+ )
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:11:
        // ( DIGIT )+
        {
            // C:\\Dokumente und
            // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:11:
            // ( DIGIT )+
            int cnt1 = 0;
            loop1: do {
                int alt1 = 2;
                final int LA1_0 = input.LA(1);
                if (((LA1_0 >= '0' && LA1_0 <= '9'))) {
                    alt1 = 1;
                }
                switch(alt1) {
                    case 1:
                        // C:\\Dokumente und
                        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:11:
                        // DIGIT
                        {
                            mDIGIT();
                        }
                        break;
                    default:
                        if (cnt1 >= 1) {
                            break loop1;
                        }
                        final EarlyExitException eee = new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : EarlyExitException(org.antlr.runtime.EarlyExitException)

Example 7 with EarlyExitException

use of org.antlr.runtime.EarlyExitException in project pentaho-kettle by pentaho.

the class FastSimpleGenericEdifactDirectXMLLexer method mTEXT_DATA.

// $ANTLR end "COMPLEX_ELEMENT_ITEM_SEPARATOR"
// $ANTLR start "TEXT_DATA"
public final void mTEXT_DATA() throws RecognitionException {
    int _type = TEXT_DATA;
    int _channel = DEFAULT_TOKEN_CHANNEL;
    // C:\\workspace-sts\\Kettle trunk -
    // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
    // FastSimpleGenericEdifactDirectXML.g:129:14:
    // ( (~ ( RELEASE_CHARACTER | SEGMENT_TERMINATOR | COMPLEX_ELEMENT_ITEM_SEPARATOR | ELEMENT_SEPARATOR ) | (
    // RELEASE_CHARACTER ELEMENT_SEPARATOR ) | ( RELEASE_CHARACTER RELEASE_CHARACTER ) | ( RELEASE_CHARACTER
    // COMPLEX_ELEMENT_ITEM_SEPARATOR ) | ( RELEASE_CHARACTER SEGMENT_TERMINATOR ) )+ )
    // C:\\workspace-sts\\Kettle trunk -
    // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
    // FastSimpleGenericEdifactDirectXML.g:129:16:
    // (~ ( RELEASE_CHARACTER | SEGMENT_TERMINATOR | COMPLEX_ELEMENT_ITEM_SEPARATOR | ELEMENT_SEPARATOR ) | (
    // RELEASE_CHARACTER ELEMENT_SEPARATOR ) | ( RELEASE_CHARACTER RELEASE_CHARACTER ) | ( RELEASE_CHARACTER
    // COMPLEX_ELEMENT_ITEM_SEPARATOR ) | ( RELEASE_CHARACTER SEGMENT_TERMINATOR ) )+
    // C:\\workspace-sts\\Kettle trunk -
    // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
    // FastSimpleGenericEdifactDirectXML.g:129:16:
    // (~ ( RELEASE_CHARACTER | SEGMENT_TERMINATOR | COMPLEX_ELEMENT_ITEM_SEPARATOR | ELEMENT_SEPARATOR ) | (
    // RELEASE_CHARACTER ELEMENT_SEPARATOR ) | ( RELEASE_CHARACTER RELEASE_CHARACTER ) | ( RELEASE_CHARACTER
    // COMPLEX_ELEMENT_ITEM_SEPARATOR ) | ( RELEASE_CHARACTER SEGMENT_TERMINATOR ) )+
    int cnt1 = 0;
    loop1: do {
        int alt1 = 6;
        int LA1_0 = input.LA(1);
        if (((LA1_0 >= '\u0000' && LA1_0 <= '&') || (LA1_0 >= '(' && LA1_0 <= '*') || (LA1_0 >= ',' && LA1_0 <= '9') || (LA1_0 >= ';' && LA1_0 <= '>') || (LA1_0 >= '@' && LA1_0 <= '\uFFFF'))) {
            alt1 = 1;
        } else if ((LA1_0 == '?')) {
            switch(input.LA(2)) {
                case '+':
                    alt1 = 2;
                    break;
                case '?':
                    alt1 = 3;
                    break;
                case ':':
                    alt1 = 4;
                    break;
                case '\'':
                    alt1 = 5;
                    break;
            }
        }
        switch(alt1) {
            case 1:
                if ((input.LA(1) >= '\u0000' && input.LA(1) <= '&') || (input.LA(1) >= '(' && input.LA(1) <= '*') || (input.LA(1) >= ',' && input.LA(1) <= '9') || (input.LA(1) >= ';' && input.LA(1) <= '>') || (input.LA(1) >= '@' && input.LA(1) <= '\uFFFF')) {
                    input.consume();
                } else {
                    MismatchedSetException mse = new MismatchedSetException(null, input);
                    recover(mse);
                    throw mse;
                }
                break;
            case 2:
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:106:
                // ( RELEASE_CHARACTER ELEMENT_SEPARATOR )
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:106:
                // ( RELEASE_CHARACTER ELEMENT_SEPARATOR )
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:107:
                // RELEASE_CHARACTER ELEMENT_SEPARATOR
                mRELEASE_CHARACTER();
                mELEMENT_SEPARATOR();
                break;
            case 3:
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:144:
                // ( RELEASE_CHARACTER RELEASE_CHARACTER )
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:144:
                // ( RELEASE_CHARACTER RELEASE_CHARACTER )
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:145:
                // RELEASE_CHARACTER RELEASE_CHARACTER
                mRELEASE_CHARACTER();
                mRELEASE_CHARACTER();
                break;
            case 4:
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:182:
                // ( RELEASE_CHARACTER COMPLEX_ELEMENT_ITEM_SEPARATOR )
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:182:
                // ( RELEASE_CHARACTER COMPLEX_ELEMENT_ITEM_SEPARATOR )
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:183:
                // RELEASE_CHARACTER COMPLEX_ELEMENT_ITEM_SEPARATOR
                mRELEASE_CHARACTER();
                mCOMPLEX_ELEMENT_ITEM_SEPARATOR();
                break;
            case 5:
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:129:233:
                // ( RELEASE_CHARACTER SEGMENT_TERMINATOR )
                mRELEASE_CHARACTER();
                mSEGMENT_TERMINATOR();
                break;
            default:
                if (cnt1 >= 1) {
                    break loop1;
                }
                EarlyExitException eee = new EarlyExitException(1, input);
                throw eee;
        }
        cnt1++;
    } while (true);
    state.type = _type;
    state.channel = _channel;
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) EarlyExitException(org.antlr.runtime.EarlyExitException)

Example 8 with EarlyExitException

use of org.antlr.runtime.EarlyExitException in project drools by kiegroup.

the class DSLMapParser method variable_reference_expr.

// $ANTLR start "variable_reference_expr"
// src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:247:1: variable_reference_expr : ( LITERAL | EQUALS )+ ;
public final DSLMapParser.variable_reference_expr_return variable_reference_expr() throws RecognitionException {
    DSLMapParser.variable_reference_expr_return retval = new DSLMapParser.variable_reference_expr_return();
    retval.start = input.LT(1);
    Object root_0 = null;
    Token set36 = null;
    Object set36_tree = null;
    try {
        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:248:5: ( ( LITERAL | EQUALS )+ )
        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:248:8: ( LITERAL | EQUALS )+
        {
            root_0 = (Object) adaptor.nil();
            // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:248:8: ( LITERAL | EQUALS )+
            int cnt17 = 0;
            loop17: while (true) {
                int alt17 = 2;
                int LA17_0 = input.LA(1);
                if ((LA17_0 == EQUALS || LA17_0 == LITERAL)) {
                    alt17 = 1;
                }
                switch(alt17) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:
                        {
                            set36 = input.LT(1);
                            if (input.LA(1) == EQUALS || input.LA(1) == LITERAL) {
                                input.consume();
                                if (state.backtracking == 0)
                                    adaptor.addChild(root_0, (Object) adaptor.create(set36));
                                state.errorRecovery = false;
                                state.failed = false;
                            } else {
                                if (state.backtracking > 0) {
                                    state.failed = true;
                                    return retval;
                                }
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                throw mse;
                            }
                        }
                        break;
                    default:
                        if (cnt17 >= 1)
                            break loop17;
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return retval;
                        }
                        EarlyExitException eee = new EarlyExitException(17, input);
                        throw eee;
                }
                cnt17++;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (Object) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
    // do for sure before leaving
    }
    return retval;
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) Token(org.antlr.runtime.Token) CommonToken(org.antlr.runtime.CommonToken) EarlyExitException(org.antlr.runtime.EarlyExitException) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 9 with EarlyExitException

use of org.antlr.runtime.EarlyExitException in project drools by kiegroup.

the class DSLMapParser method pattern.

// $ANTLR start "pattern"
// src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:219:1: pattern : ( literal | DOT | MISC | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+ ;
public final DSLMapParser.pattern_return pattern() throws RecognitionException {
    DSLMapParser.pattern_return retval = new DSLMapParser.pattern_return();
    retval.start = input.LT(1);
    Object root_0 = null;
    Token DOT28 = null;
    Token MISC29 = null;
    Token LEFT_CURLY30 = null;
    Token RIGHT_CURLY32 = null;
    Token LEFT_SQUARE33 = null;
    Token RIGHT_SQUARE35 = null;
    ParserRuleReturnScope literal27 = null;
    ParserRuleReturnScope literal31 = null;
    ParserRuleReturnScope pattern34 = null;
    Object DOT28_tree = null;
    Object MISC29_tree = null;
    Object LEFT_CURLY30_tree = null;
    Object RIGHT_CURLY32_tree = null;
    Object LEFT_SQUARE33_tree = null;
    Object RIGHT_SQUARE35_tree = null;
    try {
        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:220:9: ( ( literal | DOT | MISC | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+ )
        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:220:11: ( literal | DOT | MISC | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+
        {
            root_0 = (Object) adaptor.nil();
            // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:220:11: ( literal | DOT | MISC | LEFT_CURLY literal RIGHT_CURLY | LEFT_SQUARE pattern RIGHT_SQUARE )+
            int cnt16 = 0;
            loop16: while (true) {
                int alt16 = 6;
                switch(input.LA(1)) {
                    case RIGHT_SQUARE:
                        {
                            int LA16_2 = input.LA(2);
                            if ((synpred24_DSLMap())) {
                                alt16 = 1;
                            }
                        }
                        break;
                    case LEFT_SQUARE:
                        {
                            int LA16_3 = input.LA(2);
                            if ((synpred24_DSLMap())) {
                                alt16 = 1;
                            } else if ((synpred28_DSLMap())) {
                                alt16 = 5;
                            }
                        }
                        break;
                    case DOT:
                        {
                            alt16 = 2;
                        }
                        break;
                    case MISC:
                        {
                            alt16 = 3;
                        }
                        break;
                    case LEFT_CURLY:
                        {
                            alt16 = 4;
                        }
                        break;
                    case COLON:
                    case LITERAL:
                        {
                            alt16 = 1;
                        }
                        break;
                }
                switch(alt16) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:220:13: literal
                        {
                            pushFollow(FOLLOW_literal_in_pattern1290);
                            literal27 = literal();
                            state._fsp--;
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0)
                                adaptor.addChild(root_0, literal27.getTree());
                        }
                        break;
                    case 2:
                        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:221:13: DOT
                        {
                            DOT28 = (Token) match(input, DOT, FOLLOW_DOT_in_pattern1304);
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0) {
                                DOT28_tree = (Object) adaptor.create(DOT28);
                                adaptor.addChild(root_0, DOT28_tree);
                            }
                        }
                        break;
                    case 3:
                        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:222:13: MISC
                        {
                            MISC29 = (Token) match(input, MISC, FOLLOW_MISC_in_pattern1318);
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0) {
                                MISC29_tree = (Object) adaptor.create(MISC29);
                                adaptor.addChild(root_0, MISC29_tree);
                            }
                        }
                        break;
                    case 4:
                        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:223:13: LEFT_CURLY literal RIGHT_CURLY
                        {
                            LEFT_CURLY30 = (Token) match(input, LEFT_CURLY, FOLLOW_LEFT_CURLY_in_pattern1332);
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0) {
                                LEFT_CURLY30_tree = (Object) adaptor.create(LEFT_CURLY30);
                                adaptor.addChild(root_0, LEFT_CURLY30_tree);
                            }
                            pushFollow(FOLLOW_literal_in_pattern1334);
                            literal31 = literal();
                            state._fsp--;
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0)
                                adaptor.addChild(root_0, literal31.getTree());
                            RIGHT_CURLY32 = (Token) match(input, RIGHT_CURLY, FOLLOW_RIGHT_CURLY_in_pattern1336);
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0) {
                                RIGHT_CURLY32_tree = (Object) adaptor.create(RIGHT_CURLY32);
                                adaptor.addChild(root_0, RIGHT_CURLY32_tree);
                            }
                        }
                        break;
                    case 5:
                        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:224:13: LEFT_SQUARE pattern RIGHT_SQUARE
                        {
                            LEFT_SQUARE33 = (Token) match(input, LEFT_SQUARE, FOLLOW_LEFT_SQUARE_in_pattern1350);
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0) {
                                LEFT_SQUARE33_tree = (Object) adaptor.create(LEFT_SQUARE33);
                                adaptor.addChild(root_0, LEFT_SQUARE33_tree);
                            }
                            pushFollow(FOLLOW_pattern_in_pattern1352);
                            pattern34 = pattern();
                            state._fsp--;
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0)
                                adaptor.addChild(root_0, pattern34.getTree());
                            RIGHT_SQUARE35 = (Token) match(input, RIGHT_SQUARE, FOLLOW_RIGHT_SQUARE_in_pattern1354);
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0) {
                                RIGHT_SQUARE35_tree = (Object) adaptor.create(RIGHT_SQUARE35);
                                adaptor.addChild(root_0, RIGHT_SQUARE35_tree);
                            }
                        }
                        break;
                    default:
                        if (cnt16 >= 1)
                            break loop16;
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return retval;
                        }
                        EarlyExitException eee = new EarlyExitException(16, input);
                        throw eee;
                }
                cnt16++;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (Object) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
    // do for sure before leaving
    }
    return retval;
}
Also used : Token(org.antlr.runtime.Token) CommonToken(org.antlr.runtime.CommonToken) EarlyExitException(org.antlr.runtime.EarlyExitException) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) ParserRuleReturnScope(org.antlr.runtime.ParserRuleReturnScope) RecognitionException(org.antlr.runtime.RecognitionException)

Example 10 with EarlyExitException

use of org.antlr.runtime.EarlyExitException in project drools by kiegroup.

the class DSLMapParser method value_section.

// $ANTLR start "value_section"
// src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:167:1: value_section : ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) ;
public final DSLMapParser.value_section_return value_section() throws RecognitionException {
    DSLMapParser.value_section_return retval = new DSLMapParser.value_section_return();
    retval.start = input.LT(1);
    Object root_0 = null;
    ParserRuleReturnScope value_sentence18 = null;
    RewriteRuleSubtreeStream stream_value_sentence = new RewriteRuleSubtreeStream(adaptor, "rule value_sentence");
    try {
        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:5: ( ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) )
        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:7: ( value_sentence )+
        {
            // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:7: ( value_sentence )+
            int cnt11 = 0;
            loop11: while (true) {
                int alt11 = 2;
                int LA11_0 = input.LA(1);
                if (((LA11_0 >= COLON && LA11_0 <= DOT) || LA11_0 == EQUALS || (LA11_0 >= LEFT_CURLY && LA11_0 <= LITERAL) || LA11_0 == RIGHT_SQUARE)) {
                    alt11 = 1;
                }
                switch(alt11) {
                    case 1:
                        // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:7: value_sentence
                        {
                            pushFollow(FOLLOW_value_sentence_in_value_section664);
                            value_sentence18 = value_sentence();
                            state._fsp--;
                            if (state.failed)
                                return retval;
                            if (state.backtracking == 0)
                                stream_value_sentence.add(value_sentence18.getTree());
                        }
                        break;
                    default:
                        if (cnt11 >= 1)
                            break loop11;
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return retval;
                        }
                        EarlyExitException eee = new EarlyExitException(11, input);
                        throw eee;
                }
                cnt11++;
            }
            // wildcard labels:
            if (state.backtracking == 0) {
                retval.tree = root_0;
                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.getTree() : null);
                root_0 = (Object) adaptor.nil();
                // 169:5: -> ^( VT_ENTRY_VAL ( value_sentence )+ )
                {
                    // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:169:8: ^( VT_ENTRY_VAL ( value_sentence )+ )
                    {
                        Object root_1 = (Object) adaptor.nil();
                        root_1 = (Object) adaptor.becomeRoot((Object) adaptor.create(VT_ENTRY_VAL, "VT_ENTRY_VAL"), root_1);
                        if (!(stream_value_sentence.hasNext())) {
                            throw new RewriteEarlyExitException();
                        }
                        while (stream_value_sentence.hasNext()) {
                            adaptor.addChild(root_1, stream_value_sentence.nextTree());
                        }
                        stream_value_sentence.reset();
                        adaptor.addChild(root_0, root_1);
                    }
                }
                retval.tree = root_0;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (Object) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
    // do for sure before leaving
    }
    return retval;
}
Also used : RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) EarlyExitException(org.antlr.runtime.EarlyExitException) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) ParserRuleReturnScope(org.antlr.runtime.ParserRuleReturnScope) RecognitionException(org.antlr.runtime.RecognitionException)

Aggregations

EarlyExitException (org.antlr.runtime.EarlyExitException)25 RewriteEarlyExitException (org.antlr.runtime.tree.RewriteEarlyExitException)11 MismatchedSetException (org.antlr.runtime.MismatchedSetException)10 RecognitionException (org.antlr.runtime.RecognitionException)10 ParserRuleReturnScope (org.antlr.runtime.ParserRuleReturnScope)5 RewriteRuleSubtreeStream (org.antlr.runtime.tree.RewriteRuleSubtreeStream)5 Token (org.antlr.runtime.Token)4 CommonTree (org.antlr.runtime.tree.CommonTree)4 CommonToken (org.antlr.runtime.CommonToken)3 NoViableAltException (org.antlr.runtime.NoViableAltException)3 ArrayList (java.util.ArrayList)1 FailedPredicateException (org.antlr.runtime.FailedPredicateException)1 MismatchedNotSetException (org.antlr.runtime.MismatchedNotSetException)1 MismatchedTokenException (org.antlr.runtime.MismatchedTokenException)1 MismatchedTreeNodeException (org.antlr.runtime.MismatchedTreeNodeException)1 RewriteRuleTokenStream (org.antlr.runtime.tree.RewriteRuleTokenStream)1