public abstract class Statement extends java.lang.Object implements IElement
Base class for AST elements that represent Statements.
NonStatement| Modifier and Type | Method and Description |
|---|---|
void |
attachTag(java.lang.String name,
java.lang.Object data)
Attach a tag to that element.
|
java.util.List<IElement> |
getSubElements()
Get the list of elements contained within this element.
|
boolean |
isCompound()
Determine if the statement is a compound statement.
|
boolean |
replaceSubElement(IElement old_elt,
IElement new_elt)
Replace an element by another element.
|
java.lang.Object |
retrieveTag(java.lang.String name)
Retrieve tag data by name.
|
public boolean isCompound()
Determine if the statement is a compound statement.
This is a convenience method that tests if the object derives from the Compound abstract class.
public java.util.List<IElement> getSubElements()
IElementGet the list of elements contained within this element.
Example: a Method contains a list of Definition to represent the method parameters, as well as a Block element to represent the method's body.
getSubElements in interface IElementpublic boolean replaceSubElement(IElement old_elt, IElement new_elt)
IElementReplace an element by another element. Be careful when using this method: no semantic checks are performed on the new and old elements, and the the AST can be corrupted.
replaceSubElement in interface IElementold_elt - the element to be replacednew_elt - the new elementpublic void attachTag(java.lang.String name,
java.lang.Object data)
IElementAttach a tag to that element.
public java.lang.Object retrieveTag(java.lang.String name)
IElementRetrieve tag data by name.
retrieveTag in interface IElementname - the tag name (can be null to retrieve the nameless tag)