Search in sources :

Example 21 with Token

use of antlr.Token in project cxf by apache.

the class IDLLexer method mRSHIFT.

public final void mRSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = RSHIFT;
    int _saveIndex;
    match(">>");
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Example 22 with Token

use of antlr.Token in project cxf by apache.

the class IDLLexer method mRCURLY.

public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = RCURLY;
    int _saveIndex;
    match('}');
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Example 23 with Token

use of antlr.Token in project cxf by apache.

the class IDLLexer method mOCTAL.

public final void mOCTAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = OCTAL;
    int _saveIndex;
    match('0');
    {
        switch(LA(1)) {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                {
                    {
                        int _cnt383 = 0;
                        _loop383: do {
                            if (((LA(1) >= '0' && LA(1) <= '9'))) {
                                mDIGIT(false);
                            } else {
                                if (_cnt383 >= 1) {
                                    break _loop383;
                                }
                                throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
                            }
                            _cnt383++;
                        } while (true);
                    }
                    break;
                }
            case '.':
                {
                    mFLOAT(false);
                    _ttype = FLOAT;
                    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:
                {
                    _ttype = INT;
                }
        }
    }
    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 24 with Token

use of antlr.Token in project cxf by apache.

the class IDLLexer method mHEX.

public final void mHEX(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = HEX;
    int _saveIndex;
    {
        if ((LA(1) == '0') && (LA(2) == 'x')) {
            match("0x");
        } else if ((LA(1) == '0') && (LA(2) == 'X')) {
            match("0X");
        } else {
            throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
        }
    }
    {
        int _cnt361 = 0;
        _loop361: do {
            if ((_tokenSet_6.member(LA(1)))) {
                mHEXDIGIT(false);
            } else {
                if (_cnt361 >= 1) {
                    break _loop361;
                }
                throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
            }
            _cnt361++;
        } 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 25 with Token

use of antlr.Token in project cxf by apache.

the class IDLLexer method mTILDE.

public final void mTILDE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
    int _ttype;
    Token _token = null;
    int _begin = text.length();
    _ttype = TILDE;
    int _saveIndex;
    match('~');
    if (_createToken && _token == null && _ttype != Token.SKIP) {
        _token = makeToken(_ttype);
        _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
    }
    _returnToken = _token;
}
Also used : Token(antlr.Token) CommonToken(antlr.CommonToken) ANTLRHashString(antlr.ANTLRHashString)

Aggregations

Token (antlr.Token)75 CommonToken (antlr.CommonToken)66 ANTLRHashString (antlr.ANTLRHashString)64 NoViableAltForCharException (antlr.NoViableAltForCharException)18 RecognitionException (antlr.RecognitionException)3 CharStreamException (antlr.CharStreamException)2 CharStreamIOException (antlr.CharStreamIOException)2 TokenStreamException (antlr.TokenStreamException)2 TokenStreamIOException (antlr.TokenStreamIOException)2 TokenStreamRecognitionException (antlr.TokenStreamRecognitionException)2 AST (antlr.collections.AST)2 Constructor (java.lang.reflect.Constructor)2 GroovyLexer (org.codehaus.groovy.antlr.parser.GroovyLexer)2 GroovyRecognizer (org.codehaus.groovy.antlr.parser.GroovyRecognizer)2 ASTPair (antlr.ASTPair)1 CharScanner (antlr.CharScanner)1 NoViableAltException (antlr.NoViableAltException)1 BadLocationException (javax.swing.text.BadLocationException)1