|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSemant.Type
Semant.Type.FUN
public static class Type.FUN
A function has formal parameters (represented as a record) and a result type.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Semant.Type |
---|
Type.ARRAY, Type.CLASS, Type.FUN, Type.INSTANCE, Type.Print, Type.RECORD<T extends Type>, Type.Visitor |
Field Summary | |
---|---|
java.lang.String |
external
External functions associate with some C library function name. |
Type.RECORD<Type> |
formals
|
Type |
result
|
Fields inherited from class Semant.Type |
---|
BOOLEAN, INT, NIL, STRING, SYSTEM, VOID |
Constructor Summary | |
---|---|
Type.FUN(Type r)
A function. |
|
Type.FUN(Type r,
java.lang.String x)
An external function. |
Method Summary | |
---|---|
void |
accept(Type.Visitor v)
A type must accept a visitor |
boolean |
coerceTo(Type t)
Functions coerce if their parameters are equal and their results coerce. |
boolean |
equals(Type t)
Functions are equal if their parameters are equal and their results are equal. |
java.lang.String |
toString()
A printable representation of this function type. |
Methods inherited from class Semant.Type |
---|
field, method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final Type result
public final Type.RECORD<Type> formals
public final java.lang.String external
Constructor Detail |
---|
public Type.FUN(Type r)
r
- result typepublic Type.FUN(Type r, java.lang.String x)
r
- result typex
- external function nameMethod Detail |
---|
public boolean coerceTo(Type t)
coerceTo
in class Type
t
- target type
public boolean equals(Type t)
equals
in class Type
t
- target type
public java.lang.String toString()
toString
in class java.lang.Object
public void accept(Type.Visitor v)
Type
accept
in class Type
v
- the visitor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |