grtree
Class TreeExpression
java.lang.Object
|
+--grtree.TreeExpression
- public class TreeExpression
- extends java.lang.Object
Here is a tree expression:
"[a # [[b # [[c # [[d # []]]],[e # []]]],[f # []],[g # [[h # []]]]]]"
It 'represents' the following tree:
a
/ | \
b f g
/ \ |
c e h
|
d
It is assuemed that some other program will correctly
generate the tree expression.
Method Summary |
private static java.lang.String |
findChildren(java.lang.String xpr)
Input "[root,[TE1,TE2,...,TEn###"
Return "TE1,TE2,...,TEn###"
where the TEk are (sub)tree expressions. |
private static java.lang.String |
findRoot(java.lang.String xpr)
Return the root name of a
tree expression. |
static void |
main(java.lang.String[] args)
|
static Tree |
toTree(java.lang.String treeExpression)
Return the Tree represented by this tree
expression. |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
TreeExpression
public TreeExpression()
findRoot
private static java.lang.String findRoot(java.lang.String xpr)
Return the root name of a
tree expression.
"[ # []]" --> ""
findChildren
private static java.lang.String findChildren(java.lang.String xpr)
Input "[root,[TE1,TE2,...,TEn###"
Return "TE1,TE2,...,TEn###"
where the TEk are (sub)tree expressions.
toTree
public static Tree toTree(java.lang.String treeExpression)
- Return the Tree represented by this tree
expression.
main
public static void main(java.lang.String[] args)