Revision 9
Added by Willibald K. over 8 years ago
OoaPrintVisitor.java | ||
---|---|---|
39 | 39 |
import org.momut.ooas.ast.expressions.ListConstructor; |
40 | 40 |
import org.momut.ooas.ast.expressions.MapConstructor; |
41 | 41 |
import org.momut.ooas.ast.expressions.ObjectConstructor; |
42 |
import org.momut.ooas.ast.expressions.QValConstructor; |
|
43 | 42 |
import org.momut.ooas.ast.expressions.SetConstructor; |
44 | 43 |
import org.momut.ooas.ast.expressions.TernaryOperator; |
45 | 44 |
import org.momut.ooas.ast.expressions.TupleConstructor; |
... | ... | |
54 | 53 |
import org.momut.ooas.ast.identifiers.ExpressionVariableIdentifier; |
55 | 54 |
import org.momut.ooas.ast.identifiers.Identifier; |
56 | 55 |
import org.momut.ooas.ast.identifiers.IdentifierKind; |
57 |
import org.momut.ooas.ast.identifiers.LandmarkIdentifier; |
|
58 | 56 |
import org.momut.ooas.ast.identifiers.MainModule; |
59 | 57 |
import org.momut.ooas.ast.identifiers.MethodIdentifier; |
60 | 58 |
import org.momut.ooas.ast.identifiers.NamedActionIdentifier; |
... | ... | |
83 | 81 |
import org.momut.ooas.ast.types.NullType; |
84 | 82 |
import org.momut.ooas.ast.types.OoActionSystemType; |
85 | 83 |
import org.momut.ooas.ast.types.OpaqueType; |
86 |
import org.momut.ooas.ast.types.QrType; |
|
87 | 84 |
import org.momut.ooas.ast.types.TupleType; |
88 | 85 |
import org.momut.ooas.ast.types.TypeKind; |
89 |
import org.momut.ooas.ast.types.UlyssesType;
|
|
86 |
import org.momut.ooas.ast.types.Type; |
|
90 | 87 |
import org.momut.ooas.codegen.OoasCodeEmitter; |
91 | 88 |
import org.momut.ooas.parser.ParserState; |
92 | 89 |
import org.momut.ooas.utils.exceptions.NotImplementedException; |
... | ... | |
127 | 124 |
} |
128 | 125 |
|
129 | 126 |
/*print the type identifier, or the type definition by calling the anAction delegate.*/ |
130 |
private void PrintType(UlyssesType atype, Action anAction)
|
|
127 |
private void PrintType(Type atype, Action anAction) |
|
131 | 128 |
{ |
132 | 129 |
if ( (atype.identifier() != null) |
133 | 130 |
&& (!atype.isAnonymousType()) |
... | ... | |
306 | 303 |
} |
307 | 304 |
|
308 | 305 |
@Override |
309 |
public void visit(final QrType qrType) |
|
310 |
{ |
|
311 |
PrintType(qrType, new Action(){ |
|
312 |
@Override |
|
313 |
public void doIt() { |
|
314 |
output.Append("qspace of ["); |
|
315 |
PrintEnumeration(qrType.landmarks()); |
|
316 |
output.Append("]"); |
|
317 |
}}); |
|
318 |
} |
|
319 |
|
|
320 |
@Override |
|
321 |
public void visit(LandmarkIdentifier landmarkIdentifier) |
|
322 |
{ |
|
323 |
output.Append(landmarkIdentifier.tokenText()); |
|
324 |
} |
|
325 |
|
|
326 |
@Override |
|
327 | 306 |
public void visit(final OoActionSystemType ooActionSystemType) |
328 | 307 |
{ |
329 | 308 |
PrintType(ooActionSystemType, new Action(){ |
... | ... | |
768 | 747 |
output.Append("]"); |
769 | 748 |
} |
770 | 749 |
|
771 |
@Override |
|
772 |
public void visit(QValConstructor qValConstructor) |
|
773 |
{ |
|
774 |
output.Append("qval("); |
|
775 |
PrintSubElementOrNull(qValConstructor.value()[0]); |
|
776 |
if (qValConstructor.value().length == 2) |
|
777 |
{ |
|
778 |
output.Append(" .. "); |
|
779 |
PrintSubElementOrNull(qValConstructor.value()[1]); |
|
780 |
} |
|
781 |
output.Append(","); |
|
782 |
output.Append(qValConstructor.valueDeriv().toString()); |
|
783 |
output.Append(")"); |
|
784 |
} |
|
785 |
|
|
786 |
|
|
787 | 750 |
private boolean make_parens = false; |
788 | 751 |
|
789 | 752 |
@Override |
Also available in: Unified diff
remove support for Qualitative Action Systems, rename UlyssesType to Type