|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscale.common.Root
scale.clef.Node
scale.clef.type.Type
scale.clef.type.CompositeType
scale.clef.type.FortranCharType
public class FortranCharType
The FortranCharType class represents the Fortran CHARACTER type.
$Id: FortranCharType.java,v 1.5 2007-03-21 13:31:56 burrill Exp $
Copyright 2007 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
| Method Summary | |
|---|---|
int |
alignment(Machine machine)
Calculate the alignment needed for this data type. |
static void |
cleanup()
Remove static lists of types. |
static FortranCharType |
create(int length)
Re-use an existing instance of a particular CHARACTER type. |
boolean |
equivalent(Type t)
Return true if the types are equivalent. |
int |
getLength()
Return the number of characters in this CHARACTER type. |
boolean |
isFortranCharType()
Return true if type represents a Fortran CHARACTER type. |
java.lang.String |
mapTypeToCString()
Map a type to a C string. |
java.lang.String |
mapTypeToF77String()
Map a type to a Fortran string. |
long |
memorySize(Machine machine)
Calculate how many addressable memory units are needed to represent the type. |
int |
precedence()
Return a precedence value for types. |
FortranCharType |
returnFortranCharType()
Return if this is a FortranCharType, return this. |
java.lang.String |
toString()
|
void |
visit(Predicate p)
Process a node by calling its associated routine. |
void |
visit(TypePredicate p)
Process a node by calling its associated routine. |
| Methods inherited from class scale.clef.type.CompositeType |
|---|
isCompositeType, returnCompositeType |
| Methods inherited from class scale.clef.Node |
|---|
getChild, getDecl, getSourceLineNumber, numChildren, setAnnotationLevel, setReportLevel, setSourceLineNumber, toString, toStringChildren, toStringSpecial |
| Methods inherited from class scale.common.Root |
|---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static FortranCharType create(int length)
length - is the number of length in characterspublic final FortranCharType returnFortranCharType()
Typethis is a FortranCharType, return this. Otherwise, return
null.
returnFortranCharType in class Typepublic final boolean isFortranCharType()
Type
isFortranCharType in class Typepublic int getLength()
public java.lang.String toString()
toString in class Typepublic void visit(Predicate p)
Node
Each class has a visit(Predicate p) method. For
example, in class ABC:
public void visit(Predicate p)
{
p.visitABC(this);
}
and the class that implements Predicate has a method
public void visitABC(Node n)
{
ABC a = (ABC) n;
...
}
Thus, the class that implements Predicate can call
n.visit(this);where
n is a Node sub-class without
determining which specific sub-class n is.
The visit pattern basically avoids implementing a large
switch statement or defining different methods
in each class for some purpose.
visit in class CompositeTypePredicatepublic void visit(TypePredicate p)
Type
Each type class has a visit(TypePredicate p) method.
For example, in class ABC:
public void visit(Predicate p)
{
p.visitABC(this);
}
and the class that implements Predicate has a method
public void visitABC(Node n)
{
ABC a = (ABC) n;
...
}
Thus, the class that implements TypePredicate can call
n.visit(this);where
n is a Node sub-class without
determining which specific sub-class n is.
The visit pattern basically avoids implementing a large
switch statement or defining different methods
in each class for some purpose.
visit in class CompositeTypeTypePredicatepublic java.lang.String mapTypeToCString()
mapTypeToCString in class Typepublic java.lang.String mapTypeToF77String()
mapTypeToF77String in class Typepublic final boolean equivalent(Type t)
equivalent in class Typepublic long memorySize(Machine machine)
memorySize in class Typemachine - is the machine-specific data machine
public int alignment(Machine machine)
alignment in class Typepublic int precedence()
precedence in class Typepublic static void cleanup()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||