Search in sources :

Example 11 with NoViableAltException

use of org.antlr.runtime.NoViableAltException in project freud by LMAX-Exchange.

the class CssParser method elem.

// $ANTLR start "elem"
// /home/langera/dev/freud/src/grammar/Css.g:81:1: elem : ( '*' -> ^( UNIVERSAL ) | '#' IDENT -> ^( ID IDENT ) | '.' IDENT -> ^( CLASS IDENT ) | IDENT -> ^( TAG IDENT ) );
public final CssParser.elem_return elem() throws RecognitionException {
    CssParser.elem_return retval = new CssParser.elem_return();
    retval.start = input.LT(1);
    CommonTree root_0 = null;
    Token char_literal34 = null;
    Token char_literal35 = null;
    Token IDENT36 = null;
    Token char_literal37 = null;
    Token IDENT38 = null;
    Token IDENT39 = null;
    CommonTree char_literal34_tree = null;
    CommonTree char_literal35_tree = null;
    CommonTree IDENT36_tree = null;
    CommonTree char_literal37_tree = null;
    CommonTree IDENT38_tree = null;
    CommonTree IDENT39_tree = null;
    RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
    RewriteRuleTokenStream stream_35 = new RewriteRuleTokenStream(adaptor, "token 35");
    RewriteRuleTokenStream stream_36 = new RewriteRuleTokenStream(adaptor, "token 36");
    RewriteRuleTokenStream stream_37 = new RewriteRuleTokenStream(adaptor, "token 37");
    try {
        // /home/langera/dev/freud/src/grammar/Css.g:82:2: ( '*' -> ^( UNIVERSAL ) | '#' IDENT -> ^( ID IDENT ) | '.' IDENT -> ^( CLASS IDENT ) | IDENT -> ^( TAG IDENT ) )
        int alt17 = 4;
        switch(input.LA(1)) {
            case 35:
                {
                    alt17 = 1;
                }
                break;
            case 36:
                {
                    alt17 = 2;
                }
                break;
            case 37:
                {
                    alt17 = 3;
                }
                break;
            case IDENT:
                {
                    alt17 = 4;
                }
                break;
            default:
                NoViableAltException nvae = new NoViableAltException("", 17, 0, input);
                throw nvae;
        }
        switch(alt17) {
            case 1:
                // /home/langera/dev/freud/src/grammar/Css.g:82:4: '*'
                {
                    char_literal34 = (Token) match(input, 35, FOLLOW_35_in_elem421);
                    stream_35.add(char_literal34);
                    // AST REWRITE
                    // elements:
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                    root_0 = (CommonTree) adaptor.nil();
                    // 82:8: -> ^( UNIVERSAL )
                    {
                        // /home/langera/dev/freud/src/grammar/Css.g:82:11: ^( UNIVERSAL )
                        {
                            CommonTree root_1 = (CommonTree) adaptor.nil();
                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(UNIVERSAL, "UNIVERSAL"), root_1);
                            adaptor.addChild(root_0, root_1);
                        }
                    }
                    retval.tree = root_0;
                }
                break;
            case 2:
                // /home/langera/dev/freud/src/grammar/Css.g:83:4: '#' IDENT
                {
                    char_literal35 = (Token) match(input, 36, FOLLOW_36_in_elem434);
                    stream_36.add(char_literal35);
                    IDENT36 = (Token) match(input, IDENT, FOLLOW_IDENT_in_elem436);
                    stream_IDENT.add(IDENT36);
                    // AST REWRITE
                    // elements: IDENT
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                    root_0 = (CommonTree) adaptor.nil();
                    // 83:14: -> ^( ID IDENT )
                    {
                        // /home/langera/dev/freud/src/grammar/Css.g:83:17: ^( ID IDENT )
                        {
                            CommonTree root_1 = (CommonTree) adaptor.nil();
                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(ID, "ID"), root_1);
                            adaptor.addChild(root_1, stream_IDENT.nextNode());
                            adaptor.addChild(root_0, root_1);
                        }
                    }
                    retval.tree = root_0;
                }
                break;
            case 3:
                // /home/langera/dev/freud/src/grammar/Css.g:84:4: '.' IDENT
                {
                    char_literal37 = (Token) match(input, 37, FOLLOW_37_in_elem451);
                    stream_37.add(char_literal37);
                    IDENT38 = (Token) match(input, IDENT, FOLLOW_IDENT_in_elem453);
                    stream_IDENT.add(IDENT38);
                    // AST REWRITE
                    // elements: IDENT
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                    root_0 = (CommonTree) adaptor.nil();
                    // 84:14: -> ^( CLASS IDENT )
                    {
                        // /home/langera/dev/freud/src/grammar/Css.g:84:17: ^( CLASS IDENT )
                        {
                            CommonTree root_1 = (CommonTree) adaptor.nil();
                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(CLASS, "CLASS"), root_1);
                            adaptor.addChild(root_1, stream_IDENT.nextNode());
                            adaptor.addChild(root_0, root_1);
                        }
                    }
                    retval.tree = root_0;
                }
                break;
            case 4:
                // /home/langera/dev/freud/src/grammar/Css.g:85:4: IDENT
                {
                    IDENT39 = (Token) match(input, IDENT, FOLLOW_IDENT_in_elem471);
                    stream_IDENT.add(IDENT39);
                    // AST REWRITE
                    // elements: IDENT
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                    root_0 = (CommonTree) adaptor.nil();
                    // 85:10: -> ^( TAG IDENT )
                    {
                        // /home/langera/dev/freud/src/grammar/Css.g:85:13: ^( TAG IDENT )
                        {
                            CommonTree root_1 = (CommonTree) adaptor.nil();
                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(TAG, "TAG"), root_1);
                            adaptor.addChild(root_1, stream_IDENT.nextNode());
                            adaptor.addChild(root_0, root_1);
                        }
                    }
                    retval.tree = root_0;
                }
                break;
        }
        retval.stop = input.LT(-1);
        retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
        adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
    }
    return retval;
}
Also used : RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) CommonTree(org.antlr.runtime.tree.CommonTree) NoViableAltException(org.antlr.runtime.NoViableAltException) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Example 12 with NoViableAltException

use of org.antlr.runtime.NoViableAltException in project freud by LMAX-Exchange.

the class JavaLexer method mESCAPE_SEQUENCE.

