use of de.be4.classicalb.core.parser.node.AStructExpression in project probparsers by bendisposto.
the class StructType method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
ArrayList<PRecEntry> list = new ArrayList<PRecEntry>();
Set<Entry<String, BType>> entrySet = this.types.entrySet();
for (Entry<String, BType> entry : entrySet) {
String name = entry.getKey();
BType type = entry.getValue();
TIdentifierLiteral literal = new TIdentifierLiteral(name);
ArrayList<TIdentifierLiteral> idList = new ArrayList<TIdentifierLiteral>();
idList.add(literal);
AIdentifierExpression id = new AIdentifierExpression(idList);
ARecEntry recEntry = new ARecEntry(id, type.createASTNode(typechecker));
list.add(recEntry);
}
AStructExpression node = new AStructExpression(list);
typechecker.setType(node, new SetType(this));
return node;
}
Aggregations