| java.lang.Object xtc.tree.Node
All known Subclasses: xtc.type.Type, xtc.parser.Module, xtc.tree.Annotation, xtc.tree.GNode, xtc.parser.ModuleList, xtc.tree.Attribute, xtc.tree.Token, xtc.parser.CharCase, xtc.parser.Grammar, xtc.parser.ModuleDependency, xtc.parser.Element, xtc.parser.Name, xtc.parser.Production, xtc.parser.CharRange,
Node | abstract public class Node (Code) | | A node in an abstract syntax tree or DAG.
author: Robert Grimm version: $Revision: 1.1 $ |
Constructor Summary | |
public | Node() Create a new node. | public | Node(Location location) Create a new node. |
Method Summary | |
public Object | accept(Visitor v) Accept the specified visitor.
Optionally, a visitor may return a value, thus making it
possible, for example, to replace nodes or to construct entirely
new trees. | public Object | getProperty(String name) Get a property value.
Parameters: name - The property name. | public boolean | hasProperty(String name) Test if this node has a property.
Parameters: name - The property name. | public Iterator | properties() Get an iterator over this node's property names. | public Object | removeProperty(String name) Remove a property.
Parameters: name - The property name. | public void | setLocation(String file, int line, int column) Set the location of this node to the specified values,
iff the location has not been set before. | public Object | setProperty(String name, Object value) Set the value of a property.
Parameters: name - The property name. Parameters: value - The new property value. |
Node | public Node()(Code) | | Create a new node.
|
Node | public Node(Location location)(Code) | | Create a new node.
Parameters: location - The source location for the new node. |
accept | public Object accept(Visitor v)(Code) | | Accept the specified visitor.
Optionally, a visitor may return a value, thus making it
possible, for example, to replace nodes or to construct entirely
new trees. If the specified visitor does not return a value, this
method returns null .
Parameters: v - The visitor. The (optional) return value. throws: VisitorException - Signals that the specified visitor does not have a matchingvisit() method. throws: VisitingException - Signals an exceptional condition while applying the specifiedvisitor on this node. |
getProperty | public Object getProperty(String name)(Code) | | Get a property value.
Parameters: name - The property name. The property's value or null if theproperty doesn't have a value. |
hasProperty | public boolean hasProperty(String name)(Code) | | Test if this node has a property.
Parameters: name - The property name. true if this node has a property with thespecified name. |
properties | public Iterator properties()(Code) | | Get an iterator over this node's property names.
An iterator over this node's property names. |
removeProperty | public Object removeProperty(String name)(Code) | | Remove a property.
Parameters: name - The property name. The property's old value or null if theproperty didn't have a value. |
setLocation | public void setLocation(String file, int line, int column)(Code) | | Set the location of this node to the specified values,
iff the location has not been set before.
Parameters: file - The file. Parameters: line - The line number. Parameters: column - The column number. |
setProperty | public Object setProperty(String name, Object value)(Code) | | Set the value of a property.
Parameters: name - The property name. Parameters: value - The new property value. The property's old value or null if theproperty didn't have a value. |
|
|