Package net.sf.jcontracts.antlr

Examples of net.sf.jcontracts.antlr.Token


        returnToken_ = token;
    }

    protected final void mDIGIT(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        matchRange('0', '9');
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.DIGIT);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here


        returnToken_ = token;
    }

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

        returnToken_ = token;
    }

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

        returnToken_ = token;
    }

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

        returnToken_ = token;
    }

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

        returnToken_ = token;
    }

    protected final void mESC(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match('\\');
        switch (la_1)
        {
            case 110: // 'n'
                match('n');
                break;

            case 114: // 'r'
                match('r');
                break;

            case 116: // 't'
                match('t');
                break;

            case 98: // 'b'
                match('b');
                break;

            case 102: // 'f'
                match('f');
                break;

            case 117: // 'u'
                match('u');
                mHEX_DIGIT(false);
                mHEX_DIGIT(false);
                mHEX_DIGIT(false);
                mHEX_DIGIT(false);
                break;

            case 34: // '"'
                match('"');
                break;

            case 39: // '\''
                match('\'');
                break;

            case 92: // '\\'
                match('\\');
                break;

            case 48: // '0'
            case 49: // '1'
            case 50: // '2'
            case 51: // '3'
                matchRange('0', '3');
                if (la_1 >= '0' && la_1 <= '9' && la_2 >= '\003' && la_2 <= '\377')
                {
                    mDIGIT(false);
                    if (la_1 >= '0' && la_1 <= '9' && la_2 >= '\003' && la_2 <= '\377')
                    {
                        mDIGIT(false);
                    }
                }
                break;

            case 52: // '4'
            case 53: // '5'
            case 54: // '6'
            case 55: // '7'
                matchRange('4', '7');
                if (la_1 >= '0' && la_1 <= '9' && la_2 >= '\003' && la_2 <= '\377')
                {
                    mDIGIT(false);
                }
                break;

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

        returnToken_ = token;
    }

    protected final void mEXPONENT(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        switch (la_1)
        {
            case 101: // 'e'
                match('e');
                break;

            case 69: // 'E'
                match('E');
                break;

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

            case 45: // '-'
                match('-');
                break;
        }
        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 (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.EXPONENT);
            token.setText(new String(text.getBuffer(), begin, text.length() - begin));
        }
        returnToken_ = token;
    }
View Full Code Here

        returnToken_ = token;
    }

    protected final void mFLOAT_SUFFIX(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        switch (la_1)
        {
            case 102: // 'f'
                match('f');
                break;

            case 70: // 'F'
                match('F');
                break;

            case 100: // 'd'
                match('d');
                break;

            case 68: // 'D'
                match('D');
                break;

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

        returnToken_ = token;
    }

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

        returnToken_ = token;
    }

    public final void mGT(boolean mustCreateToken) throws ScannerException
    {
        Token token = null;
        int begin = text.length();
        match(">");
        if (mustCreateToken)
        {
            token = makeToken(JavaTokenTypes.GT);
            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.