Package com.pogofish.jadt.comments.javacc.generated

Examples of com.pogofish.jadt.comments.javacc.generated.Token


   
    @Test
    public void testLookahead() {
        // to get coverage of the null case in lookahead
        final JavaDocParserImpl impl = new JavaDocParserImpl(new StringReader("foo1 foo2"));
        impl.token = new Token(0, "bar1");
        final Token token1 = impl.lookahead();
        assertEquals("foo1", token1.image);
       
        // to get coverage of the non-null case in lookahead
        impl.token = new Token(0, "bar");
        impl.token.next = new Token(0, "bar2");
        final Token token2 = impl.lookahead();
        assertEquals("bar2", token2.image);     
    }
View Full Code Here


   
    /**
     * look ahead 1 token
     */
    public Token lookahead() {
        Token current = token;
        if (current.next == null) {
            current.next = token_source.getNextToken();
        }
        return current.next;
    }
View Full Code Here

    /**
     * Return the whitespace attached to the next token
     */
    @Override
    protected List<JDToken> nextTokenWhitespace() {
        final Token next = lookahead();
        return whiteSpace(next);
    }
View Full Code Here

    /**
     * Return all the comments attached to the specified token
     */
    protected List<JDToken> whiteSpace(Token token) {
        final List<JDToken> wss = new ArrayList<JDToken>();
        Token ws = token.specialToken;
        while(ws != null) {
            switch(ws.kind) {
            case WS:
                wss.add(_JDWhiteSpace(ws.image));
                break;
View Full Code Here

TOP

Related Classes of com.pogofish.jadt.comments.javacc.generated.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.