Interface ASTNode

All Known Subinterfaces:
IAttributeNegation, IAttributeOptional, IAttributePattern, IAttributeReplacement, IList, INegation, IOptional, IPattern, IReplacement, ITFAttribute, ITFElement, ITFObject
All Known Implementing Classes:
ASTCNode

public interface ASTNode
Foundation interface for all AST-classes
  • Method Details

    • getEnclosingScope

      IScope getEnclosingScope()
    • equalAttributes

      default boolean equalAttributes(Object o)
    • equalsWithComments

      default boolean equalsWithComments(Object o)
    • deepEquals

      default boolean deepEquals(Object o)
      Compare this object to another Object. Do not take comments into account. This method returns the same value as deepEquals(Object, boolean) method when using the default value for forceSameOrder of each Node.
    • deepEqualsWithComments

      default boolean deepEqualsWithComments(Object o)
      Compare this object to another Object. Take comments into account.
      Parameters:
      o - the object to compare this node to
      Returns:
      whether both objects deep-equal with comments
    • deepEquals

      default boolean deepEquals(Object o, boolean forceSameOrder)
      Compare this object to another Object. Do not take comments into account.
      Parameters:
      o - the object to compare this node to
      forceSameOrder - consider the order in ancestor lists, even if these lists are of stereotype unordered in the grammar.
      Returns:
      whether both objects deep-equal
    • deepEqualsWithComments

      default boolean deepEqualsWithComments(Object o, boolean forceSameOrder)
      Compare this object to another Object. Take comments into account. This method returns the same value as deepEqualsWithComments(Object, boolean) method when using the default value for forceSameOrder of each Node.
    • deepClone

      ASTNode deepClone()
      Performs a deep clone of this ASTNode and all of its successors
      Returns:
      Clone of current ASTNode with a parent which is equal to null
    • get_SourcePositionEnd

      de.se_rwth.commons.SourcePosition get_SourcePositionEnd()
      Returns the end position of this ASTNode
      Returns:
      end position of this ASTNode
    • set_SourcePositionEnd

      void set_SourcePositionEnd(de.se_rwth.commons.SourcePosition end)
      Sets the end position of this ASTNode
      Parameters:
      end - end position of this ASTNode
    • set_SourcePositionEndAbsent

      void set_SourcePositionEndAbsent()
      Sets the optional end position of this ASTNode absent
    • isPresent_SourcePositionEnd

      boolean isPresent_SourcePositionEnd()
      Returns:
      true if the optional source position end of this ASTNode is present
    • get_SourcePositionStart

      de.se_rwth.commons.SourcePosition get_SourcePositionStart()
      Returns the start source position of this ASTNode
      Returns:
      start position of this ASTNode
    • set_SourcePositionStart

      void set_SourcePositionStart(de.se_rwth.commons.SourcePosition start)
      Sets the start position of this ASTNode
      Parameters:
      start - start position of this ASTNode
    • set_SourcePositionStartAbsent

      void set_SourcePositionStartAbsent()
      Sets the optional start position of this ASTNode absent
    • isPresent_SourcePositionStart

      boolean isPresent_SourcePositionStart()
      Returns:
      true if the optional source position start of this ASTNode is present
    • clear_PreComments

      void clear_PreComments()
      Clears the list of preComments, that only an empty list stays
    • add_PreComment

      boolean add_PreComment(Comment precomment)
      Adds one new comment to the list of preComments
      Parameters:
      precomment - one comment
      Returns:
      boolean
    • addAll_PreComments

      boolean addAll_PreComments(Collection<Comment> precomments)
      Adds a list of comments to the already existing preComment list
      Parameters:
      precomments - a list of comments
      Returns:
      boolean
    • contains_PreComment

      boolean contains_PreComment(Object element)
      Checks if the list contains the given Object Returns true if the Object is contained in the list of comments and false if it is not
      Parameters:
      element - which should be contained in the comments
      Returns:
      boolean true if the list contains the Object
    • containsAll_PreComments

      boolean containsAll_PreComments(Collection<?> element)
      Checks if the list contains the given Collection of elements Returns true if the Collection is contained in the list of comments and false if it is not
      Parameters:
      element - collection which should be contained in the comment list
      Returns:
      boolean true if the list contains the Object
    • isEmpty_PreComments

      boolean isEmpty_PreComments()
      Checks if the list is empty, has no elements Returns true if the list is empty and false if it has elements
      Returns:
      boolean true if the list is empty
    • iterator_PreComments

      Iterator<Comment> iterator_PreComments()
      Returns the Iterator for the preComment list
      Returns:
      Iterator of comments to iterate over the preComment list
    • remove_PreComment

      boolean remove_PreComment(Object element)
      Removes one given element from the list if this element is contained
      Parameters:
      element - which should be removed if it is present
      Returns:
      boolean
    • removeAll_PreComments

      boolean removeAll_PreComments(Collection<?> element)
      Removes a collection of elements from the list if the elements are contained
      Parameters:
      element - collection which should be removed if they are present
      Returns:
      boolean
    • retainAll_PreComments

      boolean retainAll_PreComments(Collection<?> element)
      Retrains a collection of elements from the list if the elements are contained
      Parameters:
      element - collection which should be retrained if they are present
      Returns:
      boolean
    • size_PreComments

      int size_PreComments()
      counts the number of preComments in the preComment list and returns that number as an Int
      Returns:
      int the number of comments is returned
    • toArray_PreComments

      Comment[] toArray_PreComments(Comment[] array)
      Converts the list of preComments into an array of comments and returns that array
      Parameters:
      array - into which the comments should be added
      Returns:
      Comment[] array which contains all the comments
    • removeIf_PreComment

      boolean removeIf_PreComment(Predicate<? super Comment> filter)
      removes if the comment if the predicate is fulfilled
      Parameters:
      filter - which selects different comments
      Returns:
      boolean
    • spliterator_PreComments

      Spliterator<Comment> spliterator_PreComments()
      Returns the Spliterator of the preComment list
      Returns:
      Spliterator of the preComment list
    • stream_PreComments

      Stream<Comment> stream_PreComments()
      Returns the Steam of the preComment list
      Returns:
      Steam of the preComment list
    • parallelStream_PreComments

      Stream<Comment> parallelStream_PreComments()
      Returns the parallel Steam of the preComment list
      Returns:
      parallel Stream of the preComment list
    • forEach_PreComments

      void forEach_PreComments(Consumer<? super Comment> action)
      Consumer is given that performs an action but does not return a value
      Parameters:
      action - that does something but has no return value
    • add_PreComment

      void add_PreComment(int index, Comment precomment)
      adds one comment to the preComment list at the position of the given index
      Parameters:
      index - of the existing list where it should be added
      precomment - the comment that is added to the existing list
    • addAll_PreComments

      boolean addAll_PreComments(int index, Collection<Comment> precomments)
      adds a list of comments to the preComment list at the position of the given index
      Parameters:
      index - of the existing list where the new list should be added
      precomments - list that is added to the existing list
    • get_PreComment

      Comment get_PreComment(int index)
      Returns one comment of the list from the position of the given index
      Parameters:
      index - in the existing list where the comment should be returned
      Returns:
      Comment at the given index is returned
    • indexOf_PreComment

      int indexOf_PreComment(Object element)
      Returns the index of the given element if it exists in the list
      Parameters:
      element - of which the index in the comment list should be returned
      Returns:
      int index where the Object is found
    • lastIndexOf_PreComment

      int lastIndexOf_PreComment(Object element)
      Returns the last index of the given element if it exists in the list
      Parameters:
      element - of which the last index in the comment list should be returned
      Returns:
      int index where the Object is found latest
    • equals_PreComments

      boolean equals_PreComments(Object element)
      Returns true if the object equals the preComment list Returns false if the object and the preComment list are not equal
      Parameters:
      element - which should be equal to the preComment list
      Returns:
      boolean if the object an preComment list are equal or not
    • hashCode_PreComments

      int hashCode_PreComments()
      Returns the hashCode of the preComment as an int
      Returns:
      int the hashCode of the preComment
    • listIterator_PreComments

      ListIterator<Comment> listIterator_PreComments()
      Returns the ListIterator of the preComment list
      Returns:
      ListIterator which iterates over the list of preComments
    • remove_PreComment

      Comment remove_PreComment(int index)
      Returns the new preComment list without the removed element at the given index
      Parameters:
      index - where the element should be removed
      Returns:
      the Comment previously at the specified position
    • subList_PreComments

      List<Comment> subList_PreComments(int start, int end)
      Returns the sub list form the preComment list form the start to the end index which are given
      Parameters:
      start - index of the sublist
      end - index of the sublist
      Returns:
      ListIterator which iterates over the list of preComments
    • replaceAll_PreComments

      void replaceAll_PreComments(UnaryOperator<Comment> operator)
      replaces all preComments that fit to the given unaryOperator
      Parameters:
      operator - that defines which preComments should be replaced
    • sort_PreComments

      void sort_PreComments(Comparator<? super Comment> comparator)
      sorts the preComment list through a given way of comparing through the comparator
      Parameters:
      comparator - that defines in which way the preComments should be sorted
    • set_PreCommentList

      void set_PreCommentList(List<Comment> preComments)
      sets the complete list of preComments to the given preComment list
      Parameters:
      preComments - list that should be set
    • get_PreCommentList

      List<Comment> get_PreCommentList()
      returns the complete preComments list
      Returns:
      List that is contained in the preComment list at the moment
    • listIterator_PreComments

      ListIterator<Comment> listIterator_PreComments(int index)
      returns a ListIterator of the type Comment for the preComment list
      Parameters:
      index - of the iterator
      Returns:
      ListIterator of a special index
    • set_PreComment

      Comment set_PreComment(int index, Comment precomment)
      sets the comment at the given index and returns that comment
      Parameters:
      index - where the comment should be added to the list
      precomment - that should be added at the index
      Returns:
      Comment at a special index
    • toArray_PreComments

      Object[] toArray_PreComments()
      converts the commentlist into an array of the type Object and returns thar array
      Returns:
      an array of the type Object
    • clear_PostComments

      void clear_PostComments()
      Clears the list of postComments, that only an empty list stays
    • add_PostComment

      boolean add_PostComment(Comment postcomment)
      Adds one new comment to the list of postComments
      Parameters:
      postcomment - one comment
      Returns:
      boolean
    • addAll_PostComments

      boolean addAll_PostComments(Collection<Comment> postcomments)
      Adds a list of comments to the already existing postComment list
      Parameters:
      postcomments - a list of comments
      Returns:
      boolean
    • contains_PostComment

      boolean contains_PostComment(Object element)
      Checks if the list contains the given Object Returns true if the Object is contained in the list of comments and false if it is not
      Parameters:
      element - which should be contained in the comments
      Returns:
      boolean true if the list contains the Object
    • containsAll_PostComments

      boolean containsAll_PostComments(Collection<?> element)
      Checks if the list contains the given Collection of elements Returns true if the Collection is contained in the list of comments and false if it is not
      Parameters:
      element - collection of elements which should be contained in the comment list
      Returns:
      boolean true if the list contains the Object
    • isEmpty_PostComments

      boolean isEmpty_PostComments()
      Checks if the list is empty, has no elements Returns true if the list is empty and false if it has elements
      Returns:
      boolean true if the list is empty
    • iterator_PostComments

      Iterator<Comment> iterator_PostComments()
      Returns the Iterator for the postComment list
      Returns:
      Iterator to iterate over the postComment list
    • remove_PostComment

      boolean remove_PostComment(Object element)
      removes one given element from the list if this element is contained
      Parameters:
      element - which should be removed if it is postsent
      Returns:
      boolean
    • removeAll_PostComments

      boolean removeAll_PostComments(Collection<?> element)
      removes a collection of elements from the list if the elements are contained
      Parameters:
      element - collection which should be removed if they are postsent
      Returns:
      boolean true if the elements were postsent and are now removed
    • retainAll_PostComments

      boolean retainAll_PostComments(Collection<?> element)
      Retrains a collection of elements from the list if the elements are contained
      Parameters:
      element - collection which should be retrained if they are present
      Returns:
      boolean
    • size_PostComments

      int size_PostComments()
      counts the number of postComments in the postComment list and returns that number as an Int
      Returns:
      int the number of comments is returned
    • toArray_PostComments

      Comment[] toArray_PostComments(Comment[] array)
      Converts the list of postComments into an array of comments and returns that array
      Parameters:
      array - into which the comments should be added
      Returns:
      Comment[] array which contains all the comments
    • removeIf_PostComment

      boolean removeIf_PostComment(Predicate<? super Comment> filter)
      removes if the comment if the postdicate is fulfilled
      Parameters:
      filter - which selects different comments
      Returns:
      boolean
    • spliterator_PostComments

      Spliterator<Comment> spliterator_PostComments()
      Returns the Spliterator of the postComment list
      Returns:
      Spliterator of the postComment list
    • stream_PostComments

      Stream<Comment> stream_PostComments()
      Returns the Steam of the postComment list
      Returns:
      Steam of the postComment list
    • parallelStream_PostComments

      Stream<Comment> parallelStream_PostComments()
      Returns the parallel Steam of the postComment list
      Returns:
      Steam parallel Stream of the postComment list
    • forEach_PostComments

      void forEach_PostComments(Consumer<? super Comment> action)
      Consumer is given that performs an action but does not return a value
      Parameters:
      action - that does something but has no return value
    • add_PostComment

      void add_PostComment(int index, Comment postcomment)
      adds one comment to the postComment list at the position of the given index
      Parameters:
      index - of the existing list where it should be added
      postcomment - the comment that is added to the existing list
    • addAll_PostComments

      boolean addAll_PostComments(int index, Collection<Comment> postcomments)
      adds a list of comments to the postComment list at the position of the given index
      Parameters:
      index - of the existing list where the new list should be added
      postcomments - the comment list that is added to the existing list
    • get_PostComment

      Comment get_PostComment(int index)
      Returns one comment of the list from the position of the given index
      Parameters:
      index - of the existing list where the comment should be returned
      Returns:
      Comment at the given index is returned
    • indexOf_PostComment

      int indexOf_PostComment(Object element)
      Returns the index of the given element if this exists in the list
      Parameters:
      element - of which the index in the comment list should be returned
      Returns:
      int index where the Object is found
    • lastIndexOf_PostComment

      int lastIndexOf_PostComment(Object element)
      Returns the last index of the given element if this exists in the list
      Parameters:
      element - of which the last index in the comment list should be returned
      Returns:
      int index where the Object is found latest
    • equals_PostComments

      boolean equals_PostComments(Object element)
      Returns true if the object equals the postComment list Returns false if the object and the postComment list are not equal
      Parameters:
      element - which should be equal to the postComment list
      Returns:
      boolean if the object an postComment list are equal or not
    • hashCode_PostComments

      int hashCode_PostComments()
      Returns the hashCode of the postComment as an int
      Returns:
      int the hashCode of the postComment
    • listIterator_PostComments

      ListIterator<Comment> listIterator_PostComments()
      Returns the ListIterator of the postComment list
      Returns:
      ListIterator which iterates over the list of postComments
    • remove_PostComment

      Comment remove_PostComment(int index)
      Returns the new postComment list without the removed element at the given index
      Parameters:
      index - where the element should be removed
      Returns:
      List where the comment at the index is removed
    • subList_PostComments

      List<Comment> subList_PostComments(int start, int end)
      Returns the sub list form the postComment list form the start to the end index which are given
      Parameters:
      start - index of the sublist
      end - index of the sublist
      Returns:
      ListIterator which iterates over the list of postComments
    • replaceAll_PostComments

      void replaceAll_PostComments(UnaryOperator<Comment> operator)
      replaces all postComments that fit to the given unaryOperator
      Parameters:
      operator - that defines which postComments should be replaced
    • sort_PostComments

      void sort_PostComments(Comparator<? super Comment> comparator)
      sorts the postComment list through a given way of comparing through the comparator
      Parameters:
      comparator - that defines in which way the postComments should be sorted
    • set_PostCommentList

      void set_PostCommentList(List<Comment> postComments)
      sets the complete list of postComments to the given postComment list
      Parameters:
      postComments - list that should be set
    • get_PostCommentList

      List<Comment> get_PostCommentList()
      returns the complete postComments list
      Returns:
      List that is contained in the postComment list at the moment
    • listIterator_PostComments

      ListIterator<Comment> listIterator_PostComments(int index)
      returns a ListIterator of the type Comment for the postComment list
      Parameters:
      index - of the iterator
      Returns:
      ListIterator of a special index
    • set_PostComment

      Comment set_PostComment(int index, Comment postcomment)
      sets the comment at the given index and returns that comment
      Parameters:
      index - where the comment should be added to the list
      postcomment - that should be added at the index
      Returns:
      Comment at a special index
    • toArray_PostComments

      Object[] toArray_PostComments()
      converts the commentlist into an array of the type Object and returns thar array
      Returns:
      an array of the type Object
    • accept

      default void accept(ITraverser visitor)
    • evaluate

      default Value evaluate(ModelInterpreter interpreter)