|
|||||||||
| 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
|
+--scale.clef.decl.EquivalenceDecl
This class declares a variable that is equivalenced to an offset in another variable.
$Id: EquivalenceDecl.java,v 1.19 2002/01/03 21:42:43 burrill Exp $
Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This class declares a variable that is equivalenced to an offset in another variable. An equivalence relationship is generated for Fortran EQUIVALENCE statements and COMMON statements. For the statement
EQUIVALENCE A, Bthe base variable would be A with a offset of zero. For the statement
EQUIVALENCE A(20), Bthe base variable would be A with a offset of 20*sizeof(double).
Note - an EquivalenceDecl specifies an implied equivalence for COMMON variables.
| 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 | |
EquivalenceDecl(java.lang.String name,
Type type,
VariableDecl base,
long offset)
|
|
| Method Summary | |
VariableDecl |
copy(java.lang.String name)
Make a copy of this VariableDecl using a new name. |
protected Vector |
createChildren()
Create the list of children for the node - each node that has children must implement this method. |
long |
getBaseOffset()
Return the offset from the base (i.e. |
VariableDecl |
getBaseVariable()
Return the base variable (i.e. |
java.lang.Object |
getConstantValue()
Return the constant value of the expression. |
Expression |
getValue()
Return null - initializers are specified only for the base VariableDecl. |
boolean |
inMemory()
Return true if this declaration is to be allocated to memory. |
boolean |
isGlobal()
Return true if this declaration is globally visible. |
int |
residency()
Return the declaration residency. |
void |
setBaseOffset(long offset)
|
void |
setBaseVariable(VariableDecl base)
|
void |
setInitialValue(Expression i)
|
void |
setResidency(int residency)
Generate an error - residency is specified only for the base VariableDecl. |
void |
setValue(Expression value)
Generate an error if the value is not null - initializers are specified only for the base VariableDecl. |
void |
setVisibility(int visibility)
Generate an error - visibility is specified only for the base VariableDecl. |
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.decl.VariableDecl |
addressTaken, alignment, created, declareFtnResultVar, finalize, getInitialValue, getOriginal, isConst, isFormalArg, isFtnResultVar, isReferenced, isStatic, isTemporary, isVariable, isVolatile, number, setAddressTaken, setAlignment, setReferenced, setTemporary, shouldBeInRegister, toStringSpecial |
| Methods inherited from class scale.clef.decl.Declaration |
accessibility, DDname, getCoreType, getDecl, getDisplayColorHint, getDisplayShapeHint, getDisplayText, getName, getParent, getScope, getScopeNode, getTag, getType, hashCode, isPure, isVirtual, setAccessibility, setChildParent, setName, setParent, setScope, setTag, setType |
| 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 EquivalenceDecl(java.lang.String name,
Type type,
VariableDecl base,
long offset)
name - - name of the variabletype - - type of the variablebase - - VariableDecl representing the base variable (COMMONM area) in the equivalence relationshipoffset - - offset of this variable in bytes into the base variable| Method Detail |
public VariableDecl copy(java.lang.String name)
public void visit(Predicate p)
Nodevisit in class VariableDeclpublic final void setInitialValue(Expression i)
setInitialValue in class VariableDeclpublic final VariableDecl getBaseVariable()
public final void setBaseVariable(VariableDecl base)
public final long getBaseOffset()
public final void setBaseOffset(long offset)
public void setResidency(int residency)
setResidency in class VariableDeclresidency - is the residency of the declarationDeclaration.cAuto,
Declaration.cRegister,
Declaration.cMemorypublic int residency()
residency in class VariableDeclDeclaration.cAuto,
Declaration.cRegister,
Declaration.cMemorypublic boolean inMemory()
inMemory in class VariableDeclpublic final Expression getValue()
getValue in class ValueDeclpublic void setValue(Expression value)
setValue in class ValueDeclpublic void setVisibility(int visibility)
setVisibility in class Declarationvisibility - is the visibility of the declarationDeclaration.cLocal,
Declaration.cFile,
Declaration.cGlobal,
Declaration.cExternpublic int visibility()
visibility in class DeclarationDeclaration.cLocal,
Declaration.cFile,
Declaration.cGlobal,
Declaration.cExternpublic boolean isGlobal()
isGlobal in class Declarationpublic java.lang.Object getConstantValue()
getConstantValue in class VariableDeclLatticeprotected Vector createChildren()
NodecreateChildren in class ValueDeclscale.clef.Node
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||