|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.ParseTreeObject | +--openjava.ptree.NonLeaf | +--openjava.ptree.TypeName
The TypeName
class represents a type specifier
node of parse tree.
ParseTree
,
NonLeaf
Field Summary | |
(package private) int |
dim
|
(package private) Hashtable |
suffixes
|
Fields inherited from class openjava.ptree.NonLeaf |
|
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag, debugLevel, LN, out, writerStack |
Constructor Summary | |
(package private) |
TypeName()
|
|
TypeName(String typename)
Allocates a new object. |
|
TypeName(String typename,
Hashtable suffixes)
Allocates a new object. |
|
TypeName(String typename,
int n)
Allocates a new object. |
|
TypeName(String typename,
int n,
Hashtable suffixes)
|
Method Summary | |
void |
accept(ParseTreeVisitor v)
Accepts a ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern. |
void |
addDimension(int n)
|
void |
addDimension(String dimstr)
|
static TypeName |
forClass(Class clazz)
|
static TypeName |
forOJClass(OJClass clazz)
|
int |
getDimension()
Gets array dimension of declarated type |
String |
getName()
Gets the type name of this type specifier. |
ParseTree |
makeCopy()
Makes a new copy of this nonleaf-node as a ptree-node. |
ParseTree |
makeRecursiveCopy()
Makes a new copy (another object) of this nonleaf-node recursively. |
void |
setDimension(int n)
Sets array dimension of declarated type |
void |
setName(String name)
Sets the type name except array dimension of this type specifier. |
void |
setTypeName(String typename)
Deprecated. |
static String |
stringFromDimension(int dimension)
|
static int |
toDimension(String typename)
|
void |
writeCode()
Writes the code this parse-tree presents for. |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept, childrenAreEqual, elementAt, equals, getComment, getContents, getLength, getRowType, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt |
Methods inherited from class openjava.ptree.ParseTreeObject |
clone, eq, eq, equal, flushPrintWriter, getDebugFlag, getNest, getObjectID, getParent, getPrintWriter, getTab, hashCode, lastObjectID, popNest, popPrintWriter, pushNest, pushPrintWriter, replace, setDebugFlag, setDebugLevel, setNest, setParent, setPrintStream, setTab, toFlattenString, toString, writeDebug, writeDebugL, writeDebugLln, writeDebugln, writeDebugLR, writeDebugR, writeDebugRln, writeTab |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface openjava.ptree.ParseTree |
eq, getObjectID, replace, toFlattenString, toString |
Field Detail |
Hashtable suffixes
int dim
Constructor Detail |
public TypeName(String typename, int n, Hashtable suffixes)
public TypeName(String typename, int n)
typename
- type namen
- array dimensionpublic TypeName(String typename, Hashtable suffixes)
typename
- type namepublic TypeName(String typename)
new TypeName( typename )
new TypeName( typename, 0 )
typename
- type nameTypeName()
Method Detail |
public static TypeName forOJClass(OJClass clazz)
public static TypeName forClass(Class clazz)
public ParseTree makeRecursiveCopy()
NonLeaf
makeRecursiveCopy
in interface ParseTree
makeRecursiveCopy
in class NonLeaf
public ParseTree makeCopy()
ParseTree
makeCopy
in interface ParseTree
makeCopy
in class ParseTreeObject
public void writeCode()
NonLeaf
writeCode
in interface ParseTree
writeCode
in class NonLeaf
public int getDimension()
public void setDimension(int n)
public void addDimension(int n)
public void addDimension(String dimstr)
public String getName()
public void setTypeName(String typename)
typename
- the type name to set.setName(String)
public void setName(String name)
name
- the type name to set.public static String stringFromDimension(int dimension)
public static int toDimension(String typename)
public void accept(ParseTreeVisitor v) throws ParseTreeException
ParseTree
ParseTreeVisitor
object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit()
method on the
accepted visitor.
accept
in interface ParseTree
accept
in class ParseTreeObject
v
- a visitor
ParseTreeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |