Search in sources :

Example 21 with MismatchedSetException

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

the class CssParser method unit.

// $ANTLR start "unit"
// /home/langera/dev/freud/src/grammar/Css.g:119:1: unit : ( '%' | 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc' | 'em' | 'ex' | 'deg' | 'rad' | 'grad' | 'ms' | 's' | 'hz' | 'khz' ) ;
public final CssParser.unit_return unit() throws RecognitionException {
    CssParser.unit_return retval = new CssParser.unit_return();
    retval.start = input.LT(1);
    CommonTree root_0 = null;
    Token set68 = null;
    CommonTree set68_tree = null;
    try {
        // /home/langera/dev/freud/src/grammar/Css.g:120:2: ( ( '%' | 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc' | 'em' | 'ex' | 'deg' | 'rad' | 'grad' | 'ms' | 's' | 'hz' | 'khz' ) )
        // /home/langera/dev/freud/src/grammar/Css.g:120:4: ( '%' | 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc' | 'em' | 'ex' | 'deg' | 'rad' | 'grad' | 'ms' | 's' | 'hz' | 'khz' )
        {
            root_0 = (CommonTree) adaptor.nil();
            set68 = (Token) input.LT(1);
            if ((input.LA(1) >= 45 && input.LA(1) <= 60)) {
                input.consume();
                adaptor.addChild(root_0, (CommonTree) adaptor.create(set68));
                state.errorRecovery = false;
            } else {
                MismatchedSetException mse = new MismatchedSetException(null, input);
                throw mse;
            }
        }
        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 : MismatchedSetException(org.antlr.runtime.MismatchedSetException) CommonTree(org.antlr.runtime.tree.CommonTree) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Example 22 with MismatchedSetException

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

the class CssLexer method mWS.

// $ANTLR end "COMMENT"
// $ANTLR start "WS"
public final void mWS() throws RecognitionException {
    try {
        int _type = WS;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/src/grammar/Css.g:146:4: ( ( ' ' | '\\t' | '\\r' | '\\n' | '\\f' )+ )
        // /home/langera/dev/freud/src/grammar/Css.g:146:6: ( ' ' | '\\t' | '\\r' | '\\n' | '\\f' )+
        {
            // /home/langera/dev/freud/src/grammar/Css.g:146:6: ( ' ' | '\\t' | '\\r' | '\\n' | '\\f' )+
            int cnt6 = 0;
            loop6: do {
                int alt6 = 2;
                int LA6_0 = input.LA(1);
                if (((LA6_0 >= '\t' && LA6_0 <= '\n') || (LA6_0 >= '\f' && LA6_0 <= '\r') || LA6_0 == ' ')) {
                    alt6 = 1;
                }
                switch(alt6) {
                    case 1:
                        // /home/langera/dev/freud/src/grammar/Css.g:
                        {
                            if ((input.LA(1) >= '\t' && input.LA(1) <= '\n') || (input.LA(1) >= '\f' && input.LA(1) <= '\r') || input.LA(1) == ' ') {
                                input.consume();
                            } else {
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                recover(mse);
                                throw mse;
                            }
                        }
                        break;
                    default:
                        if (cnt6 >= 1) {
                            break loop6;
                        }
                        EarlyExitException eee = new EarlyExitException(6, input);
                        throw eee;
                }
                cnt6++;
            } while (true);
            _channel = HIDDEN;
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) EarlyExitException(org.antlr.runtime.EarlyExitException)

Example 23 with MismatchedSetException

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

the class CssLexer method mIDENT.

// $ANTLR end "T__62"
// $ANTLR start "IDENT"
public final void mIDENT() throws RecognitionException {
    try {
        int _type = IDENT;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/src/grammar/Css.g:128:2: ( ( '_' | '-' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0100' .. '\\ufffe' | '0' .. '9' | '\"' | '\\'' | '/' | '=' | '!' ) ( options {greedy=true; } : ( '_' | '-' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0100' .. '\\ufffe' | '0' .. '9' | '\"' | '\\'' | '/' | '.' | '=' ) )* )
        // /home/langera/dev/freud/src/grammar/Css.g:128:4: ( '_' | '-' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0100' .. '\\ufffe' | '0' .. '9' | '\"' | '\\'' | '/' | '=' | '!' ) ( options {greedy=true; } : ( '_' | '-' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0100' .. '\\ufffe' | '0' .. '9' | '\"' | '\\'' | '/' | '.' | '=' ) )*
        {
            if ((input.LA(1) >= '!' && input.LA(1) <= '\"') || input.LA(1) == '\'' || input.LA(1) == '-' || (input.LA(1) >= '/' && input.LA(1) <= '9') || input.LA(1) == '=' || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= 'Ā' && input.LA(1) <= '￾')) {
                input.consume();
            } else {
                MismatchedSetException mse = new MismatchedSetException(null, input);
                recover(mse);
                throw mse;
            }
            // /home/langera/dev/freud/src/grammar/Css.g:129:4: ( options {greedy=true; } : ( '_' | '-' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0100' .. '\\ufffe' | '0' .. '9' | '\"' | '\\'' | '/' | '.' | '=' ) )*
            loop1: do {
                int alt1 = 2;
                int LA1_0 = input.LA(1);
                if ((LA1_0 == '\"' || LA1_0 == '\'' || (LA1_0 >= '-' && LA1_0 <= '9') || LA1_0 == '=' || (LA1_0 >= 'A' && LA1_0 <= 'Z') || LA1_0 == '_' || (LA1_0 >= 'a' && LA1_0 <= 'z') || (LA1_0 >= 'Ā' && LA1_0 <= '￾'))) {
                    alt1 = 1;
                }
                switch(alt1) {
                    case 1:
                        // /home/langera/dev/freud/src/grammar/Css.g:129:34: ( '_' | '-' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0100' .. '\\ufffe' | '0' .. '9' | '\"' | '\\'' | '/' | '.' | '=' )
                        {
                            if (input.LA(1) == '\"' || input.LA(1) == '\'' || (input.LA(1) >= '-' && input.LA(1) <= '9') || input.LA(1) == '=' || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= 'Ā' && input.LA(1) <= '￾')) {
                                input.consume();
                            } else {
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                recover(mse);
                                throw mse;
                            }
                        }
                        break;
                    default:
                        break loop1;
                }
            } while (true);
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException)

Example 24 with MismatchedSetException

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

the class JavaLexer method mEXPONENT.

// $ANTLR end "FLOATING_POINT_LITERAL"
// $ANTLR start "EXPONENT"
public final void mEXPONENT() throws RecognitionException {
    try {
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
        {
            if (input.LA(1) == 'E' || input.LA(1) == 'e') {
                input.consume();
            } else {
                MismatchedSetException mse = new MismatchedSetException(null, input);
                recover(mse);
                throw mse;
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:22: ( '+' | '-' )?
            int alt18 = 2;
            int LA18_0 = input.LA(1);
            if ((LA18_0 == '+' || LA18_0 == '-')) {
                alt18 = 1;
            }
            switch(alt18) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:
                    {
                        if (input.LA(1) == '+' || input.LA(1) == '-') {
                            input.consume();
                        } else {
                            MismatchedSetException mse = new MismatchedSetException(null, input);
                            recover(mse);
                            throw mse;
                        }
                    }
                    break;
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:33: ( '0' .. '9' )+
            int cnt19 = 0;
            loop19: do {
                int alt19 = 2;
                int LA19_0 = input.LA(1);
                if (((LA19_0 >= '0' && LA19_0 <= '9'))) {
                    alt19 = 1;
                }
                switch(alt19) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1193:34: '0' .. '9'
                        {
                            matchRange('0', '9');
                        }
                        break;
                    default:
                        if (cnt19 >= 1) {
                            break loop19;
                        }
                        EarlyExitException eee = new EarlyExitException(19, input);
                        throw eee;
                }
                cnt19++;
            } while (true);
        }
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) EarlyExitException(org.antlr.runtime.EarlyExitException)

Example 25 with MismatchedSetException

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

the class JavaLexer method mHEX_LITERAL.

// $ANTLR end "WHILE"
// $ANTLR start "HEX_LITERAL"
public final void mHEX_LITERAL() throws RecognitionException {
    try {
        int _type = HEX_LITERAL;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1170:13: ( '0' ( 'x' | 'X' ) ( HEX_DIGIT )+ ( INTEGER_TYPE_SUFFIX )? )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1170:15: '0' ( 'x' | 'X' ) ( HEX_DIGIT )+ ( INTEGER_TYPE_SUFFIX )?
        {
            match('0');
            if (input.LA(1) == 'X' || input.LA(1) == 'x') {
                input.consume();
            } else {
                MismatchedSetException mse = new MismatchedSetException(null, input);
                recover(mse);
                throw mse;
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1170:29: ( HEX_DIGIT )+
            int cnt1 = 0;
            loop1: do {
                int alt1 = 2;
                int LA1_0 = input.LA(1);
                if (((LA1_0 >= '0' && LA1_0 <= '9') || (LA1_0 >= 'A' && LA1_0 <= 'F') || (LA1_0 >= 'a' && LA1_0 <= 'f'))) {
                    alt1 = 1;
                }
                switch(alt1) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1170:29: HEX_DIGIT
                        {
                            mHEX_DIGIT();
                        }
                        break;
                    default:
                        if (cnt1 >= 1) {
                            break loop1;
                        }
                        EarlyExitException eee = new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1170:40: ( INTEGER_TYPE_SUFFIX )?
            int alt2 = 2;
            int LA2_0 = input.LA(1);
            if ((LA2_0 == 'L' || LA2_0 == 'l')) {
                alt2 = 1;
            }
            switch(alt2) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1170:40: INTEGER_TYPE_SUFFIX
                    {
                        mINTEGER_TYPE_SUFFIX();
                    }
                    break;
            }
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) EarlyExitException(org.antlr.runtime.EarlyExitException)

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