// $ANTLR end "STRING_LITERAL"
// $ANTLR start "ESCAPE_SEQUENCE"
public final void mESCAPE_SEQUENCE() throws RecognitionException {
    try {
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1208:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESCAPE | OCTAL_ESCAPE )
        int alt22 = 3;
        int LA22_0 = input.LA(1);
        if ((LA22_0 == '\\')) {
            switch(input.LA(2)) {
                case '\"':
                case '\'':
                case '\\':
                case 'b':
                case 'f':
                case 'n':
                case 'r':
                case 't':
                    {
                        alt22 = 1;
                    }
                    break;
                case 'u':
                    {
                        alt22 = 2;
                    }
                    break;
                case '0':
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                    {
                        alt22 = 3;
                    }
                    break;
                default:
                    NoViableAltException nvae = new NoViableAltException("", 22, 1, input);
                    throw nvae;
            }
        } else {
            NoViableAltException nvae = new NoViableAltException("", 22, 0, input);
            throw nvae;
        }
        switch(alt22) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1208:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
                {
                    match('\\');
                    if (input.LA(1) == '\"' || input.LA(1) == '\'' || input.LA(1) == '\\' || input.LA(1) == 'b' || input.LA(1) == 'f' || input.LA(1) == 'n' || input.LA(1) == 'r' || input.LA(1) == 't') {
                        input.consume();
                    } else {
                        MismatchedSetException mse = new MismatchedSetException(null, input);
                        recover(mse);
                        throw mse;
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1209:9: UNICODE_ESCAPE
                {
                    mUNICODE_ESCAPE();
                }
                break;
            case 3:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1210:9: OCTAL_ESCAPE
                {
                    mOCTAL_ESCAPE();
                }
                break;
        }
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) NoViableAltException(org.antlr.runtime.NoViableAltException)

Example 13 with NoViableAltException

use of org.antlr.runtime.NoViableAltException in project freud by LMAX-Exchange.

the class JavaLexer method mFLOATING_POINT_LITERAL.

// $ANTLR end "INTEGER_TYPE_SUFFIX"
// $ANTLR start "FLOATING_POINT_LITERAL"
public final void mFLOATING_POINT_LITERAL() throws RecognitionException {
    try {
        int _type = FLOATING_POINT_LITERAL;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1183:5: ( ( '0' .. '9' )+ ( DOT ( '0' .. '9' )* ( EXPONENT )? ( FLOAT_TYPE_SUFFIX )? | EXPONENT ( FLOAT_TYPE_SUFFIX )? | FLOAT_TYPE_SUFFIX ) | DOT ( '0' .. '9' )+ ( EXPONENT )? ( FLOAT_TYPE_SUFFIX )? )
        int alt17 = 2;
        int LA17_0 = input.LA(1);
        if (((LA17_0 >= '0' && LA17_0 <= '9'))) {
            alt17 = 1;
        } else if ((LA17_0 == '.')) {
            alt17 = 2;
        } else {
            NoViableAltException nvae = new NoViableAltException("", 17, 0, input);
            throw nvae;
        }
        switch(alt17) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1183:9: ( '0' .. '9' )+ ( DOT ( '0' .. '9' )* ( EXPONENT )? ( FLOAT_TYPE_SUFFIX )? | EXPONENT ( FLOAT_TYPE_SUFFIX )? | FLOAT_TYPE_SUFFIX )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1183:9: ( '0' .. '9' )+
                    int cnt8 = 0;
                    loop8: do {
                        int alt8 = 2;
                        int LA8_0 = input.LA(1);
                        if (((LA8_0 >= '0' && LA8_0 <= '9'))) {
                            alt8 = 1;
                        }
                        switch(alt8) {
                            case 1:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1183:10: '0' .. '9'
                                {
                                    matchRange('0', '9');
                                }
                                break;
                            default:
                                if (cnt8 >= 1) {
                                    break loop8;
                                }
                                EarlyExitException eee = new EarlyExitException(8, input);
                                throw eee;
                        }
                        cnt8++;
                    } while (true);
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1184:9: ( DOT ( '0' .. '9' )* ( EXPONENT )? ( FLOAT_TYPE_SUFFIX )? | EXPONENT ( FLOAT_TYPE_SUFFIX )? | FLOAT_TYPE_SUFFIX )
                    int alt13 = 3;
                    switch(input.LA(1)) {
                        case '.':
                            {
                                alt13 = 1;
                            }
                            break;
                        case 'E':
                        case 'e':
                            {
                                alt13 = 2;
                            }
                            break;
                        case 'D':
                        case 'F':
                        case 'd':
                        case 'f':
                            {
                                alt13 = 3;
                            }
                            break;
                        default:
                            NoViableAltException nvae = new NoViableAltException("", 13, 0, input);
                            throw nvae;
                    }
                    switch(alt13) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1185:13: DOT ( '0' .. '9' )* ( EXPONENT )? ( FLOAT_TYPE_SUFFIX )?
                            {
                                mDOT();
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1185:17: ( '0' .. '9' )*
                                loop9: do {
                                    int alt9 = 2;
                                    int LA9_0 = input.LA(1);
                                    if (((LA9_0 >= '0' && LA9_0 <= '9'))) {
                                        alt9 = 1;
                                    }
                                    switch(alt9) {
                                        case 1:
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1185:18: '0' .. '9'
                                            {
                                                matchRange('0', '9');
                                            }
                                            break;
                                        default:
                                            break loop9;
                                    }
                                } while (true);
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1185:29: ( EXPONENT )?
                                int alt10 = 2;
                                int LA10_0 = input.LA(1);
                                if ((LA10_0 == 'E' || LA10_0 == 'e')) {
                                    alt10 = 1;
                                }
                                switch(alt10) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1185:29: EXPONENT
                                        {
                                            mEXPONENT();
                                        }
                                        break;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1185:39: ( FLOAT_TYPE_SUFFIX )?
                                int alt11 = 2;
                                int LA11_0 = input.LA(1);
                                if ((LA11_0 == 'D' || LA11_0 == 'F' || LA11_0 == 'd' || LA11_0 == 'f')) {
                                    alt11 = 1;
                                }
                                switch(alt11) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1185:39: FLOAT_TYPE_SUFFIX
                                        {
                                            mFLOAT_TYPE_SUFFIX();
                                        }
                                        break;
                                }
                            }
                            break;
                        case 2:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1186:13: EXPONENT ( FLOAT_TYPE_SUFFIX )?
                            {
                                mEXPONENT();
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1186:22: ( FLOAT_TYPE_SUFFIX )?
                                int alt12 = 2;
                                int LA12_0 = input.LA(1);
                                if ((LA12_0 == 'D' || LA12_0 == 'F' || LA12_0 == 'd' || LA12_0 == 'f')) {
                                    alt12 = 1;
                                }
                                switch(alt12) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1186:22: FLOAT_TYPE_SUFFIX
                                        {
                                            mFLOAT_TYPE_SUFFIX();
                                        }
                                        break;
                                }
                            }
                            break;
                        case 3:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1187:13: FLOAT_TYPE_SUFFIX
                            {
                                mFLOAT_TYPE_SUFFIX();
                            }
                            break;
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1189:9: DOT ( '0' .. '9' )+ ( EXPONENT )? ( FLOAT_TYPE_SUFFIX )?
                {
                    mDOT();
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1189:13: ( '0' .. '9' )+
                    int cnt14 = 0;
                    loop14: do {
                        int alt14 = 2;
                        int LA14_0 = input.LA(1);
                        if (((LA14_0 >= '0' && LA14_0 <= '9'))) {
                            alt14 = 1;
                        }
                        switch(alt14) {
                            case 1:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1189:14: '0' .. '9'
                                {
                                    matchRange('0', '9');
                                }
                                break;
                            default:
                                if (cnt14 >= 1) {
                                    break loop14;
                                }
                                EarlyExitException eee = new EarlyExitException(14, input);
                                throw eee;
                        }
                        cnt14++;
                    } while (true);
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1189:25: ( EXPONENT )?
                    int alt15 = 2;
                    int LA15_0 = input.LA(1);
                    if ((LA15_0 == 'E' || LA15_0 == 'e')) {
                        alt15 = 1;
                    }
                    switch(alt15) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1189:25: EXPONENT
                            {
                                mEXPONENT();
                            }
                            break;
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1189:35: ( FLOAT_TYPE_SUFFIX )?
                    int alt16 = 2;
                    int LA16_0 = input.LA(1);
                    if ((LA16_0 == 'D' || LA16_0 == 'F' || LA16_0 == 'd' || LA16_0 == 'f')) {
                        alt16 = 1;
                    }
                    switch(alt16) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1189:35: FLOAT_TYPE_SUFFIX
                            {
                                mFLOAT_TYPE_SUFFIX();
                            }
                            break;
                    }
                }
                break;
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : NoViableAltException(org.antlr.runtime.NoViableAltException) EarlyExitException(org.antlr.runtime.EarlyExitException)

