Package com.asakusafw.utils.java.internal.parser.javadoc.ir

Examples of com.asakusafw.utils.java.internal.parser.javadoc.ir.JavadocToken


        list.trimToSize();
        return new DefaultJavadocScanner(list, text.length());
    }

    private static JavadocToken eof(int offset) {
        return new JavadocToken(JavadocTokenKind.EOF, "", offset); //$NON-NLS-1$
    }
View Full Code Here


    }

    @Override
    public JavadocToken nextToken() {
        int position = lookahead0(0);
        JavadocToken token = token(position);
        setIndex(position + 1);
        return token;
    }
View Full Code Here

    }

    @Override
    public JavadocToken lookahead(int offset) {
        int position = lookahead0(offset);
        JavadocToken token = token(position);
        return token;
    }
View Full Code Here

    }

    @Override
    public JavadocToken nextToken() {
        while (true) {
            JavadocToken token = scanner.lookahead(0);
            JavadocTokenKind kind = token.getKind();
            if (kind == JavadocTokenKind.LINE_BREAK) {
                int offset = JavadocScannerUtil.countUntilNextLineStart(scanner, 0);
                scanner.consume(offset);
            } else if (kind == JavadocTokenKind.WHITE_SPACES) {
                scanner.consume(1);
View Full Code Here

    }

    private void consumeIfTypeParameter(JavadocScanner scanner, ArrayList<IrDocFragment> fragments) {
        JavadocTokenStream stream = new DefaultJavadocTokenStream(scanner);
        stream.mark();
        JavadocToken first = stream.nextToken();
        if (first.getKind() != JavadocTokenKind.LESS) {
            stream.rewind();
            return;
        }
        JavadocToken second = stream.nextToken();
        if (second.getKind() != JavadocTokenKind.IDENTIFIER) {
            stream.rewind();
            return;
        }
        JavadocToken third = stream.nextToken();
        if (third.getKind() != JavadocTokenKind.GREATER) {
            stream.rewind();
            return;
        }

        stream.discard();

        IrDocText open = new IrDocText(first.getText());
        open.setLocation(first.getLocation());

        IrDocSimpleName name = new IrDocSimpleName(second.getText());
        name.setLocation(second.getLocation());

        IrDocText close = new IrDocText(third.getText());
        close.setLocation(third.getLocation());

        fragments.add(open);
        fragments.add(name);
        fragments.add(close);
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.utils.java.internal.parser.javadoc.ir.JavadocToken

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.