All Packages Class Hierarchy This Package Previous Next Index
Class aioli.vtp.StringToTree
java.lang.Object
|
+----aioli.vtp.StringToTree
- public class StringToTree
- extends Object
A class that transform a string representing a tree, in a Vtp tree.
Example:
public static void main(String[] args) {
Formalism f=FManager.getFormalism("java");
Tree tree;
String tree1="none()";
String tree2="string \"exception : \"";
String tree3="identifier System";
String tree4="access(identifier System,identifier err)";
String tree5="variable_modifier_s[]";
String tree6="call(access(access(identifier System,identifier err),
identifier println),argument_s[
binary(string \"exception : \",plus(),identifier e)])";
StringToTree string2Tree = new StringToTree();
if ((tree=string2Tree.stringToTree(f, tree6))!=null) {
System.out.println(tree.toString());
string2Tree.stringToTree(f, tree.toString());
}
}
The string parsing is limited: no double quote "",...
Can parse tree with metavaribles.
-
StringToTree()
- The constructor.
-
buildTree(Formalism, String)
-
-
main(String[])
-
-
stringToTree(Formalism, String)
- Transforms a tree given in a String to a Vtp tree of the given formalism.
StringToTree
public StringToTree()
- The constructor.
stringToTree
public static Tree stringToTree(Formalism forma,
String str)
- Transforms a tree given in a String to a Vtp tree of the given formalism.
- Parameters:
- forma - The formalism the tree belongs to.
- str - The string to transform.
- Returns:
- a Tree.
buildTree
public static Tree buildTree(Formalism forma,
String str)
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index