예제 #1
0
 public static BuiltinList toDigits(
     BitVector term, IntToken bitwidth, IntToken count, TermContext context) {
   if (bitwidth.intValue() > 0 && bitwidth.intValue() * count.intValue() <= term.bitwidth) {
     BuiltinList.Builder builder = BuiltinList.builder(context);
     builder.addItems(term.toDigits(bitwidth.intValue(), count.intValue()));
     return (BuiltinList) builder.build();
   } else {
     return null;
   }
 }
 @Override
 public ASTNode visit(org.kframework.kil.ListBuiltin node, Void _void) {
   BuiltinList.Builder builder = BuiltinList.builder(termContext);
   for (org.kframework.kil.Term element : node.elementsLeft()) {
     builder.addItem((Term) this.visitNode(element));
   }
   for (org.kframework.kil.Term term : node.baseTerms()) {
     builder.concatenate((Term) this.visitNode(term));
   }
   for (org.kframework.kil.Term element : node.elementsRight()) {
     builder.addItem((Term) this.visitNode(element));
   }
   return builder.build();
 }