Search in sources :

Example 1 with CommentInfo

use of lombok.javac.CommentInfo in project lombok by rzwitserloot.

the class CommentCollectingParser method compilationUnit.

@Override
public JCCompilationUnit compilationUnit() {
    JCCompilationUnit result = super.compilationUnit();
    if (lexer instanceof CommentCollectingScanner) {
        List<CommentInfo> comments = ((CommentCollectingScanner) lexer).getComments();
        JCCompilationUnit_comments.set(result, comments);
    }
    return result;
}
Also used : JCCompilationUnit(com.sun.tools.javac.tree.JCTree.JCCompilationUnit) CommentInfo(lombok.javac.CommentInfo)

Example 2 with CommentInfo

use of lombok.javac.CommentInfo in project lombok by rzwitserloot.

the class CommentCollectingScanner method processComment.

@Override
protected void processComment(CommentStyle style) {
    int prevEndPos = Math.max(prevEndPos(), endComment);
    int pos = pos();
    int endPos = endPos();
    endComment = endPos;
    String content = new String(getRawCharacters(pos, endPos));
    StartConnection start = determineStartConnection(prevEndPos, pos);
    EndConnection end = determineEndConnection(endPos);
    CommentInfo comment = new CommentInfo(prevEndPos, pos, endPos, content, start, end);
    comments.append(comment);
    super.processComment(style);
}
Also used : EndConnection(lombok.javac.CommentInfo.EndConnection) StartConnection(lombok.javac.CommentInfo.StartConnection) CommentInfo(lombok.javac.CommentInfo)

Example 3 with CommentInfo

use of lombok.javac.CommentInfo in project lombok by rzwitserloot.

the class CommentCollectingParser method parseCompilationUnit.

public JCCompilationUnit parseCompilationUnit() {
    JCCompilationUnit result = super.parseCompilationUnit();
    if (lexer instanceof CommentCollectingScanner) {
        List<CommentInfo> comments = ((CommentCollectingScanner) lexer).getComments();
        JCCompilationUnit_comments.set(result, comments);
    }
    return result;
}
Also used : JCCompilationUnit(com.sun.tools.javac.tree.JCTree.JCCompilationUnit) CommentInfo(lombok.javac.CommentInfo)

Example 4 with CommentInfo

use of lombok.javac.CommentInfo in project lombok by rzwitserloot.

the class CommentCollectingScanner method processComment.

@Override
protected void processComment(CommentStyle style) {
    int prevEndPos = Math.max(prevEndPos(), endComment);
    int pos = pos();
    int endPos = endPos();
    endComment = endPos;
    String content = new String(getRawCharacters(pos, endPos));
    StartConnection start = determineStartConnection(prevEndPos, pos);
    EndConnection end = determineEndConnection(endPos);
    CommentInfo comment = new CommentInfo(prevEndPos, pos, endPos, content, start, end);
    comments.append(comment);
    super.processComment(style);
}
Also used : EndConnection(lombok.javac.CommentInfo.EndConnection) StartConnection(lombok.javac.CommentInfo.StartConnection) CommentInfo(lombok.javac.CommentInfo)

Example 5 with CommentInfo

use of lombok.javac.CommentInfo in project lombok by rzwitserloot.

the class CommentCollectingParser method parseCompilationUnit.

public JCCompilationUnit parseCompilationUnit() {
    JCCompilationUnit result = super.parseCompilationUnit();
    if (lexer instanceof CommentCollectingScanner) {
        List<CommentInfo> comments = ((CommentCollectingScanner) lexer).getComments();
        JCCompilationUnit_comments.set(result, comments);
    }
    return result;
}
Also used : JCCompilationUnit(com.sun.tools.javac.tree.JCTree.JCCompilationUnit) CommentInfo(lombok.javac.CommentInfo)

Aggregations

CommentInfo (lombok.javac.CommentInfo)9 JCCompilationUnit (com.sun.tools.javac.tree.JCTree.JCCompilationUnit)3 EndConnection (lombok.javac.CommentInfo.EndConnection)3 StartConnection (lombok.javac.CommentInfo.StartConnection)3 JCTree (com.sun.tools.javac.tree.JCTree)1 ArrayList (java.util.ArrayList)1