Example 14 with NoViableAltException

use of org.antlr.runtime.NoViableAltException in project freud by LMAX-Exchange.

the class JavaLexer method mOCTAL_ESCAPE.

// $ANTLR end "ESCAPE_SEQUENCE"
// $ANTLR start "OCTAL_ESCAPE"
public final void mOCTAL_ESCAPE() throws RecognitionException {
    try {
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
        int alt23 = 3;
        int LA23_0 = input.LA(1);
        if ((LA23_0 == '\\')) {
            int LA23_1 = input.LA(2);
            if (((LA23_1 >= '0' && LA23_1 <= '3'))) {
                int LA23_2 = input.LA(3);
                if (((LA23_2 >= '0' && LA23_2 <= '7'))) {
                    int LA23_4 = input.LA(4);
                    if (((LA23_4 >= '0' && LA23_4 <= '7'))) {
                        alt23 = 1;
                    } else {
                        alt23 = 2;
                    }
                } else {
                    alt23 = 3;
                }
            } else if (((LA23_1 >= '4' && LA23_1 <= '7'))) {
                int LA23_3 = input.LA(3);
                if (((LA23_3 >= '0' && LA23_3 <= '7'))) {
                    alt23 = 2;
                } else {
                    alt23 = 3;
                }
            } else {
                NoViableAltException nvae = new NoViableAltException("", 23, 1, input);
                throw nvae;
            }
        } else {
            NoViableAltException nvae = new NoViableAltException("", 23, 0, input);
            throw nvae;
        }
        switch(alt23) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
                {
                    match('\\');
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:14: ( '0' .. '3' )
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:15: '0' .. '3'
                    {
                        matchRange('0', '3');
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:25: ( '0' .. '7' )
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:26: '0' .. '7'
                    {
                        matchRange('0', '7');
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:36: ( '0' .. '7' )
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1215:37: '0' .. '7'
                    {
                        matchRange('0', '7');
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1216:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
                {
                    match('\\');
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1216:14: ( '0' .. '7' )
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1216:15: '0' .. '7'
                    {
                        matchRange('0', '7');
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1216:25: ( '0' .. '7' )
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1216:26: '0' .. '7'
                    {
                        matchRange('0', '7');
                    }
                }
                break;
            case 3:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1217:9: '\\\\' ( '0' .. '7' )
                {
                    match('\\');
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1217:14: ( '0' .. '7' )
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1217:15: '0' .. '7'
                    {
                        matchRange('0', '7');
                    }
                }
                break;
        }
    } finally {
    }
}
Also used : NoViableAltException(org.antlr.runtime.NoViableAltException)

Example 15 with NoViableAltException

use of org.antlr.runtime.NoViableAltException in project freud by LMAX-Exchange.

the class JavaParser method statement.

// $ANTLR start "statement"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:842:1: statement : ( block | ASSERT expr1= expression ( COLON expr2= expression SEMI -> ^( ASSERT $expr1 $expr2) | SEMI -> ^( ASSERT $expr1) ) | IF parenthesizedExpression ifStat= statement ( ELSE elseStat= statement -> ^( IF parenthesizedExpression $ifStat $elseStat) | -> ^( IF parenthesizedExpression $ifStat) ) | FOR LPAREN ( forInit SEMI forCondition SEMI forUpdater RPAREN statement -> ^( FOR forInit forCondition forUpdater statement ) | localModifierList type IDENT COLON expression RPAREN statement -> ^( FOR_EACH[$FOR, \"FOR_EACH\"] localModifierList type IDENT expression statement ) ) | WHILE parenthesizedExpression statement -> ^( WHILE parenthesizedExpression statement ) | DO statement WHILE parenthesizedExpression SEMI -> ^( DO statement parenthesizedExpression ) | TRY block ( catches ( finallyClause )? | finallyClause ) -> ^( TRY block ( catches )? ( finallyClause )? ) | SWITCH parenthesizedExpression LCURLY switchBlockLabels RCURLY -> ^( SWITCH parenthesizedExpression switchBlockLabels ) | SYNCHRONIZED parenthesizedExpression block -> ^( SYNCHRONIZED parenthesizedExpression block ) | RETURN ( expression )? SEMI -> ^( RETURN ( expression )? ) | THROW expression SEMI -> ^( THROW expression ) | BREAK ( IDENT )? SEMI -> ^( BREAK ( IDENT )? ) | CONTINUE ( IDENT )? SEMI -> ^( CONTINUE ( IDENT )? ) | IDENT COLON statement -> ^( LABELED_STATEMENT IDENT statement ) | expression SEMI | SEMI );
public final JavaParser.statement_return statement() throws RecognitionException {
    JavaParser.statement_return retval = new JavaParser.statement_return();
    retval.start = input.LT(1);
    int statement_StartIndex = input.index();
    CommonTree root_0 = null;
    Token ASSERT276 = null;
    Token COLON277 = null;
    Token SEMI278 = null;
    Token SEMI279 = null;
    Token IF280 = null;
    Token ELSE282 = null;
    Token FOR283 = null;
    Token LPAREN284 = null;
    Token SEMI286 = null;
    Token SEMI288 = null;
    Token RPAREN290 = null;
    Token IDENT294 = null;
    Token COLON295 = null;
    Token RPAREN297 = null;
    Token WHILE299 = null;
    Token DO302 = null;
    Token WHILE304 = null;
    Token SEMI306 = null;
    Token TRY307 = null;
    Token SWITCH312 = null;
    Token LCURLY314 = null;
    Token RCURLY316 = null;
    Token SYNCHRONIZED317 = null;
    Token RETURN320 = null;
    Token SEMI322 = null;
    Token THROW323 = null;
    Token SEMI325 = null;
    Token BREAK326 = null;
    Token IDENT327 = null;
    Token SEMI328 = null;
    Token CONTINUE329 = null;
    Token IDENT330 = null;
    Token SEMI331 = null;
    Token IDENT332 = null;
    Token COLON333 = null;
    Token SEMI336 = null;
    Token SEMI337 = null;
    JavaParser.expression_return expr1 = null;
    JavaParser.expression_return expr2 = null;
    JavaParser.statement_return ifStat = null;
    JavaParser.statement_return elseStat = null;
    JavaParser.block_return block275 = null;
    JavaParser.parenthesizedExpression_return parenthesizedExpression281 = null;
    JavaParser.forInit_return forInit285 = null;
    JavaParser.forCondition_return forCondition287 = null;
    JavaParser.forUpdater_return forUpdater289 = null;
    JavaParser.statement_return statement291 = null;
    JavaParser.localModifierList_return localModifierList292 = null;
    JavaParser.type_return type293 = null;
    JavaParser.expression_return expression296 = null;
    JavaParser.statement_return statement298 = null;
    JavaParser.parenthesizedExpression_return parenthesizedExpression300 = null;
    JavaParser.statement_return statement301 = null;
    JavaParser.statement_return statement303 = null;
    JavaParser.parenthesizedExpression_return parenthesizedExpression305 = null;
    JavaParser.block_return block308 = null;
    JavaParser.catches_return catches309 = null;
    JavaParser.finallyClause_return finallyClause310 = null;
    JavaParser.finallyClause_return finallyClause311 = null;
    JavaParser.parenthesizedExpression_return parenthesizedExpression313 = null;
    JavaParser.switchBlockLabels_return switchBlockLabels315 = null;
    JavaParser.parenthesizedExpression_return parenthesizedExpression318 = null;
    JavaParser.block_return block319 = null;
    JavaParser.expression_return expression321 = null;
    JavaParser.expression_return expression324 = null;
    JavaParser.statement_return statement334 = null;
    JavaParser.expression_return expression335 = null;
    CommonTree ASSERT276_tree = null;
    CommonTree COLON277_tree = null;
    CommonTree SEMI278_tree = null;
    CommonTree SEMI279_tree = null;
    CommonTree IF280_tree = null;
    CommonTree ELSE282_tree = null;
    CommonTree FOR283_tree = null;
    CommonTree LPAREN284_tree = null;
    CommonTree SEMI286_tree = null;
    CommonTree SEMI288_tree = null;
    CommonTree RPAREN290_tree = null;
    CommonTree IDENT294_tree = null;
    CommonTree COLON295_tree = null;
    CommonTree RPAREN297_tree = null;
    CommonTree WHILE299_tree = null;
    CommonTree DO302_tree = null;
    CommonTree WHILE304_tree = null;
    CommonTree SEMI306_tree = null;
    CommonTree TRY307_tree = null;
    CommonTree SWITCH312_tree = null;
    CommonTree LCURLY314_tree = null;
    CommonTree RCURLY316_tree = null;
    CommonTree SYNCHRONIZED317_tree = null;
    CommonTree RETURN320_tree = null;
    CommonTree SEMI322_tree = null;
    CommonTree THROW323_tree = null;
    CommonTree SEMI325_tree = null;
    CommonTree BREAK326_tree = null;
    CommonTree IDENT327_tree = null;
    CommonTree SEMI328_tree = null;
    CommonTree CONTINUE329_tree = null;
    CommonTree IDENT330_tree = null;
    CommonTree SEMI331_tree = null;
    CommonTree IDENT332_tree = null;
    CommonTree COLON333_tree = null;
    CommonTree SEMI336_tree = null;
    CommonTree SEMI337_tree = null;
    RewriteRuleTokenStream stream_COLON = new RewriteRuleTokenStream(adaptor, "token COLON");
    RewriteRuleTokenStream stream_RPAREN = new RewriteRuleTokenStream(adaptor, "token RPAREN");
    RewriteRuleTokenStream stream_SYNCHRONIZED = new RewriteRuleTokenStream(adaptor, "token SYNCHRONIZED");
    RewriteRuleTokenStream stream_WHILE = new RewriteRuleTokenStream(adaptor, "token WHILE");
    RewriteRuleTokenStream stream_CONTINUE = new RewriteRuleTokenStream(adaptor, "token CONTINUE");
    RewriteRuleTokenStream stream_SWITCH = new RewriteRuleTokenStream(adaptor, "token SWITCH");
    RewriteRuleTokenStream stream_RCURLY = new RewriteRuleTokenStream(adaptor, "token RCURLY");
    RewriteRuleTokenStream stream_ELSE = new RewriteRuleTokenStream(adaptor, "token ELSE");
    RewriteRuleTokenStream stream_RETURN = new RewriteRuleTokenStream(adaptor, "token RETURN");
    RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
    RewriteRuleTokenStream stream_FOR = new RewriteRuleTokenStream(adaptor, "token FOR");
    RewriteRuleTokenStream stream_DO = new RewriteRuleTokenStream(adaptor, "token DO");
    RewriteRuleTokenStream stream_LCURLY = new RewriteRuleTokenStream(adaptor, "token LCURLY");
    RewriteRuleTokenStream stream_SEMI = new RewriteRuleTokenStream(adaptor, "token SEMI");
    RewriteRuleTokenStream stream_ASSERT = new RewriteRuleTokenStream(adaptor, "token ASSERT");
    RewriteRuleTokenStream stream_BREAK = new RewriteRuleTokenStream(adaptor, "token BREAK");
    RewriteRuleTokenStream stream_THROW = new RewriteRuleTokenStream(adaptor, "token THROW");
    RewriteRuleTokenStream stream_TRY = new RewriteRuleTokenStream(adaptor, "token TRY");
    RewriteRuleTokenStream stream_LPAREN = new RewriteRuleTokenStream(adaptor, "token LPAREN");
    RewriteRuleTokenStream stream_IF = new RewriteRuleTokenStream(adaptor, "token IF");
    RewriteRuleSubtreeStream stream_statement = new RewriteRuleSubtreeStream(adaptor, "rule statement");
    RewriteRuleSubtreeStream stream_expression = new RewriteRuleSubtreeStream(adaptor, "rule expression");
    RewriteRuleSubtreeStream stream_finallyClause = new RewriteRuleSubtreeStream(adaptor, "rule finallyClause");
    RewriteRuleSubtreeStream stream_catches = new RewriteRuleSubtreeStream(adaptor, "rule catches");
    RewriteRuleSubtreeStream stream_forUpdater = new RewriteRuleSubtreeStream(adaptor, "rule forUpdater");
    RewriteRuleSubtreeStream stream_block = new RewriteRuleSubtreeStream(adaptor, "rule block");
    RewriteRuleSubtreeStream stream_forCondition = new RewriteRuleSubtreeStream(adaptor, "rule forCondition");
    RewriteRuleSubtreeStream stream_localModifierList = new RewriteRuleSubtreeStream(adaptor, "rule localModifierList");
    RewriteRuleSubtreeStream stream_forInit = new RewriteRuleSubtreeStream(adaptor, "rule forInit");
    RewriteRuleSubtreeStream stream_type = new RewriteRuleSubtreeStream(adaptor, "rule type");
    RewriteRuleSubtreeStream stream_switchBlockLabels = new RewriteRuleSubtreeStream(adaptor, "rule switchBlockLabels");
    RewriteRuleSubtreeStream stream_parenthesizedExpression = new RewriteRuleSubtreeStream(adaptor, "rule parenthesizedExpression");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 75)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:843:5: ( block | ASSERT expr1= expression ( COLON expr2= expression SEMI -> ^( ASSERT $expr1 $expr2) | SEMI -> ^( ASSERT $expr1) ) | IF parenthesizedExpression ifStat= statement ( ELSE elseStat= statement -> ^( IF parenthesizedExpression $ifStat $elseStat) | -> ^( IF parenthesizedExpression $ifStat) ) | FOR LPAREN ( forInit SEMI forCondition SEMI forUpdater RPAREN statement -> ^( FOR forInit forCondition forUpdater statement ) | localModifierList type IDENT COLON expression RPAREN statement -> ^( FOR_EACH[$FOR, \"FOR_EACH\"] localModifierList type IDENT expression statement ) ) | WHILE parenthesizedExpression statement -> ^( WHILE parenthesizedExpression statement ) | DO statement WHILE parenthesizedExpression SEMI -> ^( DO statement parenthesizedExpression ) | TRY block ( catches ( finallyClause )? | finallyClause ) -> ^( TRY block ( catches )? ( finallyClause )? ) | SWITCH parenthesizedExpression LCURLY switchBlockLabels RCURLY -> ^( SWITCH parenthesizedExpression switchBlockLabels ) | SYNCHRONIZED parenthesizedExpression block -> ^( SYNCHRONIZED parenthesizedExpression block ) | RETURN ( expression )? SEMI -> ^( RETURN ( expression )? ) | THROW expression SEMI -> ^( THROW expression ) | BREAK ( IDENT )? SEMI -> ^( BREAK ( IDENT )? ) | CONTINUE ( IDENT )? SEMI -> ^( CONTINUE ( IDENT )? ) | IDENT COLON statement -> ^( LABELED_STATEMENT IDENT statement ) | expression SEMI | SEMI )
        int alt98 = 16;
        alt98 = dfa98.predict(input);
        switch(alt98) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:843:9: block
                {
                    root_0 = (CommonTree) adaptor.nil();
                    pushFollow(FOLLOW_block_in_statement8543);
                    block275 = block();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        adaptor.addChild(root_0, block275.getTree());
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:844:9: ASSERT expr1= expression ( COLON expr2= expression SEMI -> ^( ASSERT $expr1 $expr2) | SEMI -> ^( ASSERT $expr1) )
                {
                    ASSERT276 = (Token) match(input, ASSERT, FOLLOW_ASSERT_in_statement8553);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_ASSERT.add(ASSERT276);
                    }
                    pushFollow(FOLLOW_expression_in_statement8557);
                    expr1 = expression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_expression.add(expr1.getTree());
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:845:9: ( COLON expr2= expression SEMI -> ^( ASSERT $expr1 $expr2) | SEMI -> ^( ASSERT $expr1) )
                    int alt90 = 2;
                    int LA90_0 = input.LA(1);
                    if ((LA90_0 == COLON)) {
                        alt90 = 1;
                    } else if ((LA90_0 == SEMI)) {
                        alt90 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return retval;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 90, 0, input);
                        throw nvae;
                    }
                    switch(alt90) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:845:13: COLON expr2= expression SEMI
                            {
                                COLON277 = (Token) match(input, COLON, FOLLOW_COLON_in_statement8571);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_COLON.add(COLON277);
                                }
                                pushFollow(FOLLOW_expression_in_statement8575);
                                expr2 = expression();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_expression.add(expr2.getTree());
                                }
                                SEMI278 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement8577);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_SEMI.add(SEMI278);
                                }
                                // wildcard labels:
                                if (state.backtracking == 0) {
                                    retval.tree = root_0;
                                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                                    RewriteRuleSubtreeStream stream_expr1 = new RewriteRuleSubtreeStream(adaptor, "rule expr1", expr1 != null ? expr1.tree : null);
                                    RewriteRuleSubtreeStream stream_expr2 = new RewriteRuleSubtreeStream(adaptor, "rule expr2", expr2 != null ? expr2.tree : null);
                                    root_0 = (CommonTree) adaptor.nil();
                                    // 845:77: -> ^( ASSERT $expr1 $expr2)
                                    {
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:845:81: ^( ASSERT $expr1 $expr2)
                                        {
                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                            root_1 = (CommonTree) adaptor.becomeRoot(stream_ASSERT.nextNode(), root_1);
                                            adaptor.addChild(root_1, stream_expr1.nextTree());
                                            adaptor.addChild(root_1, stream_expr2.nextTree());
                                            adaptor.addChild(root_0, root_1);
                                        }
                                    }
                                    retval.tree = root_0;
                                }
                            }
                            break;
                        case 2:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:846:13: SEMI
                            {
                                SEMI279 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement8640);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_SEMI.add(SEMI279);
                                }
                                // wildcard labels:
                                if (state.backtracking == 0) {
                                    retval.tree = root_0;
                                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                                    RewriteRuleSubtreeStream stream_expr1 = new RewriteRuleSubtreeStream(adaptor, "rule expr1", expr1 != null ? expr1.tree : null);
                                    root_0 = (CommonTree) adaptor.nil();
                                    // 846:77: -> ^( ASSERT $expr1)
                                    {
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:846:81: ^( ASSERT $expr1)
                                        {
                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                            root_1 = (CommonTree) adaptor.becomeRoot(stream_ASSERT.nextNode(), root_1);
                                            adaptor.addChild(root_1, stream_expr1.nextTree());
                                            adaptor.addChild(root_0, root_1);
                                        }
                                    }
                                    retval.tree = root_0;
                                }
                            }
                            break;
                    }
                }
                break;
            case 3:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:848:9: IF parenthesizedExpression ifStat= statement ( ELSE elseStat= statement -> ^( IF parenthesizedExpression $ifStat $elseStat) | -> ^( IF parenthesizedExpression $ifStat) )
                {
                    IF280 = (Token) match(input, IF, FOLLOW_IF_in_statement8729);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_IF.add(IF280);
                    }
                    pushFollow(FOLLOW_parenthesizedExpression_in_statement8731);
                    parenthesizedExpression281 = parenthesizedExpression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_parenthesizedExpression.add(parenthesizedExpression281.getTree());
                    }
                    pushFollow(FOLLOW_statement_in_statement8735);
                    ifStat = statement();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_statement.add(ifStat.getTree());
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:849:9: ( ELSE elseStat= statement -> ^( IF parenthesizedExpression $ifStat $elseStat) | -> ^( IF parenthesizedExpression $ifStat) )
                    int alt91 = 2;
                    int LA91_0 = input.LA(1);
                    if ((LA91_0 == ELSE)) {
                        int LA91_1 = input.LA(2);
                        if ((synpred122_Java())) {
                            alt91 = 1;
                        } else if ((true)) {
                            alt91 = 2;
                        } else {
                            if (state.backtracking > 0) {
                                state.failed = true;
                                return retval;
                            }
                            NoViableAltException nvae = new NoViableAltException("", 91, 1, input);
                            throw nvae;
                        }
                    } else if ((LA91_0 == EOF || LA91_0 == AT || LA91_0 == DEC || LA91_0 == INC || LA91_0 == LCURLY || LA91_0 == LESS_THAN || LA91_0 == LOGICAL_NOT || (LA91_0 >= LPAREN && LA91_0 <= MINUS) || LA91_0 == NOT || LA91_0 == PLUS || LA91_0 == RCURLY || LA91_0 == SEMI || (LA91_0 >= ABSTRACT && LA91_0 <= CASE) || (LA91_0 >= CHAR && LA91_0 <= DOUBLE) || LA91_0 == ENUM || (LA91_0 >= FALSE && LA91_0 <= FINAL) || (LA91_0 >= FLOAT && LA91_0 <= IF) || LA91_0 == INTERFACE || (LA91_0 >= INT && LA91_0 <= NULL) || (LA91_0 >= PRIVATE && LA91_0 <= THROW) || (LA91_0 >= TRANSIENT && LA91_0 <= WHILE) || (LA91_0 >= IDENT && LA91_0 <= STRING_LITERAL))) {
                        alt91 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return retval;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 91, 0, input);
                        throw nvae;
                    }
                    switch(alt91) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:849:13: ELSE elseStat= statement
                            {
                                ELSE282 = (Token) match(input, ELSE, FOLLOW_ELSE_in_statement8749);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_ELSE.add(ELSE282);
                                }
                                pushFollow(FOLLOW_statement_in_statement8753);
                                elseStat = statement();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_statement.add(elseStat.getTree());
                                }
                                // wildcard labels:
                                if (state.backtracking == 0) {
                                    retval.tree = root_0;
                                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                                    RewriteRuleSubtreeStream stream_ifStat = new RewriteRuleSubtreeStream(adaptor, "rule ifStat", ifStat != null ? ifStat.tree : null);
                                    RewriteRuleSubtreeStream stream_elseStat = new RewriteRuleSubtreeStream(adaptor, "rule elseStat", elseStat != null ? elseStat.tree : null);
                                    root_0 = (CommonTree) adaptor.nil();
                                    // 849:77: -> ^( IF parenthesizedExpression $ifStat $elseStat)
                                    {
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:849:81: ^( IF parenthesizedExpression $ifStat $elseStat)
                                        {
                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                            root_1 = (CommonTree) adaptor.becomeRoot(stream_IF.nextNode(), root_1);
                                            adaptor.addChild(root_1, stream_parenthesizedExpression.nextTree());
                                            adaptor.addChild(root_1, stream_ifStat.nextTree());
                                            adaptor.addChild(root_1, stream_elseStat.nextTree());
                                            adaptor.addChild(root_0, root_1);
                                        }
                                    }
                                    retval.tree = root_0;
                                }
                            }
                            break;
                        case 2:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:850:77:
                            {
                                // wildcard labels:
                                if (state.backtracking == 0) {
                                    retval.tree = root_0;
                                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                                    RewriteRuleSubtreeStream stream_ifStat = new RewriteRuleSubtreeStream(adaptor, "rule ifStat", ifStat != null ? ifStat.tree : null);
                                    root_0 = (CommonTree) adaptor.nil();
                                    // 850:77: -> ^( IF parenthesizedExpression $ifStat)
                                    {
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:850:81: ^( IF parenthesizedExpression $ifStat)
                                        {
                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                            root_1 = (CommonTree) adaptor.becomeRoot(stream_IF.nextNode(), root_1);
                                            adaptor.addChild(root_1, stream_parenthesizedExpression.nextTree());
                                            adaptor.addChild(root_1, stream_ifStat.nextTree());
                                            adaptor.addChild(root_0, root_1);
                                        }
                                    }
                                    retval.tree = root_0;
                                }
                            }
                            break;
                    }
                }
                break;
            case 4:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:852:9: FOR LPAREN ( forInit SEMI forCondition SEMI forUpdater RPAREN statement -> ^( FOR forInit forCondition forUpdater statement ) | localModifierList type IDENT COLON expression RPAREN statement -> ^( FOR_EACH[$FOR, \"FOR_EACH\"] localModifierList type IDENT expression statement ) )
                {
                    FOR283 = (Token) match(input, FOR, FOLLOW_FOR_in_statement8916);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_FOR.add(FOR283);
                    }
                    LPAREN284 = (Token) match(input, LPAREN, FOLLOW_LPAREN_in_statement8918);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_LPAREN.add(LPAREN284);
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:853:9: ( forInit SEMI forCondition SEMI forUpdater RPAREN statement -> ^( FOR forInit forCondition forUpdater statement ) | localModifierList type IDENT COLON expression RPAREN statement -> ^( FOR_EACH[$FOR, \"FOR_EACH\"] localModifierList type IDENT expression statement ) )
                    int alt92 = 2;
                    alt92 = dfa92.predict(input);
                    switch(alt92) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:853:13: forInit SEMI forCondition SEMI forUpdater RPAREN statement
                            {
                                pushFollow(FOLLOW_forInit_in_statement8932);
                                forInit285 = forInit();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_forInit.add(forInit285.getTree());
                                }
                                SEMI286 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement8934);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_SEMI.add(SEMI286);
                                }
                                pushFollow(FOLLOW_forCondition_in_statement8936);
                                forCondition287 = forCondition();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_forCondition.add(forCondition287.getTree());
                                }
                                SEMI288 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement8938);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_SEMI.add(SEMI288);
                                }
                                pushFollow(FOLLOW_forUpdater_in_statement8940);
                                forUpdater289 = forUpdater();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_forUpdater.add(forUpdater289.getTree());
                                }
                                RPAREN290 = (Token) match(input, RPAREN, FOLLOW_RPAREN_in_statement8942);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_RPAREN.add(RPAREN290);
                                }
                                pushFollow(FOLLOW_statement_in_statement8944);
                                statement291 = statement();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_statement.add(statement291.getTree());
                                }
                                // wildcard labels:
                                if (state.backtracking == 0) {
                                    retval.tree = root_0;
                                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                                    root_0 = (CommonTree) adaptor.nil();
                                    // 853:77: -> ^( FOR forInit forCondition forUpdater statement )
                                    {
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:853:81: ^( FOR forInit forCondition forUpdater statement )
                                        {
                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                            root_1 = (CommonTree) adaptor.becomeRoot(stream_FOR.nextNode(), root_1);
                                            adaptor.addChild(root_1, stream_forInit.nextTree());
                                            adaptor.addChild(root_1, stream_forCondition.nextTree());
                                            adaptor.addChild(root_1, stream_forUpdater.nextTree());
                                            adaptor.addChild(root_1, stream_statement.nextTree());
                                            adaptor.addChild(root_0, root_1);
                                        }
                                    }
                                    retval.tree = root_0;
                                }
                            }
                            break;
                        case 2:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:854:13: localModifierList type IDENT COLON expression RPAREN statement
                            {
                                pushFollow(FOLLOW_localModifierList_in_statement8978);
                                localModifierList292 = localModifierList();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_localModifierList.add(localModifierList292.getTree());
                                }
                                pushFollow(FOLLOW_type_in_statement8980);
                                type293 = type();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_type.add(type293.getTree());
                                }
                                IDENT294 = (Token) match(input, IDENT, FOLLOW_IDENT_in_statement8982);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_IDENT.add(IDENT294);
                                }
                                COLON295 = (Token) match(input, COLON, FOLLOW_COLON_in_statement8984);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_COLON.add(COLON295);
                                }
                                pushFollow(FOLLOW_expression_in_statement8986);
                                expression296 = expression();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_expression.add(expression296.getTree());
                                }
                                RPAREN297 = (Token) match(input, RPAREN, FOLLOW_RPAREN_in_statement8988);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_RPAREN.add(RPAREN297);
                                }
                                pushFollow(FOLLOW_statement_in_statement8990);
                                statement298 = statement();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_statement.add(statement298.getTree());
                                }
                                // wildcard labels:
                                if (state.backtracking == 0) {
                                    retval.tree = root_0;
                                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                                    root_0 = (CommonTree) adaptor.nil();
                                    // 855:77: -> ^( FOR_EACH[$FOR, \"FOR_EACH\"] localModifierList type IDENT expression statement )
                                    {
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:855:81: ^( FOR_EACH[$FOR, \"FOR_EACH\"] localModifierList type IDENT expression statement )
                                        {
                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(FOR_EACH, FOR283, "FOR_EACH"), root_1);
                                            adaptor.addChild(root_1, stream_localModifierList.nextTree());
                                            adaptor.addChild(root_1, stream_type.nextTree());
                                            adaptor.addChild(root_1, stream_IDENT.nextNode());
                                            adaptor.addChild(root_1, stream_expression.nextTree());
                                            adaptor.addChild(root_1, stream_statement.nextTree());
                                            adaptor.addChild(root_0, root_1);
                                        }
                                    }
                                    retval.tree = root_0;
                                }
                            }
                            break;
                    }
                }
                break;
            case 5:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:857:9: WHILE parenthesizedExpression statement
                {
                    WHILE299 = (Token) match(input, WHILE, FOLLOW_WHILE_in_statement9104);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_WHILE.add(WHILE299);
                    }
                    pushFollow(FOLLOW_parenthesizedExpression_in_statement9106);
                    parenthesizedExpression300 = parenthesizedExpression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_parenthesizedExpression.add(parenthesizedExpression300.getTree());
                    }
                    pushFollow(FOLLOW_statement_in_statement9108);
                    statement301 = statement();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_statement.add(statement301.getTree());
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 857:77: -> ^( WHILE parenthesizedExpression statement )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:857:81: ^( WHILE parenthesizedExpression statement )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_WHILE.nextNode(), root_1);
                                adaptor.addChild(root_1, stream_parenthesizedExpression.nextTree());
                                adaptor.addChild(root_1, stream_statement.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 6:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:858:9: DO statement WHILE parenthesizedExpression SEMI
                {
                    DO302 = (Token) match(input, DO, FOLLOW_DO_in_statement9157);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_DO.add(DO302);
                    }
                    pushFollow(FOLLOW_statement_in_statement9159);
                    statement303 = statement();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_statement.add(statement303.getTree());
                    }
                    WHILE304 = (Token) match(input, WHILE, FOLLOW_WHILE_in_statement9161);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_WHILE.add(WHILE304);
                    }
                    pushFollow(FOLLOW_parenthesizedExpression_in_statement9163);
                    parenthesizedExpression305 = parenthesizedExpression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_parenthesizedExpression.add(parenthesizedExpression305.getTree());
                    }
                    SEMI306 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement9165);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_SEMI.add(SEMI306);
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 858:77: -> ^( DO statement parenthesizedExpression )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:858:81: ^( DO statement parenthesizedExpression )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_DO.nextNode(), root_1);
                                adaptor.addChild(root_1, stream_statement.nextTree());
                                adaptor.addChild(root_1, stream_parenthesizedExpression.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 7:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:9: TRY block ( catches ( finallyClause )? | finallyClause )
                {
                    TRY307 = (Token) match(input, TRY, FOLLOW_TRY_in_statement9206);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_TRY.add(TRY307);
                    }
                    pushFollow(FOLLOW_block_in_statement9208);
                    block308 = block();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_block.add(block308.getTree());
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:19: ( catches ( finallyClause )? | finallyClause )
                    int alt94 = 2;
                    int LA94_0 = input.LA(1);
                    if ((LA94_0 == CATCH)) {
                        alt94 = 1;
                    } else if ((LA94_0 == FINALLY)) {
                        alt94 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return retval;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 94, 0, input);
                        throw nvae;
                    }
                    switch(alt94) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:20: catches ( finallyClause )?
                            {
                                pushFollow(FOLLOW_catches_in_statement9211);
                                catches309 = catches();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_catches.add(catches309.getTree());
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:28: ( finallyClause )?
                                int alt93 = 2;
                                int LA93_0 = input.LA(1);
                                if ((LA93_0 == FINALLY)) {
                                    alt93 = 1;
                                }
                                switch(alt93) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: finallyClause
                                        {
                                            pushFollow(FOLLOW_finallyClause_in_statement9213);
                                            finallyClause310 = finallyClause();
                                            state._fsp--;
                                            if (state.failed) {
                                                return retval;
                                            }
                                            if (state.backtracking == 0) {
                                                stream_finallyClause.add(finallyClause310.getTree());
                                            }
                                        }
                                        break;
                                }
                            }
                            break;
                        case 2:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:45: finallyClause
                            {
                                pushFollow(FOLLOW_finallyClause_in_statement9218);
                                finallyClause311 = finallyClause();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_finallyClause.add(finallyClause311.getTree());
                                }
                            }
                            break;
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 859:77: -> ^( TRY block ( catches )? ( finallyClause )? )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:81: ^( TRY block ( catches )? ( finallyClause )? )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_TRY.nextNode(), root_1);
                                adaptor.addChild(root_1, stream_block.nextTree());
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:93: ( catches )?
                                if (stream_catches.hasNext()) {
                                    adaptor.addChild(root_1, stream_catches.nextTree());
                                }
                                stream_catches.reset();
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:859:102: ( finallyClause )?
                                if (stream_finallyClause.hasNext()) {
                                    adaptor.addChild(root_1, stream_finallyClause.nextTree());
                                }
                                stream_finallyClause.reset();
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 8:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:860:9: SWITCH parenthesizedExpression LCURLY switchBlockLabels RCURLY
                {
                    SWITCH312 = (Token) match(input, SWITCH, FOLLOW_SWITCH_in_statement9261);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_SWITCH.add(SWITCH312);
                    }
                    pushFollow(FOLLOW_parenthesizedExpression_in_statement9263);
                    parenthesizedExpression313 = parenthesizedExpression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_parenthesizedExpression.add(parenthesizedExpression313.getTree());
                    }
                    LCURLY314 = (Token) match(input, LCURLY, FOLLOW_LCURLY_in_statement9265);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_LCURLY.add(LCURLY314);
                    }
                    pushFollow(FOLLOW_switchBlockLabels_in_statement9267);
                    switchBlockLabels315 = switchBlockLabels();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_switchBlockLabels.add(switchBlockLabels315.getTree());
                    }
                    RCURLY316 = (Token) match(input, RCURLY, FOLLOW_RCURLY_in_statement9269);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_RCURLY.add(RCURLY316);
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 860:77: -> ^( SWITCH parenthesizedExpression switchBlockLabels )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:860:81: ^( SWITCH parenthesizedExpression switchBlockLabels )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_SWITCH.nextNode(), root_1);
                                adaptor.addChild(root_1, stream_parenthesizedExpression.nextTree());
                                adaptor.addChild(root_1, stream_switchBlockLabels.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 9:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:861:9: SYNCHRONIZED parenthesizedExpression block
                {
                    SYNCHRONIZED317 = (Token) match(input, SYNCHRONIZED, FOLLOW_SYNCHRONIZED_in_statement9295);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_SYNCHRONIZED.add(SYNCHRONIZED317);
                    }
                    pushFollow(FOLLOW_parenthesizedExpression_in_statement9297);
                    parenthesizedExpression318 = parenthesizedExpression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_parenthesizedExpression.add(parenthesizedExpression318.getTree());
                    }
                    pushFollow(FOLLOW_block_in_statement9299);
                    block319 = block();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_block.add(block319.getTree());
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 861:77: -> ^( SYNCHRONIZED parenthesizedExpression block )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:861:81: ^( SYNCHRONIZED parenthesizedExpression block )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_SYNCHRONIZED.nextNode(), root_1);
                                adaptor.addChild(root_1, stream_parenthesizedExpression.nextTree());
                                adaptor.addChild(root_1, stream_block.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 10:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:862:9: RETURN ( expression )? SEMI
                {
                    RETURN320 = (Token) match(input, RETURN, FOLLOW_RETURN_in_statement9345);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_RETURN.add(RETURN320);
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:862:16: ( expression )?
                    int alt95 = 2;
                    int LA95_0 = input.LA(1);
                    if ((LA95_0 == DEC || LA95_0 == INC || LA95_0 == LESS_THAN || LA95_0 == LOGICAL_NOT || (LA95_0 >= LPAREN && LA95_0 <= MINUS) || LA95_0 == NOT || LA95_0 == PLUS || LA95_0 == BOOLEAN || LA95_0 == BYTE || LA95_0 == CHAR || LA95_0 == DOUBLE || LA95_0 == FALSE || LA95_0 == FLOAT || (LA95_0 >= INT && LA95_0 <= LONG) || (LA95_0 >= NEW && LA95_0 <= NULL) || LA95_0 == SHORT || LA95_0 == SUPER || LA95_0 == THIS || LA95_0 == TRUE || LA95_0 == VOID || (LA95_0 >= IDENT && LA95_0 <= STRING_LITERAL))) {
                        alt95 = 1;
                    }
                    switch(alt95) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: expression
                            {
                                pushFollow(FOLLOW_expression_in_statement9347);
                                expression321 = expression();
                                state._fsp--;
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_expression.add(expression321.getTree());
                                }
                            }
                            break;
                    }
                    SEMI322 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement9350);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_SEMI.add(SEMI322);
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 862:77: -> ^( RETURN ( expression )? )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:862:81: ^( RETURN ( expression )? )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_RETURN.nextNode(), root_1);
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:862:90: ( expression )?
                                if (stream_expression.hasNext()) {
                                    adaptor.addChild(root_1, stream_expression.nextTree());
                                }
                                stream_expression.reset();
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 11:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:863:9: THROW expression SEMI
                {
                    THROW323 = (Token) match(input, THROW, FOLLOW_THROW_in_statement9414);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_THROW.add(THROW323);
                    }
                    pushFollow(FOLLOW_expression_in_statement9416);
                    expression324 = expression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_expression.add(expression324.getTree());
                    }
                    SEMI325 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement9418);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_SEMI.add(SEMI325);
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 863:77: -> ^( THROW expression )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:863:81: ^( THROW expression )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_THROW.nextNode(), root_1);
                                adaptor.addChild(root_1, stream_expression.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 12:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:864:9: BREAK ( IDENT )? SEMI
                {
                    BREAK326 = (Token) match(input, BREAK, FOLLOW_BREAK_in_statement9483);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_BREAK.add(BREAK326);
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:864:15: ( IDENT )?
                    int alt96 = 2;
                    int LA96_0 = input.LA(1);
                    if ((LA96_0 == IDENT)) {
                        alt96 = 1;
                    }
                    switch(alt96) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: IDENT
                            {
                                IDENT327 = (Token) match(input, IDENT, FOLLOW_IDENT_in_statement9485);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_IDENT.add(IDENT327);
                                }
                            }
                            break;
                    }
                    SEMI328 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement9488);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_SEMI.add(SEMI328);
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 864:77: -> ^( BREAK ( IDENT )? )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:864:81: ^( BREAK ( IDENT )? )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_BREAK.nextNode(), root_1);
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:864:89: ( IDENT )?
                                if (stream_IDENT.hasNext()) {
                                    adaptor.addChild(root_1, stream_IDENT.nextNode());
                                }
                                stream_IDENT.reset();
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 13:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:865:9: CONTINUE ( IDENT )? SEMI
                {
                    CONTINUE329 = (Token) match(input, CONTINUE, FOLLOW_CONTINUE_in_statement9558);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_CONTINUE.add(CONTINUE329);
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:865:18: ( IDENT )?
                    int alt97 = 2;
                    int LA97_0 = input.LA(1);
                    if ((LA97_0 == IDENT)) {
                        alt97 = 1;
                    }
                    switch(alt97) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: IDENT
                            {
                                IDENT330 = (Token) match(input, IDENT, FOLLOW_IDENT_in_statement9560);
                                if (state.failed) {
                                    return retval;
                                }
                                if (state.backtracking == 0) {
                                    stream_IDENT.add(IDENT330);
                                }
                            }
                            break;
                    }
                    SEMI331 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement9563);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_SEMI.add(SEMI331);
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 865:77: -> ^( CONTINUE ( IDENT )? )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:865:81: ^( CONTINUE ( IDENT )? )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot(stream_CONTINUE.nextNode(), root_1);
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:865:92: ( IDENT )?
                                if (stream_IDENT.hasNext()) {
                                    adaptor.addChild(root_1, stream_IDENT.nextNode());
                                }
                                stream_IDENT.reset();
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 14:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:866:9: IDENT COLON statement
                {
                    IDENT332 = (Token) match(input, IDENT, FOLLOW_IDENT_in_statement9630);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_IDENT.add(IDENT332);
                    }
                    COLON333 = (Token) match(input, COLON, FOLLOW_COLON_in_statement9632);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_COLON.add(COLON333);
                    }
                    pushFollow(FOLLOW_statement_in_statement9634);
                    statement334 = statement();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_statement.add(statement334.getTree());
                    }
                    // wildcard labels:
                    if (state.backtracking == 0) {
                        retval.tree = root_0;
                        RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                        root_0 = (CommonTree) adaptor.nil();
                        // 866:77: -> ^( LABELED_STATEMENT IDENT statement )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:866:81: ^( LABELED_STATEMENT IDENT statement )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(LABELED_STATEMENT, "LABELED_STATEMENT"), root_1);
                                adaptor.addChild(root_1, stream_IDENT.nextNode());
                                adaptor.addChild(root_1, stream_statement.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 15:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:867:9: expression SEMI
                {
                    root_0 = (CommonTree) adaptor.nil();
                    pushFollow(FOLLOW_expression_in_statement9701);
                    expression335 = expression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        adaptor.addChild(root_0, expression335.getTree());
                    }
                    SEMI336 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement9703);
                    if (state.failed) {
                        return retval;
                    }
                }
                break;
            case 16:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:868:9: SEMI
                {
                    root_0 = (CommonTree) adaptor.nil();
                    SEMI337 = (Token) match(input, SEMI, FOLLOW_SEMI_in_statement9714);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        SEMI337_tree = (CommonTree) adaptor.create(SEMI337);
                        adaptor.addChild(root_0, SEMI337_tree);
                    }
                }
                break;
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 75, statement_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) NoViableAltException(org.antlr.runtime.NoViableAltException) RecognitionException(org.antlr.runtime.RecognitionException)

