use of de.be4.classicalb.core.parser.node.Node in project probparsers by bendisposto.
the class TranslatingVisitor method caseASequenceExtensionExpression.
@Override
public void caseASequenceExtensionExpression(ASequenceExtensionExpression node) {
List<BObject> s = new ArrayList<BObject>();
for (PExpression e : node.getExpression()) {
e.apply(this);
s.add(this.getResult());
}
this.setResult(new Sequence(s));
}
use of de.be4.classicalb.core.parser.node.Node in project probparsers by bendisposto.
the class SetType method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
APowSubsetExpression node = new APowSubsetExpression(subtype.createASTNode(typechecker));
typechecker.setType(node, this);
return node;
}
use of de.be4.classicalb.core.parser.node.Node in project probparsers by bendisposto.
the class StringType method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
AStringSetExpression node = new AStringSetExpression();
typechecker.setType(node, new SetType(this));
return node;
}
use of de.be4.classicalb.core.parser.node.Node 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;
}
use of de.be4.classicalb.core.parser.node.Node in project probparsers by bendisposto.
the class MissingPositionsAdder method defaultIn.
public void defaultIn(Node node) {
SourcePosition startPos = node.getStartPos();
if (startPos == null) {
Node parent = node.parent();
if (parent != null && parent.getStartPos() != null) {
node.setStartPos(parent.getStartPos());
node.setEndPos(parent.getEndPos());
}
}
}
Aggregations