All Packages Class Hierarchy This Package Previous Next Index
Class openjava.ptree.Leaf
java.lang.Object
|
+----openjava.ptree.PtreeObject
|
+----openjava.ptree.Leaf
- public class Leaf
- extends PtreeObject
- implements Ptree
The Leaf class is a token-node in the parse tree of OpenJava.
- See Also:
- Ptree, NonLeaf
-
charBegin
- charBegin is the number of the character at which this token is.
-
line
- line is the number of the line at which this token is.
-
Leaf(int, String)
- Allocates a new leaf(token) with its text.
-
Leaf(int, String, int, int)
- Allocates a new leaf(token) with its text and where this is.
-
Leaf(String)
- Allocates a new leaf(token) with its text.
-
equals(Ptree)
- Tests if the specified ptree-node equals to this leaf-node.
-
equals(String)
- Tests if the specified string equals to this leaf-node's text.
-
getTokenID()
- Returns the identifer-number of this token.
-
makeCopy()
- Makes a new copy of this leaf-node.
-
makeRecursiveCopy()
- Makes a new copy of this leaf-node.
-
toString()
- Overrides to return its text as the string of this instance.
-
writeCode()
- Writes the code of this token.
line
public int line
- line is the number of the line at which this token is.
charBegin
public int charBegin
- charBegin is the number of the character at which this token is.
Leaf
public Leaf(String str)
- Allocates a new leaf(token) with its text.
- Parameters:
- term_num - dummy parameter.
- str - its text.
Leaf
public Leaf(int term_num,
String str)
- Allocates a new leaf(token) with its text.
- Parameters:
- term_num - dummy parameter.
- str - its text.
Leaf
public Leaf(int term_num,
String str,
int line,
int charBegin)
- Allocates a new leaf(token) with its text and where this is.
- Parameters:
- term_num - dummy parameter.
- str - its text.
toString
public String toString()
- Overrides to return its text as the string of this instance.
- Returns:
- the text of this token.
- Overrides:
- toString in class PtreeObject
makeRecursiveCopy
public Ptree makeRecursiveCopy()
- Makes a new copy of this leaf-node.
This method equals to makeCopy().
- Returns:
- the copy of this nonleaf-node as a ptree-node.
- Overrides:
- makeRecursiveCopy in class PtreeObject
makeCopy
public Ptree makeCopy()
- Makes a new copy of this leaf-node.
- Returns:
- the copy of this nonleaf-node as a ptree-node.
- Overrides:
- makeCopy in class PtreeObject
equals
public boolean equals(Ptree p)
- Tests if the specified ptree-node equals to this leaf-node.
- Parameters:
- p - the ptree-node to be tested.
- Returns:
- true if p equals to this leaf-node
- Overrides:
- equals in class PtreeObject
equals
public boolean equals(String str)
- Tests if the specified string equals to this leaf-node's text.
- Parameters:
- p - the ptree-node to be tested.
- Returns:
- true if p equals to this leaf-node
getTokenID
public int getTokenID()
- Returns the identifer-number of this token.
- Returns:
- the identifer-number of this token.
writeCode
public void writeCode()
- Writes the code of this token.
- Returns:
- always true.
- Overrides:
- writeCode in class PtreeObject
All Packages Class Hierarchy This Package Previous Next Index