Beispiel #1
0
 @Override
 public void visit(BuiltinMap builtinMap) {
   for (java.util.Map.Entry<Term, Term> entry : builtinMap.getEntries().entrySet()) {
     entry.getKey().accept(this);
     entry.getValue().accept(this);
   }
   visit((Collection) builtinMap);
 }
 @Override
 public ASTNode visit(org.kframework.kil.MapBuiltin node, Void _void) {
   BuiltinMap.Builder builder = BuiltinMap.builder(termContext);
   for (Map.Entry<org.kframework.kil.Term, org.kframework.kil.Term> entry :
       node.elements().entrySet()) {
     builder.put((Term) this.visitNode(entry.getKey()), (Term) this.visitNode(entry.getValue()));
   }
   for (org.kframework.kil.Term term : node.baseTerms()) {
     builder.concatenate((Term) this.visitNode(term));
   }
   return builder.build();
 }
 @Override
 public void visit(BuiltinMap node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     int sizeBase = 0;
     for (Term base : node.baseTerms()) {
       base.accept(this);
       sizeBase++;
     }
     int sizeElem = 0;
     for (Map.Entry<Term, Term> entry : node.getEntries().entrySet()) {
       entry.getValue().accept(this);
       entry.getKey().accept(this);
       sizeElem++;
     }
     rhsSchedule.add(
         RHSInstruction.CONSTRUCT(
             new Constructor(ConstructorType.BUILTIN_MAP, sizeElem, sizeBase)));
   }
 }