Revision 9
Added by Willibald K. over 8 years ago
OoaAstEmitter.java | ||
---|---|---|
44 | 44 |
import org.momut.ooas.ast.expressions.ListConstructor; |
45 | 45 |
import org.momut.ooas.ast.expressions.MapConstructor; |
46 | 46 |
import org.momut.ooas.ast.expressions.ObjectConstructor; |
47 |
import org.momut.ooas.ast.expressions.QValConstructor; |
|
48 | 47 |
import org.momut.ooas.ast.expressions.Quantifier; |
49 | 48 |
import org.momut.ooas.ast.expressions.SetConstructor; |
50 | 49 |
import org.momut.ooas.ast.expressions.TernaryOperator; |
... | ... | |
62 | 61 |
import org.momut.ooas.ast.identifiers.Identifier; |
63 | 62 |
import org.momut.ooas.ast.identifiers.IdentifierKind; |
64 | 63 |
import org.momut.ooas.ast.identifiers.IdentifierList; |
65 |
import org.momut.ooas.ast.identifiers.LandmarkIdentifier; |
|
66 | 64 |
import org.momut.ooas.ast.identifiers.LocalVariableIdentifier; |
67 | 65 |
import org.momut.ooas.ast.identifiers.MainModule; |
68 | 66 |
import org.momut.ooas.ast.identifiers.MethodIdentifier; |
... | ... | |
83 | 81 |
import org.momut.ooas.ast.statements.KillStatement; |
84 | 82 |
import org.momut.ooas.ast.statements.NondetBlock; |
85 | 83 |
import org.momut.ooas.ast.statements.PrioBlock; |
86 |
import org.momut.ooas.ast.statements.QualitativeConstraintStatement; |
|
87 | 84 |
import org.momut.ooas.ast.statements.SeqBlock; |
88 | 85 |
import org.momut.ooas.ast.statements.SkipStatement; |
89 | 86 |
import org.momut.ooas.ast.statements.Statement; |
... | ... | |
100 | 97 |
import org.momut.ooas.ast.types.OoActionSystemInstance; |
101 | 98 |
import org.momut.ooas.ast.types.OoActionSystemType; |
102 | 99 |
import org.momut.ooas.ast.types.OpaqueType; |
103 |
import org.momut.ooas.ast.types.QrType; |
|
104 | 100 |
import org.momut.ooas.ast.types.TupleType; |
105 | 101 |
import org.momut.ooas.ast.types.TypeKind; |
106 |
import org.momut.ooas.ast.types.UlyssesType;
|
|
102 |
import org.momut.ooas.ast.types.Type; |
|
107 | 103 |
import org.momut.ooas.ast.types.ValuedEnumType; |
108 | 104 |
import org.momut.ooas.parser.ParserState; |
109 | 105 |
import org.momut.ooas.utils.exceptions.NotImplementedException; |
... | ... | |
116 | 112 |
final ParserState m_state; |
117 | 113 |
protected HashSet<Object> m_visited = new HashSet<Object>(); |
118 | 114 |
final IdentityHashMap<Identifier,T> m_convertedIdentifiers; |
119 |
final IdentityHashMap<UlyssesType,T> m_convertedTypes;
|
|
115 |
final IdentityHashMap<Type,T> m_convertedTypes; |
|
120 | 116 |
final IdentityHashMap<Expression,T> m_convertedExpressions; |
121 | 117 |
final IdentityHashMap<Statement,T> m_convertedStatements; |
122 | 118 |
final IdentityHashMap<IScope,T> m_convertedScopes; |
... | ... | |
173 | 169 |
return result; |
174 | 170 |
} |
175 | 171 |
|
176 |
private final T createType(UlyssesType type) {
|
|
172 |
private final T createType(Type type) { |
|
177 | 173 |
TypeKind kind = type.kind(); |
178 | 174 |
if (type instanceof ValuedEnumType) |
179 | 175 |
kind = TypeKind.ValuedEnumeratedType; |
... | ... | |
657 | 653 |
|
658 | 654 |
final Identifier id = tupleType.identifier(); |
659 | 655 |
VisitSub(id, tupleType); |
660 |
for (final UlyssesType t: tupleType.innerTypes())
|
|
656 |
for (final Type t: tupleType.innerTypes()) |
|
661 | 657 |
VisitSub(t, tupleType); |
662 | 658 |
|
663 | 659 |
final T list = m_copier.createTypeList(); |
664 |
for (final UlyssesType t: tupleType.innerTypes())
|
|
660 |
for (final Type t: tupleType.innerTypes()) |
|
665 | 661 |
m_copier.addTypeToList(list, m_convertedTypes.get(t)); |
666 | 662 |
|
667 | 663 |
m_copier.initTupleType( |
... | ... | |
678 | 674 |
|
679 | 675 |
final Identifier id = functionType.identifier(); |
680 | 676 |
VisitSub(id, functionType); |
681 |
for (final UlyssesType a: functionType.parameter())
|
|
677 |
for (final Type a: functionType.parameter()) |
|
682 | 678 |
VisitSub(a, functionType); |
683 | 679 |
VisitSub(functionType.returnType(), functionType); |
684 | 680 |
|
685 | 681 |
|
686 | 682 |
final T list = m_copier.createTypeList(); |
687 |
for (final UlyssesType t: functionType.parameter())
|
|
683 |
for (final Type t: functionType.parameter()) |
|
688 | 684 |
m_copier.addTypeToList(list, m_convertedTypes.get(t)); |
689 | 685 |
|
690 | 686 |
m_copier.initFunctionType( |
... | ... | |
1449 | 1445 |
// maps are not supported right now |
1450 | 1446 |
throw new NotImplementedException(); |
1451 | 1447 |
} |
1452 |
|
|
1453 |
@Override |
|
1454 |
public void visit(QrType qrType) |
|
1455 |
{ |
|
1456 |
// QR is never going to be supported again. |
|
1457 |
throw new NotImplementedException(); |
|
1458 |
} |
|
1459 |
|
|
1460 |
@Override |
|
1461 |
public void visit(QValConstructor qValConstructor) |
|
1462 |
{ |
|
1463 |
// we do not support qualitative systems anymore |
|
1464 |
throw new NotImplementedException(); |
|
1465 |
} |
|
1466 |
|
|
1467 |
@Override |
|
1468 |
public void visit(QualitativeConstraintStatement qalitativeConstraintStatement) |
|
1469 |
{ |
|
1470 |
// we do not support qualitative systems anymore |
|
1471 |
throw new NotImplementedException(); |
|
1472 |
} |
|
1473 |
|
|
1474 |
@Override |
|
1475 |
public void visit(LandmarkIdentifier landmarkIdentifier) |
|
1476 |
{ |
|
1477 |
// we do not support qualitative systems anymore |
|
1478 |
throw new NotImplementedException(); |
|
1479 |
} |
|
1480 | 1448 |
} |
Also available in: Unified diff
remove support for Qualitative Action Systems, rename UlyssesType to Type