Search in sources :

Example 26 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project cxf by apache.

the class IDLLexer method mFLOAT.

public final void mFLOAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = FLOAT;
    int _saveIndex;
    match('.');
    {
        int _cnt387 = 0;
        _loop387: do {
            if (((LA(1) >= '0' && LA(1) <= '9'))) {
                mDIGIT(false);
            } else {
                if (_cnt387 >= 1) {
                    break _loop387;
                }
                throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
            }
            _cnt387++;
        } while (true);
    }
    {
        switch(LA(1)) {
            case 'E':
            case 'e':
                {
                    {
                        switch(LA(1)) {
                            case 'e':
                                {
                                    match('e');
                                    break;
                                }
                            case 'E':
                                {
                                    match('E');
                                    break;
                                }
                            default:
                                {
                                    throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                                }
                        }
                    }
                    {
                        switch(LA(1)) {
                            case '+':
                                {
                                    match('+');
                                    break;
                                }
                            case '-':
                                {
                                    match('-');
                                    break;
                                }
                            case '0':
                            case '1':
                            case '2':
                            case '3':
                            case '4':
                            case '5':
                            case '6':
                            case '7':
                            case '8':
                            case '9':
                                {
                                    break;
                                }
                            default:
                                {
                                    throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                                }
                        }
                    }
                    {
                        int _cnt392 = 0;
                        _loop392: do {
                            if (((LA(1) >= '0' && LA(1) <= '9'))) {
                                mDIGIT(false);
                            } else {
                                if (_cnt392 >= 1) {
                                    break _loop392;
                                }
                                throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                            }
                            _cnt392++;
                        } while (true);
                    }
                    break;
                }
            case 'D':
            case 'd':
                {
                    {
                        switch(LA(1)) {
                            case 'd':
                                {
                                    match('d');
                                    break;
                                }
                            case 'D':
                                {
                                    match('D');
                                    break;
                                }
                            default:
                                {
                                    throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                                }
                        }
                    }
                    _ttype = FIXED;
                    break;
                }
            default:
                {
                }
        }
    }
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : NoViableAltForCharException(antlr.NoViableAltForCharException) Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Example 27 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project cxf by apache.

the class IDLLexer method mESC.

protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = ESC;
    int _saveIndex;
    _saveIndex = text.length();
    match('\\');
    text.setLength(_saveIndex);
    {
        switch(LA(1)) {
            case 'n':
                {
                    match('n');
                    text.setLength(_begin);
                    text.append("\n");
                    break;
                }
            case 't':
                {
                    match('t');
                    text.setLength(_begin);
                    text.append("\t");
                    break;
                }
            case 'v':
                {
                    match('v');
                    text.setLength(_begin);
                    text.append("\013");
                    break;
                }
            case 'b':
                {
                    match('b');
                    text.setLength(_begin);
                    text.append("\b");
                    break;
                }
            case 'r':
                {
                    match('r');
                    text.setLength(_begin);
                    text.append("\r");
                    break;
                }
            case 'f':
                {
                    match('f');
                    text.setLength(_begin);
                    text.append("\r");
                    break;
                }
            case 'a':
                {
                    match('a');
                    text.setLength(_begin);
                    text.append("\007");
                    break;
                }
            case '\\':
                {
                    match('\\');
                    text.setLength(_begin);
                    text.append("\\");
                    break;
                }
            case '?':
                {
                    match('?');
                    text.setLength(_begin);
                    text.append('?');
                    break;
                }
            case '\'':
                {
                    match('\'');
                    text.setLength(_begin);
                    text.append('\'');
                    break;
                }
            case '"':
                {
                    match('"');
                    text.setLength(_begin);
                    text.append('"');
                    break;
                }
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
                {
                    mOCTDIGIT(false);
                    {
                        if (((LA(1) >= '0' && LA(1) <= '7')) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) {
                            mOCTDIGIT(false);
                            {
                                if (((LA(1) >= '0' && LA(1) <= '7')) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) {
                                    mOCTDIGIT(false);
                                } else if (((LA(1) >= '\u0000' && LA(1) <= '\ufffe'))) {
                                } else {
                                    throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                                }
                            }
                        } else if (((LA(1) >= '\u0000' && LA(1) <= '\ufffe'))) {
                        } else {
                            throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                        }
                    }
                    char realc = (char) Integer.valueOf(new String(text.getBuffer(), _begin, text.length() - _begin), 8).intValue();
                    text.setLength(_begin);
                    text.append(realc);
                    break;
                }
            case 'x':
                {
                    _saveIndex = text.length();
                    match('x');
                    text.setLength(_saveIndex);
                    mHEXDIGIT(false);
                    {
                        if ((_tokenSet_6.member(LA(1))) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) {
                            mHEXDIGIT(false);
                        } else if (((LA(1) >= '\u0000' && LA(1) <= '\ufffe'))) {
                        } else {
                            throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                        }
                    }
                    char realc = (char) Integer.valueOf(new String(text.getBuffer(), _begin, text.length() - _begin), 16).intValue();
                    text.setLength(_begin);
                    text.append(realc);
                    break;
                }
            case 'u':
                {
                    _saveIndex = text.length();
                    match('u');
                    text.setLength(_saveIndex);
                    mHEXDIGIT(false);
                    {
                        if ((_tokenSet_6.member(LA(1))) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) {
                            mHEXDIGIT(false);
                            {
                                if ((_tokenSet_6.member(LA(1))) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) {
                                    mHEXDIGIT(false);
                                    {
                                        if ((_tokenSet_6.member(LA(1))) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) {
                                            mHEXDIGIT(false);
                                        } else if (((LA(1) >= '\u0000' && LA(1) <= '\ufffe'))) {
                                        } else {
                                            throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                                        }
                                    }
                                } else if (((LA(1) >= '\u0000' && LA(1) <= '\ufffe'))) {
                                } else {
                                    throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                                }
                            }
                        } else if (((LA(1) >= '\u0000' && LA(1) <= '\ufffe'))) {
                        } else {
                            throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                        }
                    }
                    char realc = (char) Integer.valueOf(new String(text.getBuffer(), _begin, text.length() - _begin), 16).intValue();
                    text.setLength(_begin);
                    text.append(realc);
                    break;
                }
            default:
                {
                    throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                }
        }
    }
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : NoViableAltForCharException(antlr.NoViableAltForCharException) Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Example 28 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project cxf by apache.