Aggregations

NoViableAltException (org.antlr.runtime.NoViableAltException)68 RecognitionException (org.antlr.runtime.RecognitionException)50 Token (org.antlr.runtime.Token)43 CommonTree (org.antlr.runtime.tree.CommonTree)33 RewriteRuleSubtreeStream (org.antlr.runtime.tree.RewriteRuleSubtreeStream)28 RewriteRuleTokenStream (org.antlr.runtime.tree.RewriteRuleTokenStream)24 ParserRuleReturnScope (org.antlr.runtime.ParserRuleReturnScope)10 CommonToken (org.antlr.runtime.CommonToken)7 MismatchedSetException (org.antlr.runtime.MismatchedSetException)6 EarlyExitException (org.antlr.runtime.EarlyExitException)4 FailedPredicateException (org.antlr.runtime.FailedPredicateException)3 RewriteEarlyExitException (org.antlr.runtime.tree.RewriteEarlyExitException)3 ArrayList (java.util.ArrayList)2 MismatchedNotSetException (org.antlr.runtime.MismatchedNotSetException)2 MismatchedTokenException (org.antlr.runtime.MismatchedTokenException)2 MismatchedTreeNodeException (org.antlr.runtime.MismatchedTreeNodeException)2 RewriteEmptyStreamException (org.antlr.runtime.tree.RewriteEmptyStreamException)2