Search in sources :

Example 1 with MismatchedSetException

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

the class CssLexer method mSL_COMMENT.

// $ANTLR end "IDENT"
// $ANTLR start "SL_COMMENT"
public final void mSL_COMMENT() throws RecognitionException {
    try {
        int _type = SL_COMMENT;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/src/grammar/Css.g:135:2: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\n' | '\\r' ( '\\n' )? ) )
        // /home/langera/dev/freud/src/grammar/Css.g:135:4: '//' (~ ( '\\n' | '\\r' ) )* ( '\\n' | '\\r' ( '\\n' )? )
        {
            match("//");
            // /home/langera/dev/freud/src/grammar/Css.g:136:3: (~ ( '\\n' | '\\r' ) )*
            loop2: do {
                int alt2 = 2;
                int LA2_0 = input.LA(1);
                if (((LA2_0 >= '' && LA2_0 <= '\t') || (LA2_0 >= '' && LA2_0 <= '\f') || (LA2_0 >= '' && LA2_0 <= '￿'))) {
                    alt2 = 1;
                }
                switch(alt2) {
                    case 1:
                        // /home/langera/dev/freud/src/grammar/Css.g:136:4: ~ ( '\\n' | '\\r' )
                        {
                            if ((input.LA(1) >= '' && input.LA(1) <= '\t') || (input.LA(1) >= '' && input.LA(1) <= '\f') || (input.LA(1) >= '' && input.LA(1) <= '￿')) {
                                input.consume();
                            } else {
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                recover(mse);
                                throw mse;
                            }
                        }
                        break;
                    default:
                        break loop2;
                }
            } while (true);
            // /home/langera/dev/freud/src/grammar/Css.g:136:19: ( '\\n' | '\\r' ( '\\n' )? )
            int alt4 = 2;
            int LA4_0 = input.LA(1);
            if ((LA4_0 == '\n')) {
                alt4 = 1;
            } else if ((LA4_0 == '\r')) {
                alt4 = 2;
            } else {
                NoViableAltException nvae = new NoViableAltException("", 4, 0, input);
                throw nvae;
            }
            switch(alt4) {
                case 1:
                    // /home/langera/dev/freud/src/grammar/Css.g:136:20: '\\n'
                    {
                        match('\n');
                    }
                    break;
                case 2:
                    // /home/langera/dev/freud/src/grammar/Css.g:136:25: '\\r' ( '\\n' )?
                    {
                        match('\r');
                        // /home/langera/dev/freud/src/grammar/Css.g:136:29: ( '\\n' )?
                        int alt3 = 2;
                        int LA3_0 = input.LA(1);
                        if ((LA3_0 == '\n')) {
                            alt3 = 1;
                        }
                        switch(alt3) {
                            case 1:
                                // /home/langera/dev/freud/src/grammar/Css.g:136:30: '\\n'
                                {
                                    match('\n');
                                }
                                break;
                        }
                    }
                    break;
            }
            _channel = HIDDEN;
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) NoViableAltException(org.antlr.runtime.NoViableAltException)

Example 2 with MismatchedSetException

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

the class JavaLexer method mLINE_COMMENT.

// $ANTLR end "JAVADOC_COMMENT"
// $ANTLR start "LINE_COMMENT"
public final void mLINE_COMMENT() throws RecognitionException {
    try {
        int _type = LINE_COMMENT;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1287:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1287:7: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
        {
            match("//");
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1287:12: (~ ( '\\n' | '\\r' ) )*
            loop28: do {
                int alt28 = 2;
                int LA28_0 = input.LA(1);
                if (((LA28_0 >= '' && LA28_0 <= '\t') || (LA28_0 >= '' && LA28_0 <= '\f') || (LA28_0 >= '' && LA28_0 <= '￿'))) {
                    alt28 = 1;
                }
                switch(alt28) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1287:12: ~ ( '\\n' | '\\r' )
                        {
                            if ((input.LA(1) >= '' && input.LA(1) <= '\t') || (input.LA(1) >= '' && input.LA(1) <= '\f') || (input.LA(1) >= '' && input.LA(1) <= '￿')) {
                                input.consume();
                            } else {
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                recover(mse);
                                throw mse;
                            }
                        }
                        break;
                    default:
                        break loop28;
                }
            } while (true);
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1287:26: ( '\\r' )?
            int alt29 = 2;
            int LA29_0 = input.LA(1);
            if ((LA29_0 == '\r')) {
                alt29 = 1;
            }
            switch(alt29) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1287:26: '\\r'
                    {
                        match('\r');
                    }
                    break;
            }
            match('\n');
            if (!mPreserveLineComments) {
                skip();
            } else {
                _channel = HIDDEN;
            }
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException)

Example 3 with MismatchedSetException

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

the class JavaLexer method mWS.

// $ANTLR end "JAVA_ID_PART"
// $ANTLR start "WS"
public final void mWS() throws RecognitionException {
    try {
        int _type = WS;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1252:5: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1252:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' )
        {
            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;
            }
            if (!mPreserveWhitespaces) {
                skip();
            } else {
                _channel = HIDDEN;
            }
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException)

Example 4 with MismatchedSetException

use of org.antlr.runtime.MismatchedSetException 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 5 with MismatchedSetException

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

the class JavaLexer method mCHARACTER_LITERAL.

// $ANTLR end "FLOAT_TYPE_SUFFIX"
// $ANTLR start "CHARACTER_LITERAL"
public final void mCHARACTER_LITERAL() throws RecognitionException {
    try {
        int _type = CHARACTER_LITERAL;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1199:5: ( '\\'' ( ESCAPE_SEQUENCE | ~ ( '\\'' | '\\\\' ) ) '\\'' )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1199:9: '\\'' ( ESCAPE_SEQUENCE | ~ ( '\\'' | '\\\\' ) ) '\\''
        {
            match('\'');
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1199:14: ( ESCAPE_SEQUENCE | ~ ( '\\'' | '\\\\' ) )
            int alt20 = 2;
            int LA20_0 = input.LA(1);
            if ((LA20_0 == '\\')) {
                alt20 = 1;
            } else if (((LA20_0 >= '' && LA20_0 <= '&') || (LA20_0 >= '(' && LA20_0 <= '[') || (LA20_0 >= ']' && LA20_0 <= '￿'))) {
                alt20 = 2;
            } else {
                NoViableAltException nvae = new NoViableAltException("", 20, 0, input);
                throw nvae;
            }
            switch(alt20) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1199:16: ESCAPE_SEQUENCE
                    {
                        mESCAPE_SEQUENCE();
                    }
                    break;
                case 2:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1199:34: ~ ( '\\'' | '\\\\' )
                    {
                        if ((input.LA(1) >= '' && input.LA(1) <= '&') || (input.LA(1) >= '(' && input.LA(1) <= '[') || (input.LA(1) >= ']' && input.LA(1) <= '￿')) {
                            input.consume();
                        } else {
                            MismatchedSetException mse = new MismatchedSetException(null, input);
                            recover(mse);
                            throw mse;
                        }
                    }
                    break;
            }
            match('\'');
        }
        state.type = _type;
        state.channel = _channel;
    } finally {
    }
}
Also used : MismatchedSetException(org.antlr.runtime.MismatchedSetException) NoViableAltException(org.antlr.runtime.NoViableAltException)

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