Search in sources :

Example 46 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project jbosstools-hibernate by jbosstools.

the class HQLBaseLexer method mNE.

public final void mNE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = NE;
    int _saveIndex;
    switch(LA(1)) {
        case '!':
            {
                match("!=");
                break;
            }
        case '^':
            {
                match("^=");
                break;
            }
        default:
            {
                throw new NoViableAltForCharException((char) 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) ANTLRHashString(antlr.ANTLRHashString)

Example 47 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project jbosstools-hibernate by jbosstools.

the class HQLBaseLexer 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');
                    if (inputState.guessing == 0) {
                        newline();
                    }
                    break;
                }
            default:
                if ((LA(1) == '\r') && (LA(2) == '\n')) {
                    match('\r');
                    match('\n');
                    if (inputState.guessing == 0) {
                        newline();
                    }
                } else if ((LA(1) == '\r') && (true)) {
                    match('\r');
                    if (inputState.guessing == 0) {
                        newline();
                    }
                } else {
                    throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
                }
        }
    }
    if (inputState.guessing == 0) {
        _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) ANTLRHashString(antlr.ANTLRHashString)

Example 48 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project jbosstools-hibernate by jbosstools.

the class HQLBaseLexer method mHEX_DIGIT.

protected final void mHEX_DIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = HEX_DIGIT;
    int _saveIndex;
    {
        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:
                {
                    throw new NoViableAltForCharException((char) 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) ANTLRHashString(antlr.ANTLRHashString)

Example 49 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project jasn1 by openmuc.

the class ASNLexer method mLOWER.

public final void mLOWER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = LOWER;
    int _saveIndex;
    {
        matchRange('a', 'z');
    }
    {
        _loop56: do {
            if ((_tokenSet_5.member(LA(1)))) {
                {
                    switch(LA(1)) {
                        case 'a':
                        case 'b':
                        case 'c':
                        case 'd':
                        case 'e':
                        case 'f':
                        case 'g':
                        case 'h':
                        case 'i':
                        case 'j':
                        case 'k':
                        case 'l':
                        case 'm':
                        case 'n':
                        case 'o':
                        case 'p':
                        case 'q':
                        case 'r':
                        case 's':
                        case 't':
                        case 'u':
                        case 'v':
                        case 'w':
                        case 'x':
                        case 'y':
                        case 'z':
                            {
                                matchRange('a', 'z');
                                break;
                            }
                        case 'A':
                        case 'B':
                        case 'C':
                        case 'D':
                        case 'E':
                        case 'F':
                        case 'G':
                        case 'H':
                        case 'I':
                        case 'J':
                        case 'K':
                        case 'L':
                        case 'M':
                        case 'N':
                        case 'O':
                        case 'P':
                        case 'Q':
                        case 'R':
                        case 'S':
                        case 'T':
                        case 'U':
                        case 'V':
                        case 'W':
                        case 'X':
                        case 'Y':
                        case 'Z':
                            {
                                matchRange('A', 'Z');
                                break;
                            }
                        case '-':
                            {
                                match('-');
                                break;
                            }
                        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 '_':
                            {
                                match('_');
                                break;
                            }
                        default:
                            {
                                throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
                            }
                    }
                }
            } else {
                break _loop56;
            }
        } 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)

Example 50 with NoViableAltForCharException

use of antlr.NoViableAltForCharException in project jasn1 by openmuc.

the class ASNLexer method mHDIG.

protected final void mHDIG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = HDIG;
    int _saveIndex;
    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;
            }
        case 'a':
        case 'b':
        case 'c':
        case 'd':
        case 'e':
        case 'f':
            {
                {
                    matchRange('a', 'f');
                }
                break;
            }
        default:
            {
                throw new NoViableAltForCharException((char) 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)

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