コード例 #1
0
  @Override
  public ASTNode visit(org.kframework.kil.SetUpdate node, Void _void) {
    Variable set = (Variable) this.visitNode(node.set());

    HashSet<Term> removeSet = new HashSet<>(node.removeEntries().size());
    for (org.kframework.kil.Term term : node.removeEntries()) {
      removeSet.add((Term) this.visitNode(term));
    }

    return DataStructures.setDifference(set, removeSet, termContext);
  }
コード例 #2
0
  @Override
  public ASTNode transform(org.kframework.kil.SetUpdate node) throws TransformerException {
    Variable set = (Variable) node.set().accept(this);

    HashSet<Term> removeSet = new HashSet<Term>(node.removeEntries().size());
    for (org.kframework.kil.Term term : node.removeEntries()) {
      removeSet.add((Term) term.accept(this));
    }

    return new SetUpdate(set, removeSet);
  }