A generic node in an abstract syntax tree.
A note on memory conservation: Generic nodes created through the {@link #create(String)} or {@link #create(String,int)} methodscan have a variable number of children. While such nodes provide considerable flexibility in creating and managing an abstract syntax tree, their implementation also has a relatively high memory and thus performance overhead. Consequently, this class provides another set of
create()
methods, which directly take the new node's children as arguments and return nodes specialized for that number of children. After creation, the number of children cannot be changed anymore. Code using generic nodes can test whether a node supports a variable number of children through {@link #hasVariable()} and convert fixed size nodes into variablesized nodes through {@link #ensureVariable(GNode)}.
@author Robert Grimm
@version $Revision: 1.48 $