All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.ptree.PtreeObject

java.lang.Object
   |
   +----openjava.ptree.PtreeObject

public abstract class PtreeObject
extends Object
implements Ptree
The Ptree class presents for the node of parse tree. This may be a token node, Leaf, or may be a nonterminal node, NonLeaf.

See Also:
Leaf, NonLeaf

Variable Index

 o debugFlag
to write debugging code
 o debugLevel
 o LN
Why this modifier is not final ? - Because of javac bug in excuting it with -O option.
 o out
this is used as like grobal variable in Ptree class-family.
 o writerStack
this is used as like grobal variable in Ptree class-family.

Constructor Index

 o PtreeObject()
Arrocates new parse-tree object and set identifier number on the object.

Method Index

 o eq(Ptree)
Tests if this parse-tree-node's value equals to the specified ptree-node's.
 o eq(Ptree, Ptree)
Return true if only they refer to the same object.
 o equal(Ptree, Ptree)
May return true if two ptree-nodes don't refer to not the same objects but their contents are equivalent.
 o equals(Ptree)
Tests if this parse-tree-node's value equals to the specified ptree-node's.
 o flushPrintWriter()
 o getDebugFlag()
 o getNest()
 o getObjectID()
Returns
 o getPrintWriter()
 o getTab()
 o makeCopy()
Makes a new copy of this ptree-node.
 o makeRecursiveCopy()
Makes a new copy (another object) of this nonleaf-node recursively.
 o popNest()
 o popPrintWriter()
 o pushNest()
 o pushPrintWriter(PrintWriter)
 o setDebugFlag(boolean)
 o setDebugLevel(int)
 o setNest(int)
 o setPrintStream(PrintStream)
Sets the writer to the one from the specified stream.
 o setTab(String)
 o toFlattenString()
 o toString()
Generates string which presents for this parse-tree
 o writeCode()
Writes a source code in the writer(stream).
 o writeDebug(String)
 o writeDebugL()
 o writeDebugLln()
 o writeDebugln()
 o writeDebugLR()
 o writeDebugR()
 o writeDebugRln()
 o writeTab()

Variables

 o LN
 protected static String LN
Why this modifier is not final ? - Because of javac bug in excuting it with -O option.

 o writerStack
 protected static WriterStack writerStack
this is used as like grobal variable in Ptree class-family.

 o out
 protected static PrintWriter out
this is used as like grobal variable in Ptree class-family.

 o debugFlag
 protected static boolean debugFlag
to write debugging code

 o debugLevel
 protected static int debugLevel

Constructors

 o PtreeObject
 public PtreeObject()
Arrocates new parse-tree object and set identifier number on the object.

Methods

 o makeCopy
 public abstract Ptree makeCopy()
Makes a new copy of this ptree-node.

Returns:
the copy of this ptree-node.
 o equals
 public abstract boolean equals(Ptree p)
Tests if this parse-tree-node's value equals to the specified ptree-node's.

Returns:
true if two values are same.
 o eq
 public final boolean eq(Ptree p)
Tests if this parse-tree-node's value equals to the specified ptree-node's.

Returns:
true if two this and p refer to the same ptree object.
 o toString
 public String toString()
Generates string which presents for this parse-tree

Returns:
string which presents for this parse-tree
Overrides:
toString in class Object
 o setPrintStream
 public static void setPrintStream(PrintStream pstream)
Sets the writer to the one from the specified stream.

Parameters:
pstrem - print stream
 o getPrintWriter
 public static PrintWriter getPrintWriter()
 o popPrintWriter
 public static PrintWriter popPrintWriter()
 o pushPrintWriter
 public static void pushPrintWriter(PrintWriter pw)
 o flushPrintWriter
 public static void flushPrintWriter()
 o setDebugFlag
 public static void setDebugFlag(boolean df)
 o setDebugLevel
 public static void setDebugLevel(int n)
 o getDebugFlag
 public static boolean getDebugFlag()
 o setTab
 public static void setTab(String str)
 o getTab
 public static String getTab()
 o setNest
 public static void setNest(int i)
 o getNest
 public static int getNest()
 o pushNest
 public static void pushNest()
 o popNest
 public static void popNest()
 o writeDebugL
 protected void writeDebugL()
 o writeDebugR
 protected static void writeDebugR()
 o writeDebugLR
 protected static void writeDebugLR()
 o writeDebugLln
 protected static void writeDebugLln()
 o writeDebugRln
 protected static void writeDebugRln()
 o writeDebugln
 protected static void writeDebugln()
 o writeDebug
 protected static void writeDebug(String str)
 o writeTab
 protected static void writeTab()
 o writeCode
 public abstract void writeCode()
Writes a source code in the writer(stream). This must be overridden.

 o eq
 public static final boolean eq(Ptree p,
                                Ptree q)
Return true if only they refer to the same object.

Parameters:
p - the ptree-node
q - the ptree-node
Returns:
true if p and q refer to same object.
 o equal
 public static final boolean equal(Ptree p,
                                   Ptree q)
May return true if two ptree-nodes don't refer to not the same objects but their contents are equivalent.

Parameters:
p - the node
q - the node to compare
Returns:
true if p equals c
 o getObjectID
 public final int getObjectID()
Returns

Parameters:
id - ID
Returns:
Name the ID represents
 o toFlattenString
 public String toFlattenString()

All Packages  Class Hierarchy  This Package  Previous  Next  Index