public abstract class Statement extends java.lang.Object implements IElement
Base class for AST elements that represent Statement
s.
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()
IElement
Get 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 IElement
public boolean replaceSubElement(IElement old_elt, IElement new_elt)
IElement
Replace 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 IElement
old_elt
- the element to be replacednew_elt
- the new elementpublic void attachTag(java.lang.String name, java.lang.Object data)
IElement
Attach a tag to that element.
public java.lang.Object retrieveTag(java.lang.String name)
IElement
Retrieve tag data by name.
retrieveTag
in interface IElement
name
- the tag name (can be null to retrieve the nameless tag)