the class IDLLexer method mWS.

public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = WS;
    int _saveIndex;
    {
        switch(LA(1)) {
            case ' ':
                {
                    match(' ');
                    break;
                }
            case '\t':
                {
                    match('\t');
                    break;
                }
            case '\n':
                {
                    match('\n');
                    newline();
                    break;
                }
            case '\r':
                {
                    match('\r');
                    break;
                }
            default:
                {
                    throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                }
        }
    }
    _ttype = Token.SKIP;
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : NoViableAltForCharException(antlr.NoViableAltForCharException) Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Example 29 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project sonarqube by SonarSource.

the class ValidWhenLexer method mWS.

public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = WS;
    int _saveIndex;
    {
        int _cnt15 = 0;
        _loop15: do {
            switch(LA(1)) {
                case ' ':
                    {
                        match(' ');
                        break;
                    }
                case '\t':
                    {
                        match('\t');
                        break;
                    }
                case '\n':
                    {
                        match('\n');
                        break;
                    }
                case '\r':
                    {
                        match('\r');
                        break;
                    }
                default:
                    {
                        if (_cnt15 >= 1) {
                            break _loop15;
                        } else {
                            throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
                        }
                    }
            }
            _cnt15++;
        } while (true);
    }
    _ttype = Token.SKIP;
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : NoViableAltForCharException(antlr.NoViableAltForCharException) Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Example 30 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project sonarqube by SonarSource.

the class ValidWhenLexer method mHEX_LITERAL.

public final void mHEX_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = HEX_LITERAL;
    int _saveIndex;
    match('0');
    match('x');
    {
        int _cnt23 = 0;
        _loop23: do {
            switch(LA(1)) {
                case '0':
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                    {
                        matchRange('0', '9');
                        break;
                    }
                case 'a':
                case 'b':
                case 'c':
                case 'd':
                case 'e':
                case 'f':
                    {
                        matchRange('a', 'f');
                        break;
                    }
                default:
                    {
                        if (_cnt23 >= 1) {
                            break _loop23;
                        } else {
                            throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
                        }
                    }
            }
            _cnt23++;
        } while (true);
    }
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : NoViableAltForCharException(antlr.NoViableAltForCharException) Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Aggregations

NoViableAltForCharException (antlr.NoViableAltForCharException)55 Token (antlr.Token)53 ANTLRHashString (antlr.ANTLRHashString)47 CommonToken (antlr.CommonToken)44 RecognitionException (antlr.RecognitionException)7 TokenStreamRecognitionException (antlr.TokenStreamRecognitionException)7 CharStreamException (antlr.CharStreamException)6 CharStreamIOException (antlr.CharStreamIOException)6 TokenStreamException (antlr.TokenStreamException)6 TokenStreamIOException (antlr.TokenStreamIOException)6 MismatchedCharException (antlr.MismatchedCharException)2 MismatchedTokenException (antlr.MismatchedTokenException)2 NoViableAltException (antlr.NoViableAltException)2 Message (org.codehaus.groovy.control.messages.Message)2 SimpleMessage (org.codehaus.groovy.control.messages.SimpleMessage)2 SyntaxErrorMessage (org.codehaus.groovy.control.messages.SyntaxErrorMessage)2