scale.clef.decl
Class ValueDecl

java.lang.Object
  |
  +--scale.common.Root
        |
        +--scale.clef.Node
              |
              +--scale.clef.decl.Declaration
                    |
                    +--scale.clef.decl.ValueDecl
All Implemented Interfaces:
AnnotationInterface, DisplayNode, java.io.Serializable
Direct Known Subclasses:
ConstantDecl, FieldDecl, VariableDecl

public abstract class ValueDecl
extends Declaration

This class represents a declaration that has an initial value.

$Id: ValueDecl.java,v 1.29 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.

See Also:
Serialized Form

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
protected ValueDecl(java.lang.String name, Type type, Expression initialValue)
          Create a ValueDecl with the specified name, type, and value.
 
Method Summary
protected  Vector createChildren()
          Create the list of children for the node - each node that has children must implement this method.
 java.lang.Object getConstantValue()
          Return the constant value of the expression.
 Expression getValue()
           
 boolean isConst()
           
 void setValue(Expression v)
           
 void visit(Predicate p)
          The visit() method is used to implement a visit 'pattern'.
 
Methods inherited from class scale.clef.decl.Declaration
accessibility, addressTaken, DDname, finalize, getCoreType, getDecl, getDisplayColorHint, getDisplayShapeHint, getDisplayText, getName, getParent, getScope, getScopeNode, getTag, getType, hashCode, inMemory, isFtnResultVar, isGlobal, isPure, isReferenced, isTemporary, isVariable, isVirtual, number, residency, setAccessibility, setAddressTaken, setChildParent, setName, setParent, setReferenced, setResidency, setScope, setTag, setType, setVisibility, toStringSpecial, 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

ValueDecl

protected ValueDecl(java.lang.String name,
                    Type type,
                    Expression initialValue)
Create a ValueDecl with the specified name, type, and value.
Method Detail

visit

public void visit(Predicate p)
Description copied from class: Node
The visit() method is used to implement a visit 'pattern'.
Overrides:
visit in class Declaration

getValue

public Expression getValue()

setValue

public void setValue(Expression v)

createChildren

protected Vector createChildren()
Description copied from class: Node
Create the list of children for the node - each node that has children must implement this method. However, use getChildren() to actually get the children.
Overrides:
createChildren in class Node
Following copied from class: scale.clef.Node
Returns:
the list of children

getConstantValue

public java.lang.Object getConstantValue()
Description copied from class: Declaration
Return the constant value of the expression.
Overrides:
getConstantValue in class Declaration
Returns:
the constant value of the expression
See Also:
Lattice

isConst

public boolean isConst()
Returns:
true if the declaration is constant.