Search in sources :

Example 6 with MismatchedSetException

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

the class JavaParser method genericWildcardBoundType.

// $ANTLR start "genericWildcardBoundType"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:707:1: genericWildcardBoundType : ( EXTENDS | SUPER ) type ;
public final JavaParser.genericWildcardBoundType_return genericWildcardBoundType() throws RecognitionException {
    JavaParser.genericWildcardBoundType_return retval = new JavaParser.genericWildcardBoundType_return();
    retval.start = input.LT(1);
    int genericWildcardBoundType_StartIndex = input.index();
    CommonTree root_0 = null;
    Token set193 = null;
    JavaParser.type_return type194 = null;
    CommonTree set193_tree = null;
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 52)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:708:5: ( ( EXTENDS | SUPER ) type )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:708:9: ( EXTENDS | SUPER ) type
        {
            root_0 = (CommonTree) adaptor.nil();
            set193 = (Token) input.LT(1);
            set193 = (Token) input.LT(1);
            if (input.LA(1) == EXTENDS || input.LA(1) == SUPER) {
                input.consume();
                if (state.backtracking == 0) {
                    root_0 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(set193), root_0);
                }
                state.errorRecovery = false;
                state.failed = false;
            } else {
                if (state.backtracking > 0) {
                    state.failed = true;
                    return retval;
                }
                MismatchedSetException mse = new MismatchedSetException(null, input);
                throw mse;
            }
            pushFollow(FOLLOW_type_in_genericWildcardBoundType7332);
            type194 = type();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                adaptor.addChild(root_0, type194.getTree());
            }
        }
        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, 52, genericWildcardBoundType_StartIndex);
        }
    }
    return retval;
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) CommonTree(org.antlr.runtime.tree.CommonTree) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Example 7 with MismatchedSetException

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

the class ConditionLexer method mHEX_NUMBER.

