Package de.monticore.ast
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 Summary
Modifier and TypeMethodDescriptiondefault voidaccept(ITraverser visitor) voidadd_PostComment(int index, Comment postcomment) adds one comment to the postComment list at the position of the given indexbooleanadd_PostComment(Comment postcomment) Adds one new comment to the list of postCommentsvoidadd_PreComment(int index, Comment precomment) adds one comment to the preComment list at the position of the given indexbooleanadd_PreComment(Comment precomment) Adds one new comment to the list of preCommentsbooleanaddAll_PostComments(int index, Collection<Comment> postcomments) adds a list of comments to the postComment list at the position of the given indexbooleanaddAll_PostComments(Collection<Comment> postcomments) Adds a list of comments to the already existing postComment listbooleanaddAll_PreComments(int index, Collection<Comment> precomments) adds a list of comments to the preComment list at the position of the given indexbooleanaddAll_PreComments(Collection<Comment> precomments) Adds a list of comments to the already existing preComment listvoidClears the list of postComments, that only an empty list staysvoidClears the list of preComments, that only an empty list staysbooleancontains_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 notbooleancontains_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 notbooleancontainsAll_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 notbooleancontainsAll_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 notPerforms a deep clone of this ASTNode and all of its successorsdefault booleandeepEquals(Object o) Compare this object to another Object.default booleandeepEquals(Object o, boolean forceSameOrder) Compare this object to another Object.default booleanCompare this object to another Object.default booleandeepEqualsWithComments(Object o, boolean forceSameOrder) Compare this object to another Object.default booleanbooleanequals_PostComments(Object element) Returns true if the object equals the postComment list Returns false if the object and the postComment list are not equalbooleanequals_PreComments(Object element) Returns true if the object equals the preComment list Returns false if the object and the preComment list are not equaldefault booleandefault Valueevaluate(ModelInterpreter interpreter) voidforEach_PostComments(Consumer<? super Comment> action) Consumer is given that performs an action but does not return a valuevoidforEach_PreComments(Consumer<? super Comment> action) Consumer is given that performs an action but does not return a valueget_PostComment(int index) Returns one comment of the list from the position of the given indexreturns the complete postComments listget_PreComment(int index) Returns one comment of the list from the position of the given indexreturns the complete preComments listde.se_rwth.commons.SourcePositionReturns the end position of this ASTNodede.se_rwth.commons.SourcePositionReturns the start source position of this ASTNodeintReturns the hashCode of the postComment as an intintReturns the hashCode of the preComment as an intintindexOf_PostComment(Object element) Returns the index of the given element if this exists in the listintindexOf_PreComment(Object element) Returns the index of the given element if it exists in the listbooleanChecks if the list is empty, has no elements Returns true if the list is empty and false if it has elementsbooleanChecks if the list is empty, has no elements Returns true if the list is empty and false if it has elementsbooleanbooleanReturns the Iterator for the postComment listReturns the Iterator for the preComment listintlastIndexOf_PostComment(Object element) Returns the last index of the given element if this exists in the listintlastIndexOf_PreComment(Object element) Returns the last index of the given element if it exists in the listReturns the ListIterator of the postComment listlistIterator_PostComments(int index) returns a ListIterator of the type Comment for the postComment listReturns the ListIterator of the preComment listlistIterator_PreComments(int index) returns a ListIterator of the type Comment for the preComment listReturns the parallel Steam of the postComment listReturns the parallel Steam of the preComment listremove_PostComment(int index) Returns the new postComment list without the removed element at the given indexbooleanremove_PostComment(Object element) removes one given element from the list if this element is containedremove_PreComment(int index) Returns the new preComment list without the removed element at the given indexbooleanremove_PreComment(Object element) Removes one given element from the list if this element is containedbooleanremoveAll_PostComments(Collection<?> element) removes a collection of elements from the list if the elements are containedbooleanremoveAll_PreComments(Collection<?> element) Removes a collection of elements from the list if the elements are containedbooleanremoveIf_PostComment(Predicate<? super Comment> filter) removes if the comment if the postdicate is fulfilledbooleanremoveIf_PreComment(Predicate<? super Comment> filter) removes if the comment if the predicate is fulfilledvoidreplaceAll_PostComments(UnaryOperator<Comment> operator) replaces all postComments that fit to the given unaryOperatorvoidreplaceAll_PreComments(UnaryOperator<Comment> operator) replaces all preComments that fit to the given unaryOperatorbooleanretainAll_PostComments(Collection<?> element) Retrains a collection of elements from the list if the elements are containedbooleanretainAll_PreComments(Collection<?> element) Retrains a collection of elements from the list if the elements are containedset_PostComment(int index, Comment postcomment) sets the comment at the given index and returns that commentvoidset_PostCommentList(List<Comment> postComments) sets the complete list of postComments to the given postComment listset_PreComment(int index, Comment precomment) sets the comment at the given index and returns that commentvoidset_PreCommentList(List<Comment> preComments) sets the complete list of preComments to the given preComment listvoidset_SourcePositionEnd(de.se_rwth.commons.SourcePosition end) Sets the end position of this ASTNodevoidSets the optional end position of this ASTNode absentvoidset_SourcePositionStart(de.se_rwth.commons.SourcePosition start) Sets the start position of this ASTNodevoidSets the optional start position of this ASTNode absentintcounts the number of postComments in the postComment list and returns that number as an Intintcounts the number of preComments in the preComment list and returns that number as an Intvoidsort_PostComments(Comparator<? super Comment> comparator) sorts the postComment list through a given way of comparing through the comparatorvoidsort_PreComments(Comparator<? super Comment> comparator) sorts the preComment list through a given way of comparing through the comparatorReturns the Spliterator of the postComment listReturns the Spliterator of the preComment listReturns the Steam of the postComment listReturns the Steam of the preComment listsubList_PostComments(int start, int end) Returns the sub list form the postComment list form the start to the end index which are givensubList_PreComments(int start, int end) Returns the sub list form the preComment list form the start to the end index which are givenObject[]converts the commentlist into an array of the type Object and returns thar arrayComment[]toArray_PostComments(Comment[] array) Converts the list of postComments into an array of comments and returns that arrayObject[]converts the commentlist into an array of the type Object and returns thar arrayComment[]toArray_PreComments(Comment[] array) Converts the list of preComments into an array of comments and returns that array
-
Method Details
-
getEnclosingScope
IScope getEnclosingScope() -
equalAttributes
-
equalsWithComments
-
deepEquals
Compare this object to another Object. Do not take comments into account. This method returns the same value asdeepEquals(Object, boolean)method when using the default value for forceSameOrder of each Node. -
deepEqualsWithComments
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
Compare this object to another Object. Do not take comments into account.- Parameters:
o- the object to compare this node toforceSameOrder- consider the order in ancestor lists, even if these lists are of stereotype unordered in the grammar.- Returns:
- whether both objects deep-equal
-
deepEqualsWithComments
Compare this object to another Object. Take comments into account. This method returns the same value asdeepEqualsWithComments(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
Adds one new comment to the list of preComments- Parameters:
precomment- one comment- Returns:
- boolean
-
addAll_PreComments
Adds a list of comments to the already existing preComment list- Parameters:
precomments- a list of comments- Returns:
- boolean
-
contains_PreComment
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
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
Returns the Iterator for the preComment list- Returns:
- Iterator of comments to iterate over the preComment list
-
remove_PreComment
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
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
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
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
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
Returns the Steam of the preComment list- Returns:
- Steam of the preComment list
-
parallelStream_PreComments
Returns the parallel Steam of the preComment list- Returns:
- parallel Stream of the preComment list
-
forEach_PreComments
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
adds one comment to the preComment list at the position of the given index- Parameters:
index- of the existing list where it should be addedprecomment- the comment that is added to the existing list
-
addAll_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 addedprecomments- list that is added to the existing list
-
get_PreComment
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
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
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
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
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
Returns the sub list form the preComment list form the start to the end index which are given- Parameters:
start- index of the sublistend- index of the sublist- Returns:
- ListIterator which iterates over the list of preComments
-
replaceAll_PreComments
replaces all preComments that fit to the given unaryOperator- Parameters:
operator- that defines which preComments should be replaced
-
sort_PreComments
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
sets the complete list of preComments to the given preComment list- Parameters:
preComments- list that should be set
-
get_PreCommentList
returns the complete preComments list- Returns:
- List that is contained in the preComment list at the moment
-
listIterator_PreComments
returns a ListIterator of the type Comment for the preComment list- Parameters:
index- of the iterator- Returns:
- ListIterator of a special index
-
set_PreComment
sets the comment at the given index and returns that comment- Parameters:
index- where the comment should be added to the listprecomment- 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
Adds one new comment to the list of postComments- Parameters:
postcomment- one comment- Returns:
- boolean
-
addAll_PostComments
Adds a list of comments to the already existing postComment list- Parameters:
postcomments- a list of comments- Returns:
- boolean
-
contains_PostComment
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
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
Returns the Iterator for the postComment list- Returns:
- Iterator to iterate over the postComment list
-
remove_PostComment
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
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
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
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
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
Returns the Steam of the postComment list- Returns:
- Steam of the postComment list
-
parallelStream_PostComments
Returns the parallel Steam of the postComment list- Returns:
- Steam parallel Stream of the postComment list
-
forEach_PostComments
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
adds one comment to the postComment list at the position of the given index- Parameters:
index- of the existing list where it should be addedpostcomment- the comment that is added to the existing list
-
addAll_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 addedpostcomments- the comment list that is added to the existing list
-
get_PostComment
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
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
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
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
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
Returns the sub list form the postComment list form the start to the end index which are given- Parameters:
start- index of the sublistend- index of the sublist- Returns:
- ListIterator which iterates over the list of postComments
-
replaceAll_PostComments
replaces all postComments that fit to the given unaryOperator- Parameters:
operator- that defines which postComments should be replaced
-
sort_PostComments
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
sets the complete list of postComments to the given postComment list- Parameters:
postComments- list that should be set
-
get_PostCommentList
returns the complete postComments list- Returns:
- List that is contained in the postComment list at the moment
-
listIterator_PostComments
returns a ListIterator of the type Comment for the postComment list- Parameters:
index- of the iterator- Returns:
- ListIterator of a special index
-
set_PostComment
sets the comment at the given index and returns that comment- Parameters:
index- where the comment should be added to the listpostcomment- 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
-
evaluate
-