Package net.sf.jcontracts.antlr

Examples of net.sf.jcontracts.antlr.Token


        returnToken_ = token;
    }

    public final void mNOT_EQUAL(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match("!=");
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.NOT_EQUAL);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here


        returnToken_ = token;
    }

    public final void mNUM_INT(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        int tokenTypeId = JavaTokenTypes.NUM_INT;
        boolean isDecimal = false;
        switch (la_1)
        {
            case 46: // '.'
                match('.');
                tokenTypeId = JavaTokenTypes.DOT;
                if (la_1 >= '0' && la_1 <= '9')
                {
                    int _cnt = 0;
                    do
                    {
                        if (la_1 >= '0' && la_1 <= '9')
                        {
                            matchRange('0', '9');
                        }
                        else
                        {
                            if (_cnt < 1)
                            {
                                throw new ScannerException("no viable alt for char: " + LA(1), getLine());
                            }
                            break;
                        }
                        _cnt++;
                    }
                    while (true);
                    if (la_1 == 'E' || la_1 == 'e')
                    {
                        mEXPONENT(false);
                    }
                    if (TOKEN_SET_5.member(la_1))
                    {
                        mFLOAT_SUFFIX(false);
                    }
                    tokenTypeId = JavaTokenTypes.NUM_FLOAT;
                }
                break;

            case 48: // '0'
            case 49: // '1'
            case 50: // '2'
            case 51: // '3'
            case 52: // '4'
            case 53: // '5'
            case 54: // '6'
            case 55: // '7'
            case 56: // '8'
            case 57: // '9'
                switch (la_1)
                {
                    case 48: // '0'
                        match('0');
                        isDecimal = true;
                        switch (la_1)
                        {
                            case 88: // 'X'
                            case 120: // 'x'
                            {
                                switch (la_1)
                                {
                                    case 120: // 'x'
                                        match('x');
                                        break;

                                    case 88: // 'X'
                                        match('X');
                                        break;

                                    default:
                                        throw new ScannerException("no viable alt for char: " + LA(1), getLine());
                                }
                                int _cnt = 0;
                                do
                                {
                                    if (TOKEN_SET_6.member(la_1))
                                    {
                                        mHEX_DIGIT(false);
                                    }
                                    else
                                    {
                                        if (_cnt < 1)
                                        {
                                            throw new ScannerException("no viable alt for char: " + LA(1), getLine());
                                        }
                                        break;
                                    }
                                    _cnt++;
                                }
                                while (true);
                                break;
                            }

                            case 48: // '0'
                            case 49: // '1'
                            case 50: // '2'
                            case 51: // '3'
                            case 52: // '4'
                            case 53: // '5'
                            case 54: // '6'
                            case 55: // '7'
                            {
                                int _cnt = 0;
                                do
                                {
                                    if (la_1 >= '0' && la_1 <= '7')
                                    {
                                        matchRange('0', '7');
                                    }
                                    else
                                    {
                                        if (_cnt < 1)
                                        {
                                            throw new ScannerException("no viable alt for char: " + LA(1), getLine());
                                        }
                                        break;
                                    }
                                    _cnt++;
                                }
                                while (true);
                                break;
                            }
                        }
                        break;

                    case 49: // '1'
                    case 50: // '2'
                    case 51: // '3'
                    case 52: // '4'
                    case 53: // '5'
                    case 54: // '6'
                    case 55: // '7'
                    case 56: // '8'
                    case 57: // '9'
                        matchRange('1', '9');
                        while (la_1 >= '0' && la_1 <= '9')
                        {
                            matchRange('0', '9');
                        }
                        isDecimal = true;
                        break;

                    default:
                        throw new ScannerException("no viable alt for char: " + LA(1), getLine());
                }
                if (la_1 == 'L' || la_1 == 'l')
                {
                    switch (la_1)
                    {
                        case 108: // 'l'
                            match('l');
                            break;

                        case 76: // 'L'
                            match('L');
                            break;

                        default:
                            throw new ScannerException("no viable alt for char: " + LA(1), getLine());
                    }
                }
                else if (TOKEN_SET_7.member(la_1) && isDecimal)
                {
                    switch (la_1)
                    {
                        case 46: // '.'
                            match('.');
                            while (la_1 >= '0' && la_1 <= '9')
                            {
                                matchRange('0', '9');
                            }
                            if (la_1 == 'E' || la_1 == 'e')
                            {
                                mEXPONENT(false);
                            }
                            if (TOKEN_SET_5.member(la_1))
                            {
                                mFLOAT_SUFFIX(false);
                            }
                            break;

                        case 69: // 'E'
                        case 101: // 'e'
                            mEXPONENT(false);
                            if (TOKEN_SET_5.member(la_1))
                            {
                                mFLOAT_SUFFIX(false);
                            }
                            break;

                        case 68: // 'D'
                        case 70: // 'F'
                        case 100: // 'd'
                        case 102: // 'f'
                            mFLOAT_SUFFIX(false);
                            break;

                        default:
                            throw new ScannerException("no viable alt for char: " + LA(1), getLine());
                    }
                    tokenTypeId = JavaTokenTypes.NUM_FLOAT;
                }
                break;

            default:
                throw new ScannerException("no viable alt for char: " + LA(1), getLine());
        }
        if (mustCreateToken)
        {
            token = makeToken(tokenTypeId);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mPLUS(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match('+');
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.PLUS);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mPLUS_ASSIGN(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match("+=");
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.PLUS_ASSIGN);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mPREPROC_LINE(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match("#");
        while (TOKEN_SET_2.member(la_1))
        {
            matchNot('\n');
        }
        match('\n');
        newline();
        if (mustCreateToken)
        {
            token = makeToken(-1);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mQUESTION(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match('?');
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.QUESTION);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mRBRACK(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match(']');
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.RBRACK);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mRCURLY(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match('}');
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.RCURLY);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mRPAREN(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match(')');
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.RPAREN);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    public final void mSEMI(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match(';');
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.SEMI);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

TOP

Related Classes of net.sf.jcontracts.antlr.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.