// $ANTLR end "DIV"
// $ANTLR start "MOD"
public final void mHEX_NUMBER() throws RecognitionException {
    try {
        final int _type = HEX_NUMBER;
        final int _channel = DEFAULT_TOKEN_CHANNEL;
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:33:12:
        // ( '0x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ )
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:33:14:
        // '0x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
        {
            match("0x");
            // C:\\Dokumente und
            // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:33:19:
            // ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
            int cnt2 = 0;
            loop2: do {
                int alt2 = 2;
                final int LA2_0 = input.LA(1);
                if (((LA2_0 >= '0' && LA2_0 <= '9') || (LA2_0 >= 'A' && LA2_0 <= 'F') || (LA2_0 >= 'a' && LA2_0 <= 'f'))) {
                    alt2 = 1;
                }
                switch(alt2) {
                    case 1:
                        // C:\\Dokumente und
                        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:
                        {
                            if ((input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'A' && input.LA(1) <= 'F') || (input.LA(1) >= 'a' && input.LA(1) <= 'f')) {
                                input.consume();
                            } else {
                                final MismatchedSetException mse = new MismatchedSetException(null, input);
                                recover(mse);
                                throw mse;
                            }
                        }
                        break;
                    default:
                        if (cnt2 >= 1) {
                            break loop2;
                        }
                        final EarlyExitException eee = new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) EarlyExitException(org.antlr.runtime.EarlyExitException)

Example 8 with MismatchedSetException

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

the class ConditionParser method condition.

// $ANTLR end "bxorExpression"
// $ANTLR start "condition"
// C:\\Dokumente und
// Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:65:1:
// condition : formula ( EQ_SIGN | GEQ_SIGN | LEQ_SIGN | LT_SIGN | GT_SIGN | NEQ_SIGN | NEQ_SIGN_2
// ) formula ;
public final ConditionParser.condition_return condition() throws RecognitionException {
    final ConditionParser.condition_return retval = new ConditionParser.condition_return();
    retval.start = input.LT(1);
    Object root_0 = null;
    Token set10 = null;
    ConditionParser.formula_return formula9 = null;
    ConditionParser.formula_return formula11 = null;
    final Object set10_tree = null;
    try {
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:65:11:
        // ( formula ( EQ_SIGN | GEQ_SIGN | LEQ_SIGN | LT_SIGN | GT_SIGN | NEQ_SIGN | NEQ_SIGN_2 )
        // formula )
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:65:14:
        // formula ( EQ_SIGN | GEQ_SIGN | LEQ_SIGN | LT_SIGN | GT_SIGN | NEQ_SIGN | NEQ_SIGN_2 )
        // formula
        {
            root_0 = (Object) adaptor.nil();
            pushFollow(FOLLOW_formula_in_condition376);
            formula9 = formula();
            state._fsp--;
            adaptor.addChild(root_0, formula9.getTree());
            set10 = (Token) input.LT(1);
            set10 = (Token) input.LT(1);
            if ((input.LA(1) >= EQ_SIGN && input.LA(1) <= NEQ_SIGN_2)) {
                input.consume();
                root_0 = (Object) adaptor.becomeRoot((Object) adaptor.create(set10), root_0);
                state.errorRecovery = false;
            } else {
                final MismatchedSetException mse = new MismatchedSetException(null, input);
                throw mse;
            }
            pushFollow(FOLLOW_formula_in_condition395);
            formula11 = formula();
            state._fsp--;
            adaptor.addChild(root_0, formula11.getTree());
        }
        retval.stop = input.LT(-1);
        retval.tree = (Object) adaptor.rulePostProcessing(root_0);
        adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
    } catch (final RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
    }
    return retval;
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Example 9 with MismatchedSetException

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

the class ConditionParser method shiftExpression.

// $ANTLR start "shiftExpression"
// C:\\Dokumente und
// Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:80:1:
// shiftExpression : addExpression ( ( LSH | RSH ) addExpression )* ;
public final ConditionParser.shiftExpression_return shiftExpression() throws RecognitionException {
    final ConditionParser.shiftExpression_return retval = new ConditionParser.shiftExpression_return();
    retval.start = input.LT(1);
    Object root_0 = null;
    Token set22 = null;
    ConditionParser.addExpression_return addExpression21 = null;
    ConditionParser.addExpression_return addExpression23 = null;
    final Object set22_tree = null;
    try {
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:81:3:
        // ( addExpression ( ( LSH | RSH ) addExpression )* )
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:81:5:
        // addExpression ( ( LSH | RSH ) addExpression )*
        {
            root_0 = (Object) adaptor.nil();
            pushFollow(FOLLOW_addExpression_in_shiftExpression477);
            addExpression21 = addExpression();
            state._fsp--;
            adaptor.addChild(root_0, addExpression21.getTree());
            // ( ( LSH | RSH ) addExpression )*
            loop6: do {
                int alt6 = 2;
                final int LA6_0 = input.LA(1);
                if (((LA6_0 >= LSH && LA6_0 <= RSH))) {
                    alt6 = 1;
                }
                switch(alt6) {
                    case 1:
                        // C:\\Dokumente und
                        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:81:20:
                        // ( LSH | RSH ) addExpression
                        {
                            set22 = (Token) input.LT(1);
                            set22 = (Token) input.LT(1);
                            if ((input.LA(1) >= LSH && input.LA(1) <= RSH)) {
                                input.consume();
                                root_0 = (Object) adaptor.becomeRoot((Object) adaptor.create(set22), root_0);
                                state.errorRecovery = false;
                            } else {
                                final MismatchedSetException mse = new MismatchedSetException(null, input);
                                throw mse;
                            }
                            pushFollow(FOLLOW_addExpression_in_shiftExpression487);
                            addExpression23 = addExpression();
                            state._fsp--;
                            adaptor.addChild(root_0, addExpression23.getTree());
                        }
                        break;
                    default:
                        break loop6;
                }
            } while (true);
        }
        retval.stop = input.LT(-1);
        retval.tree = (Object) adaptor.rulePostProcessing(root_0);
        adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
    } catch (final RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
    }
    return retval;
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Example 10 with MismatchedSetException

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

the class FilterLexer method mWS.

// $ANTLR start "WS"
public final void mWS() throws RecognitionException {
    try {
        final int _type = WS;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\filter\\Filter.g:15:5:
        // ( ( ' ' | '\\r' | '\\t' | '\ ' | '\\n' ) )
        // C:\\Dokumente und
        // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\filter\\Filter.g:15:8:
        // ( ' ' | '\\r' | '\\t' | '\ ' | '\\n' )
        {
            if ((input.LA(1) >= '\t' && input.LA(1) <= '\n') || (input.LA(1) >= '\f' && input.LA(1) <= '\r') || input.LA(1) == ' ') {
                input.consume();
            } else {
                final MismatchedSetException mse = new MismatchedSetException(null, input);
                recover(mse);
                throw mse;
            }
            _channel = HIDDEN;
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException)

Aggregations

MismatchedSetException (org.antlr.runtime.MismatchedSetException)28 RecognitionException (org.antlr.runtime.RecognitionException)8 Token (org.antlr.runtime.Token)8 EarlyExitException (org.antlr.runtime.EarlyExitException)7 NoViableAltException (org.antlr.runtime.NoViableAltException)4 CommonTree (org.antlr.runtime.tree.CommonTree)4