scale.clef.type
Class IncompleteType

java.lang.Object
  |
  +--scale.common.Root
        |
        +--scale.clef.Node
              |
              +--scale.clef.type.Type
                    |
                    +--scale.clef.type.IncompleteType
All Implemented Interfaces:
AnnotationInterface, DisplayNode, java.io.Serializable

public class IncompleteType
extends Type

An IncompleteType is used to represent a type before the complete type is known.

$Id: IncompleteType.java,v 1.42 2002/01/03 21:44:12 burrill Exp $

Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

For example, when creating a struct type in C, a field of the struct may reference itself.

See Also:
Serialized Form

Fields inherited from interface scale.common.DisplayNode
ANNO, CLEF, DD, DEFUSE, DOM, EXPR, MAYUSE, TYPE
 
Constructor Summary
IncompleteType()
           
 
Method Summary
 int alignment(Machine machine)
          Calculate the alignment needed for this data type.
protected  Vector createChildren()
          Create the list of children for the node - each node that has children must implement this method.
 boolean equivalent(Type t)
          Return true if the types are equivalent.
protected  void finalize()
          Keep the count of instances up-to-date.
 Type getCompleteType()
          Return the completed type or null if it is not complete.
 Type getCoreType()
          This method filters out some the special case type nodes from a type DAG.
 Declaration getDecl()
          Return the TypeDecl or TypeName of this type reference.
 boolean isAddressType()
          Return true if type represents the address of something.
 boolean isAggregateType()
          Return true if type represents an aggregate object.
 boolean isArrayType()
          Return true if type represents an array.
 boolean isAtomicType()
          Return true if type represents a scaler value.
 boolean isAttributeSet(int attribute)
          Return true if the attribute is associated with this type.
 boolean isComplexType()
          Return true if type represents a complex value.
 boolean isCompositeType()
          Return true if type represents a composite type.
 boolean isConst()
          Return true if the type specifies const.
 boolean isIntegerType()
          Return true if type represents an integer value.
 boolean isNamedType()
          Return true if this type has an associated TypeName or TypeDecl.
 boolean isNumericType()
          Return true if type represents a numeric value.
 boolean isPointerType()
          Return true if type represents an address.
 boolean isRealType()
          Return true if type represents a floating point value.
 boolean isSigned()
          Return true is the type is signed.
 boolean isVoidType()
          Return true if type represents no type.
 boolean isVolatile()
          Return true if the type specifies volatile.
 int memorySize(Machine machine)
          Calculate how many addressable memory units are needed to represent the type.
static int number()
          Return the current number of instances of this class.
 void setCompleteType(Type type)
           
 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.type.Type
getDisplayColorHint, getDisplayShapeHint, getDisplayText, getPointedTo, getTag, getType, nextVisit, setTag, setVisited, toString, toStringShort, visited
 
Methods inherited from class scale.clef.Node
getChildren, getParent, setAnnotationLevel, setParent, setReportLevel, toString, toStringChildren
 
Methods inherited from class scale.common.Root
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IncompleteType

public IncompleteType()
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Keep the count of instances up-to-date.
Overrides:
finalize in class Type
Throws:
java.lang.Throwable - [needs description]

number

public static int number()
Return the current number of instances of this class.

getCompleteType

public Type getCompleteType()
Return the completed type or null if it is not complete.
Overrides:
getCompleteType in class Type
Following copied from class: scale.clef.type.Type
See Also:
IncompleteType

setCompleteType

public final void setCompleteType(Type type)

isAttributeSet

public boolean isAttributeSet(int attribute)
Return true if the attribute is associated with this type.
Overrides:
isAttributeSet in class Type
See Also:
RefType

isAddressType

public boolean isAddressType()
Return true if type represents the address of something.
Overrides:
isAddressType in class Type

isArrayType

public boolean isArrayType()
Return true if type represents an array.
Overrides:
isArrayType in class Type

isPointerType

public boolean isPointerType()
Return true if type represents an address.
Overrides:
isPointerType in class Type

isVoidType

public boolean isVoidType()
Return true if type represents no type.
Overrides:
isVoidType in class Type

isAggregateType

public boolean isAggregateType()
Return true if type represents an aggregate object.
Overrides:
isAggregateType in class Type

isCompositeType

public boolean isCompositeType()
Return true if type represents a composite type.
Overrides:
isCompositeType in class Type

isRealType

public boolean isRealType()
Return true if type represents a floating point value.
Overrides:
isRealType in class Type

isIntegerType

public boolean isIntegerType()
Return true if type represents an integer value.
Overrides:
isIntegerType in class Type

isComplexType

public boolean isComplexType()
Return true if type represents a complex value.
Overrides:
isComplexType in class Type

isAtomicType

public boolean isAtomicType()
Return true if type represents a scaler value.
Overrides:
isAtomicType in class Type

isNumericType

public boolean isNumericType()
Return true if type represents a numeric value.
Overrides:
isNumericType in class Type

isNamedType

public boolean isNamedType()
Return true if this type has an associated TypeName or TypeDecl.
Overrides:
isNamedType in class Type

isSigned

public boolean isSigned()
Return true is the type is signed.
Overrides:
isSigned in class Type

getDecl

public Declaration getDecl()
Return the TypeDecl or TypeName of this type reference.
Overrides:
getDecl in class Node

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 Type

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

getCoreType

public Type getCoreType()
This method filters out some the special case type nodes from a type DAG.
Overrides:
getCoreType in class Type
See Also:
Type.getCoreType()

memorySize

public int memorySize(Machine machine)
Calculate how many addressable memory units are needed to represent the type.
Overrides:
memorySize in class Type
Parameters:
machine - is the machine-specific data machine
Returns:
the number of addressable memory units required to represent this type

alignment

public int alignment(Machine machine)
Calculate the alignment needed for this data type.
Overrides:
alignment in class Type

isConst

public boolean isConst()
Return true if the type specifies const.
Overrides:
isConst in class Type

isVolatile

public boolean isVolatile()
Return true if the type specifies volatile.
Overrides:
isVolatile in class Type

toStringSpecial

public java.lang.String toStringSpecial()
Description copied from class: Root
Return any special information of a node that is not a child or annotation. This method is meant to be overridden by nodes that need to provide special output.
Overrides:
toStringSpecial in class Node

equivalent

public boolean equivalent(Type t)
Return true if the types are equivalent.
Overrides:
equivalent in class Type