示例#1
0
 @Override
 public void visit(InjectedKLabel node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     node.injectedKLabel().accept(this);
     rhsSchedule.add(RHSInstruction.CONSTRUCT(new Constructor(ConstructorType.INJECTED_KLABEL)));
   }
 }
示例#2
0
 @Override
 public void visit(KLabelInjection node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     node.term().accept(this);
     rhsSchedule.add(RHSInstruction.CONSTRUCT(new Constructor(ConstructorType.KLABEL_INJECTION)));
   }
 }
示例#3
0
 @Override
 public void visit(KItemProjection node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     node.term().accept(this);
     rhsSchedule.add(
         RHSInstruction.CONSTRUCT(new Constructor(ConstructorType.KITEM_PROJECTION, node.kind())));
     rhsSchedule.add(RHSInstruction.PROJECT);
   }
 }
示例#4
0
 @Override
 public void visit(KItem node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     node.kList().accept(this);
     node.kLabel().accept(this);
     rhsSchedule.add(
         RHSInstruction.CONSTRUCT(
             new Constructor(ConstructorType.KITEM, node.getSource(), node.getLocation())));
     rhsSchedule.add(RHSInstruction.EVAL);
   }
 }
示例#5
0
 @Override
 public void visit(BuiltinList node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     for (int i = node.size() - 1; i >= 0; i--) {
       node.get(i).accept(this);
     }
     rhsSchedule.add(
         RHSInstruction.CONSTRUCT(
             new Constructor(
                 ConstructorType.BUILTIN_LIST,
                 node.size(),
                 node.sort,
                 node.operatorKLabel,
                 node.unitKLabel)));
   }
 }
示例#6
0
 @Override
 public void visit(KList node) {
   if (node.isGround() && node.isNormal()) {
     rhsSchedule.add(RHSInstruction.PUSH(node));
   } else {
     int size = 0;
     if (node.hasFrame()) {
       node.frame().accept(this);
       size++;
     }
     for (int i = node.concreteSize() - 1; i >= 0; i--) {
       Term k = node.get(i);
       k.accept(this);
       size++;
     }
     rhsSchedule.add(RHSInstruction.CONSTRUCT(new Constructor(ConstructorType.KLIST, size)));
   }
 }
示例#7
0
 @Override
 public void visit(BuiltinSet 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 (Term elem : node.elements()) {
       elem.accept(this);
       sizeElem++;
     }
     rhsSchedule.add(
         RHSInstruction.CONSTRUCT(
             new Constructor(ConstructorType.BUILTIN_SET, sizeElem, sizeBase)));
   }
 }
示例#8
0
 @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)));
   }
 }
示例#9
0
 @Override
 public void visit(KLabelConstant kLabelConstant) {
   rhsSchedule.add(RHSInstruction.PUSH(kLabelConstant));
 }
示例#10
0
 @Override
 public void visit(Hole hole) {
   rhsSchedule.add(RHSInstruction.PUSH(hole));
 }
示例#11
0
 @Override
 public void visit(UninterpretedToken token) {
   rhsSchedule.add(RHSInstruction.PUSH(token));
 }