|
Parser v2.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Parser.RETree
The RETree class represents a tree structure used to store strings as parsed useing a regular expression system.
Field Summary | |
java.util.LinkedList |
branches
The branching structure, linked list of Strings and RETrees. |
java.lang.reflect.Method |
codeGen
A method that can be used to generate code. |
java.lang.String |
type
A string describing the tree in terms of a grammar. |
Constructor Summary | |
RETree()
Empty constructor. |
|
RETree(java.util.LinkedList branches,
java.lang.String type)
Constructs a regular expression tree with specified branches and type. |
Method Summary | |
java.lang.String |
collapse()
Returns a string including all sub-strings using in-order traversal. |
java.lang.Object |
generateCode(java.lang.Object object,
java.lang.Object args)
A function used to accommodate automatic code generation. |
java.lang.Object |
get(int offset)
Gets an item from the branches of the RETree. |
java.lang.Object |
get(int[] offsets)
Gets an item from the branches of the RETree. |
int |
size()
Returns the string length of the collapsed tree. |
java.lang.String |
toString()
Returns a formatted string including all sub-strings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public java.util.LinkedList branches
public java.lang.String type
public java.lang.reflect.Method codeGen
Constructor Detail |
public RETree()
public RETree(java.util.LinkedList branches, java.lang.String type)
branches
- the branches of the tree (either String or LinkedList).type
- a description of the tree (i.e. the rule name).Method Detail |
public java.lang.Object generateCode(java.lang.Object object, java.lang.Object args) throws java.lang.Exception
public java.lang.Object get(int offset)
offset
- the position in the tree.public java.lang.Object get(int[] offsets)
offsets
- an array of offsets.public java.lang.String collapse()
public int size()
public java.lang.String toString()
English: [Noun: Person, Verb: plays]
toString
in class java.lang.Object
|
Parser v2.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |