use of org.btrplace.safeplace.spec.type.Atomic in project scheduler by btrplace.
the class MyCstrSpecVisitor method visitTypedef.
@Override
public List<UserVar<?>> visitTypedef(@NotNull CstrSpecParser.TypedefContext ctx) {
Term<?> parent = (Term<?>) visit(ctx.term());
if (parent.type() instanceof Atomic) {
throw new SpecException(filename, ctx.op.getCharPositionInLine(), "The right-hand side must be a collection");
}
List<UserVar<?>> vars = new ArrayList<>();
for (TerminalNode n : ctx.ID()) {
String lbl = n.getText();
UserVar v = new UserVar(lbl, ctx.op.getText(), parent);
symbols.put(v);
vars.add(v);
}
return vars;
}
Aggregations