|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--scale.common.Root
|
+--scale.clef.Node
|
+--scale.clef.decl.Declaration
This is the base class for declarations such as variable, routines, etc.
$Id: Declaration.java,v 1.66 2002/01/03 21:42:42 burrill Exp $
Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
| Field Summary | |
static java.lang.String[] |
accessibilities
The names of the accessibilities. |
static byte |
cAuto
Marks a data value as being locally allocated (i.e., on the stack). |
static byte |
cExtern
Indicates that an entity is defined external to this file scope. |
static byte |
cFile
Indicates that the entity is visible only within its file scope. |
static byte |
cGlobal
Indicates that an entity is defined in, and has global visibility outside, this file scope. |
static byte |
cLocal
Indicates that an entity is visible only within its current scope. |
static byte |
cMemory
Indicates that an entity is assigned to permanently allocated space. |
static byte |
cPrivate
Specifies that the method is accessible only within its namespace. |
static byte |
cProtected
Specifies than an identifier is accessible only within its namespace. |
static byte |
cPublic
Specifies that the method is accessible outside of its namespace. |
static byte |
cRegister
Recommends that a value be assigned to a register. |
static java.lang.String[] |
residencies
The names of the different residencies. |
static java.lang.String[] |
visibilitys
The names of the different visibilitys. |
| Fields inherited from interface scale.common.DisplayNode |
ANNO, CLEF, DD, DEFUSE, DOM, EXPR, MAYUSE, TYPE |
| Constructor Summary | |
protected |
Declaration(java.lang.String n)
Create a declaration with the specified name and no type. |
protected |
Declaration(java.lang.String name,
Type type)
Create a declaration with the specified name and type. |
| Method Summary | |
int |
accessibility()
Return the declaration accessibility. |
boolean |
addressTaken()
Return true if the address of this Declaration has been taken. |
java.lang.String |
DDname()
|
protected void |
finalize()
Keep the count of instances up-to-date. |
java.lang.Object |
getConstantValue()
Return the constant value of the expression. |
Type |
getCoreType()
Return the type of the Declaration without attributes. |
Declaration |
getDecl()
Retun any Declaration associated with this Node. |
java.lang.String |
getDisplayColorHint()
Return a String specifying the color to use for coloring this node in a graphical display. |
java.lang.String |
getDisplayShapeHint()
Return a String specifying a shape to use when drawing this node in a graphical display. |
java.lang.String |
getDisplayText()
Return a String suitable for labeling this node in a graphical display. |
java.lang.String |
getName()
Return the name of the Declaration. |
Node |
getParent()
Return my parent in the Clef tree if any |
SymtabScope |
getScope()
Return the symbol table scope in which the declaration was declared. |
Node |
getScopeNode()
Return the node which represents the clef scope node. |
int |
getTag()
Return the tag associated with this variable. |
Type |
getType()
Return the type of the Declaration. |
int |
hashCode()
Use the name of the routine instead of the address of the instance so things are more predictable. |
boolean |
inMemory()
Return true if this declaration is to be allocated to memory. |
boolean |
isFtnResultVar()
Return true if the declaration is declared as the result variable of a function. |
boolean |
isGlobal()
Return true if this declaration is globally visible. |
boolean |
isPure()
Return true if this declaration has a PureFunctionAnnotation of level PUREGV. |
boolean |
isReferenced()
Return true if the declaration is referenced somewhere in the Clef AST. |
boolean |
isTemporary()
Return true if the declaration is a temporary variable. |
boolean |
isVariable()
Return true if the declaration is a variable. |
boolean |
isVirtual()
Return true if the declaration is a virtual variable. |
static int |
number()
Return the current number of instances of this class. |
int |
residency()
Return the declaration residency. |
void |
setAccessibility(int accessibility)
Specify the accessibility of the declaration. |
void |
setAddressTaken()
Record that the address is used. |
protected void |
setChildParent(Vector v)
|
void |
setName(java.lang.String name)
Change the display name of the declaration. |
void |
setParent(Node s)
Specify the parent node of this node. |
void |
setReferenced()
Specify that the Declaration is referenced somewhere in the Clef AST. |
void |
setResidency(int residency)
Specify the residency of the declaration. |
void |
setScope(SymtabScope scope)
Specify the symbol table scope in which the declaration was declared. |
void |
setTag(int tag)
Set the tag for this variable. |
void |
setType(Type type)
Specify the type of this declaration. |
void |
setVisibility(int visibility)
Specify the visibility of the declaration. |
java.lang.String |
toStringSpecial()
Return any special information of a node that is not a child or annotation. |
int |
visibility()
Return the declaration visibility. |
void |
visit(Predicate p)
The visit() method is used to implement a visit 'pattern'. |
| Methods inherited from class scale.clef.Node |
createChildren, getChildren, setAnnotationLevel, setReportLevel, toString, toString, toStringChildren |
| Methods inherited from class scale.common.Root |
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final byte cLocal
public static final byte cFile
public static final byte cGlobal
public static final byte cExtern
public static final java.lang.String[] visibilitys
public static final byte cPublic
public static final byte cProtected
public static final byte cPrivate
public static final java.lang.String[] accessibilities
public static final byte cAuto
public static final byte cRegister
public static final byte cMemory
public static final java.lang.String[] residencies
| Constructor Detail |
protected Declaration(java.lang.String n)
protected Declaration(java.lang.String name,
Type type)
| Method Detail |
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable - [needs description]public static int number()
public int hashCode()
hashCode in class Rootpublic final void setScope(SymtabScope scope)
public final SymtabScope getScope()
public void setAccessibility(int accessibility)
accessibility - is the accessibility of the declarationcPublic,
cProtected,
cPrivatepublic int accessibility()
cPublic,
cProtected,
cPrivatepublic void setVisibility(int visibility)
visibility - is the visibility of the declarationcLocal,
cFile,
cGlobal,
cExternpublic int visibility()
cLocal,
cFile,
cGlobal,
cExternpublic void setResidency(int residency)
residency - is the residency of the declarationcAuto,
cRegister,
cMemorypublic int residency()
cAuto,
cRegister,
cMemorypublic void setAddressTaken()
public boolean addressTaken()
public final void setTag(int tag)
public final int getTag()
public final Node getParent()
getParent in class Nodescale.clef.Nodepublic Declaration getDecl()
NodegetDecl in class Nodepublic final void setParent(Node s)
setParent in class Nodep - my parent in the Clef treeprotected void setChildParent(Vector v)
public java.lang.String toStringSpecial()
RoottoStringSpecial in class Nodepublic java.lang.String getDisplayText()
getDisplayText in class Rootpublic java.lang.String getDisplayColorHint()
getDisplayColorHint in class Rootpublic java.lang.String getDisplayShapeHint()
getDisplayShapeHint in class Rootpublic void visit(Predicate p)
Nodevisit in class Nodepublic final java.lang.String getName()
public final Type getType()
getType in class Nodepublic final Type getCoreType()
getCoreType in class Nodescale.clef.NodeNode.getType(),
RefTypepublic Node getScopeNode()
public final void setName(java.lang.String name)
name - is the new name for the declarationpublic final void setType(Type type)
public java.lang.Object getConstantValue()
Latticepublic boolean isReferenced()
VariableDecl,
RoutineDeclpublic void setReferenced()
VariableDecl,
RoutineDeclpublic boolean isGlobal()
public boolean inMemory()
public boolean isTemporary()
public boolean isFtnResultVar()
public boolean isVariable()
public boolean isVirtual()
public java.lang.String DDname()
public boolean isPure()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||