|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag,
debugLevel,
LN,
out,
writerStack |
Constructor Summary | |
TypeName(java.lang.String typename)
Allocates a new object. |
|
TypeName(java.lang.String typename,
java.util.Hashtable suffixes)
Allocates a new object. |
|
TypeName(java.lang.String typename,
int n)
Allocates a new object. |
|
TypeName(java.lang.String typename,
int n,
java.util.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(java.lang.String dimstr)
|
static TypeName |
forOJClass(OJClass clazz)
|
int |
getDimension()
Gets array dimension of declarated type |
java.lang.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(java.lang.String name)
Sets the type name except array dimension of this type specifier. |
void |
setTypeName(java.lang.String typename)
Deprecated. |
static java.lang.String |
stringFromDimension(int dimension)
|
static int |
toDimension(java.lang.String typename)
|
void |
writeCode()
Writes the code this parse-tree presents for. |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept,
elementAt,
equals,
getComment,
getContents,
getLength,
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 |
Constructor Detail |
public TypeName(java.lang.String typename, int n, java.util.Hashtable suffixes)
public TypeName(java.lang.String typename, int n)
typename
- type namen
- array dimensionpublic TypeName(java.lang.String typename, java.util.Hashtable suffixes)
typename
- type namen
- array dimensionpublic TypeName(java.lang.String typename)
new TypeName( typename )
new TypeName( typename, 0 )
typename
- type nameMethod Detail |
public static TypeName forOJClass(OJClass clazz)
public ParseTree makeRecursiveCopy()
public ParseTree makeCopy()
public void writeCode()
public int getDimension()
public void setDimension(int n)
dim
- array dimensionpublic void addDimension(int n)
public void addDimension(java.lang.String dimstr)
public java.lang.String getName()
public void setTypeName(java.lang.String typename)
typename
- the type name to set.setName(String)
public void setName(java.lang.String name)
name
- the type name to set.public static java.lang.String stringFromDimension(int dimension)
public static int toDimension(java.lang.String typename)
public void accept(ParseTreeVisitor v) throws ParseTreeException
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.
visitor
- a visitor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |