Class CommentsInserter


  • class CommentsInserter
    extends java.lang.Object
    Assigns comments to nodes of the AST.
    • Method Detail

      • insertComments

        private void insertComments​(CompilationUnit cu,
                                    java.util.TreeSet<Comment> comments)
        Comments are attributed to the thing they comment and are removed from the comments.
      • insertComments

        void insertComments​(Node node,
                            java.util.TreeSet<Comment> commentsToAttribute)
        This method try to attributes the nodes received to child of the node. It returns the node that were not attributed.
      • attributeLineCommentsOnSameLine

        private void attributeLineCommentsOnSameLine​(java.util.TreeSet<Comment> commentsToAttribute,
                                                     java.util.List<Node> children)
      • attributeLineCommentToNodeOrChild

        private boolean attributeLineCommentToNodeOrChild​(Node node,
                                                          LineComment lineComment)
      • thereAreLinesBetween

        private boolean thereAreLinesBetween​(Node a,
                                             Node b)