|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSemant.Type
public abstract class Type
Type descriptors for MiniJava.
| Nested Class Summary | |
|---|---|
static class |
Type.ARRAY
An array has an element type. |
static class |
Type.CLASS
A class encapsulates static (class) fields and methods, may extend a parent class, and describes the structure of its instances. |
static class |
Type.FUN
A function has formal parameters (represented as a record) and a result type. |
static class |
Type.INSTANCE
A class instance is an instance of some class, encapsulating instance fields and instance methods. |
static class |
Type.Print
A visitor to print types. |
static class |
Type.RECORD<T extends Type>
A record encapsulates state as fields |
static interface |
Type.Visitor
The Type Visitor. |
| Field Summary | |
|---|---|
static Semant.Type.Primitive |
BOOLEAN
Predefined primitive types |
static Semant.Type.Primitive |
INT
|
static Semant.Type.Primitive |
NIL
|
static Type.CLASS |
STRING
Predefined final classes String and System. |
static Type.CLASS |
SYSTEM
|
static Semant.Type.Primitive |
VOID
|
| Constructor Summary | |
|---|---|
Type()
|
|
| Method Summary | |
|---|---|
abstract void |
accept(Type.Visitor v)
A type must accept a visitor |
abstract boolean |
coerceTo(Type t)
A type's values may be coerced to those of another type. |
abstract boolean |
equals(Type t)
Type equality |
Type |
field(java.lang.String n)
A type may encapsulate state as fields. |
Type.FUN |
method(java.lang.String n)
A type may encapsulate behavior as methods. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Semant.Type.Primitive BOOLEAN
public static final Semant.Type.Primitive INT
public static final Semant.Type.Primitive NIL
public static final Semant.Type.Primitive VOID
public static final Type.CLASS STRING
public static final Type.CLASS SYSTEM
| Constructor Detail |
|---|
public Type()
| Method Detail |
|---|
public Type field(java.lang.String n)
n - name of the field
public Type.FUN method(java.lang.String n)
n - name of the method
public abstract boolean coerceTo(Type t)
t - target type
public abstract boolean equals(Type t)
t - target type
public abstract void accept(Type.Visitor v)
v - the visitor
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||