com.ibm.etools.cobol.application.model.cobol

Class CommentUtils

  • java.lang.Object
    • com.ibm.etools.cobol.application.model.cobol.CommentUtils


  • public class CommentUtils
    extends java.lang.Object
    Utilities for finding comments relative to nodes and nodes relative to comments.
    • Constructor Detail

      • CommentUtils

        public CommentUtils()
    • Method Detail

      • getContainedComments

        public static java.util.List<Comment> getContainedComments(ASTNode node)
        Returns a list of comments that are contained within the given node in the main source file. This method will not return comments located in copybooks. If no comments are contained within the given node, the method will return an empty list.
        Parameters:
        node -
        Returns:
      • getPrecedingComment

        public static Comment getPrecedingComment(ASTNode node)
        Finds a comment that precedes the given node in the main source file. The node may be a comment, and should be located in the main source file. Returns null if no comment precedes the given node, or if the given node is located in a copybook.
        Parameters:
        node -
        Returns:
      • getFollowingComment

        public static Comment getFollowingComment(ASTNode node)
        Finds a comment that follows the given node in the main source file. The node may be a comment, and should be located in the main source file. Returns null if no comment follows the given node, or if the given node is located in a copybook.
        Parameters:
        node -
        Returns:
      • getPrecedingNonComment

        public static ASTNode getPrecedingNonComment(Comment comment)
        Finds a non-comment that precedes the given comment in the main source file. Returns null if no node precedes the given node.
        Parameters:
        comment -
        Returns:
      • getFollowingNonComment

        public static ASTNode getFollowingNonComment(Comment comment)
        Finds a non-comment that follows the given comment in the main source file. Returns null if no node follows the given node.
        Parameters:
        comment -
        Returns: