Revision 9
Added by Willibald K. over 8 years ago
FunctionType.java | ||
---|---|---|
34 | 34 |
/////////////////////////////////////////////// |
35 | 35 |
/// Complex Type: Function |
36 | 36 |
/// |
37 |
public final class FunctionType extends UlyssesType
|
|
37 |
public final class FunctionType extends Type |
|
38 | 38 |
{ |
39 | 39 |
public enum FunctionTypeEnum { |
40 | 40 |
Observable (0), |
... | ... | |
52 | 52 |
|
53 | 53 |
private Boolean m_miracleSafe = null; |
54 | 54 |
private boolean m_pure; |
55 |
private LinkedList<UlyssesType> m_parameter;
|
|
56 |
private UlyssesType m_returnType;
|
|
55 |
private LinkedList<Type> m_parameter; |
|
56 |
private Type m_returnType; |
|
57 | 57 |
private final FunctionTypeEnum m_functionType; |
58 | 58 |
|
59 | 59 |
public Boolean isMiracleSafe() { return m_miracleSafe; } |
60 | 60 |
public boolean isPureFunction() { return m_pure; } |
61 |
public LinkedList<UlyssesType> parameter() { return m_parameter; }
|
|
62 |
public UlyssesType returnType() { return m_returnType; }
|
|
61 |
public LinkedList<Type> parameter() { return m_parameter; } |
|
62 |
public Type returnType() { return m_returnType; } |
|
63 | 63 |
public FunctionTypeEnum functionType() { return m_functionType; } |
64 | 64 |
|
65 |
public FunctionType(FunctionTypeEnum functionType, LinkedList<UlyssesType> parameter, UlyssesType returnType)
|
|
65 |
public FunctionType(FunctionTypeEnum functionType, LinkedList<Type> parameter, Type returnType)
|
|
66 | 66 |
{ |
67 | 67 |
super (TypeKind.FunctionType, null); |
68 | 68 |
if (parameter != null) |
69 | 69 |
m_parameter = parameter; |
70 | 70 |
else |
71 |
m_parameter = new LinkedList<UlyssesType>();
|
|
71 |
m_parameter = new LinkedList<Type>(); |
|
72 | 72 |
m_returnType = returnType; |
73 | 73 |
m_functionType = functionType; |
74 | 74 |
m_miracleSafe = null; |
... | ... | |
76 | 76 |
} |
77 | 77 |
|
78 | 78 |
|
79 |
public void AddParameterType(UlyssesType aType)
|
|
79 |
public void AddParameterType(Type aType) |
|
80 | 80 |
{ |
81 | 81 |
m_parameter.addLast(aType); |
82 | 82 |
} |
83 | 83 |
|
84 |
public void SetReturnType(UlyssesType aType)
|
|
84 |
public void SetReturnType(Type aType) |
|
85 | 85 |
{ |
86 | 86 |
m_returnType = aType; |
87 | 87 |
} |
... | ... | |
109 | 109 |
result.append("fun_"); |
110 | 110 |
result.append(m_functionType.toString()); |
111 | 111 |
result.append("_"); |
112 |
for (final UlyssesType sym: m_parameter)
|
|
112 |
for (final Type sym: m_parameter) |
|
113 | 113 |
{ |
114 | 114 |
result.append(sym.toString()); |
115 | 115 |
result.append("_"); |
Also available in: Unified diff
remove support for Qualitative Action Systems, rename UlyssesType to Type