|
|||||||||
| 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
|
+--scale.clef.decl.ValueDecl
|
+--scale.clef.decl.VariableDecl
This class declares a variable.
$Id: VariableDecl.java,v 1.47 2002/01/03 21:42:46 burrill Exp $
Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
| Fields inherited from class scale.clef.decl.Declaration |
accessibilities, cAuto, cExtern, cFile, cGlobal, cLocal, cMemory, cPrivate, cProtected, cPublic, cRegister, residencies, visibilitys |
| Fields inherited from interface scale.common.DisplayNode |
ANNO, CLEF, DD, DEFUSE, DOM, EXPR, MAYUSE, TYPE |
| Constructor Summary | |
VariableDecl(java.lang.String name,
Type type)
Create a variable declaration which doesn't have a default value. |
|
VariableDecl(java.lang.String name,
Type type,
Expression initialValue)
|
|
VariableDecl(Type type)
Create a variable declaration for a temporary variable. |
|
| Method Summary | |
boolean |
addressTaken()
Return true if the address of this Declaration has been taken. |
int |
alignment()
|
static int |
created()
Return the number of instances of this class created. |
void |
declareFtnResultVar()
Specify that the variable is declared as the result variable of a function. |
protected void |
finalize()
Keep the count of instances up-to-date. |
java.lang.Object |
getConstantValue()
Return the constant value of the expression. |
Expression |
getInitialValue()
|
VariableDecl |
getOriginal()
Return the variable that this variable was renamed from. |
boolean |
inMemory()
Return true if this declaration is to be allocated to memory. |
boolean |
isConst()
Return true if the declaration is a const variable. |
boolean |
isFormalArg()
Return true if this variable is an argument to the routine |
boolean |
isFtnResultVar()
Return true if the declaration is declared as the result variable of a function. |
boolean |
isReferenced()
Return true if the declaration is referenced somewhere in the Clef AST. |
boolean |
isStatic()
Return true if this declaration is static. |
boolean |
isTemporary()
Return true if the declaration is a temporary variable. |
boolean |
isVariable()
Return true if the declaration is a variable. |
boolean |
isVolatile()
Return true if the type specifies volatile. |
static int |
number()
Return the current number of instances of this class. |
int |
residency()
Return the declaration residency. |
void |
setAddressTaken()
Record that the address is used. |
void |
setAlignment(int alignment)
Specify the alignment of the declaration. |
void |
setInitialValue(Expression i)
|
void |
setReferenced()
Specify that the variable is referenced somewhere in the Clef AST. |
void |
setResidency(int residency)
Specify the residency of the declaration. |
void |
setTemporary()
Specify that the variable is a temporary variable. |
boolean |
shouldBeInRegister()
Return true if this variable should be allocated to a register. |
java.lang.String |
toStringSpecial()
Return any special information of a node that is not a child or annotation. |
void |
visit(Predicate p)
The visit() method is used to implement a visit 'pattern'. |
| Methods inherited from class scale.clef.decl.ValueDecl |
createChildren, getValue, setValue |
| Methods inherited from class scale.clef.decl.Declaration |
accessibility, DDname, getCoreType, getDecl, getDisplayColorHint, getDisplayShapeHint, getDisplayText, getName, getParent, getScope, getScopeNode, getTag, getType, hashCode, isGlobal, isPure, isVirtual, setAccessibility, setChildParent, setName, setParent, setScope, setTag, setType, setVisibility, visibility |
| Methods inherited from class scale.clef.Node |
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 |
| Constructor Detail |
public VariableDecl(java.lang.String name,
Type type,
Expression initialValue)
public VariableDecl(java.lang.String name,
Type type)
public VariableDecl(Type type)
| Method Detail |
protected void finalize()
throws java.lang.Throwable
finalize in class Declarationjava.lang.Throwable - [needs description]public static int number()
public static int created()
public void setResidency(int residency)
setResidency in class Declarationresidency - is the residency of the declarationDeclaration.cAuto,
Declaration.cRegister,
Declaration.cMemorypublic void setAlignment(int alignment)
alignment - is the alignment of the declarationpublic int alignment()
public int residency()
residency in class DeclarationDeclaration.cAuto,
Declaration.cRegister,
Declaration.cMemorypublic boolean inMemory()
inMemory in class Declarationpublic boolean isReferenced()
isReferenced in class Declarationscale.clef.decl.DeclarationVariableDecl,
RoutineDeclpublic void setReferenced()
setReferenced in class Declarationscale.clef.decl.DeclarationVariableDecl,
RoutineDeclpublic boolean isConst()
isConst in class ValueDeclscale.clef.decl.ValueDeclpublic boolean isVariable()
isVariable in class Declarationpublic boolean isFormalArg()
public boolean isTemporary()
isTemporary in class Declarationpublic void setTemporary()
public boolean isFtnResultVar()
isFtnResultVar in class Declarationpublic void declareFtnResultVar()
public void setAddressTaken()
setAddressTaken in class Declarationpublic boolean addressTaken()
addressTaken in class Declarationpublic boolean shouldBeInRegister()
public boolean isVolatile()
public void visit(Predicate p)
Nodevisit in class ValueDeclpublic final Expression getInitialValue()
public void setInitialValue(Expression i)
public java.lang.Object getConstantValue()
getConstantValue in class ValueDeclLatticepublic boolean isStatic()
public VariableDecl getOriginal()
public java.lang.String toStringSpecial()
RoottoStringSpecial in class Declaration
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||