|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xrel.analyzer.BinaryTree
Transformes a generic syntax tree in a binary tree.
To do this it simply processes the lists of children of the tags Comma and Par. For example Comma[a[],b[],c[]] becomes Comma[a[],Comma[b[],c[]]].
N.B.: this is a static class so you will never need to allocate an object for this class.
Fields inherited from interface xrel.parser.XRelParserTreeConstants |
JJTAS, JJTCASE, JJTCOMMA, JJTEMPTY, JJTEXPORTTP, JJTIDENTIFIER, JJTIMPORTST, jjtNodeName, JJTOPERATOR, JJTPAR, JJTPROGRAM, JJTSTATEMENTLIST, JJTSTRING, JJTSTRINGLITERAL, JJTSWITCHCASE, JJTTAG, JJTTYPEDECL, JJTVOID |
Constructor Summary | |
BinaryTree()
|
Method Summary | |
static void |
convert(SimpleNode node)
The entry point of the class. |
static void |
removeGroundTypes(SimpleNode node)
Replaces ground types (String and literal strings) with pseudo-labels. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BinaryTree()
Method Detail |
public static void convert(SimpleNode node)
The entry point of the class. It converts from a syntax a-rity tree to a binary tree. See the class description for additional information.
Warning! don't execute it on a null pointer
node
- the root node of the subtreepublic static void removeGroundTypes(SimpleNode node)
Replaces ground types (String and literal strings) with pseudo-labels.
The name chosen are __String__[] for String and __".."__ for string literals. Note that initial underscore grants that it's impossibile to have name conflicts with normal labels, as labels need to be identifiers.
node
- the root node of an expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |