@Override
 public String toConstructionString(String spacing) {
   final boolean first = true;
   final StringBuilder sb = new StringBuilder();
   sb.append('\n').append(spacing).append("new HDLUnresolvedFragmentFunction()");
   if (frag != null) {
     sb.append(".setFrag(").append('"' + frag + '"').append(")");
   }
   if (isStatement != null) {
     sb.append(".setIsStatement(").append(isStatement).append(")");
   }
   if (array != null) {
     if (array.size() > 0) {
       sb.append('\n').append(spacing);
       for (final HDLExpression o : array) {
         sb.append(".addArray(").append(o.toConstructionString(spacing + "\t\t"));
         sb.append('\n').append(spacing).append(")");
       }
     }
   }
   if (bits != null) {
     if (bits.size() > 0) {
       sb.append('\n').append(spacing);
       for (final HDLRange o : bits) {
         sb.append(".addBits(").append(o.toConstructionString(spacing + "\t\t"));
         sb.append('\n').append(spacing).append(")");
       }
     }
   }
   if (sub != null) {
     sb.append(".setSub(").append(sub.toConstructionString(spacing + "\t")).append(")");
   }
   if (params != null) {
     if (params.size() > 0) {
       sb.append('\n').append(spacing);
       for (final HDLExpression o : params) {
         sb.append(".addParams(").append(o.toConstructionString(spacing + "\t\t"));
         sb.append('\n').append(spacing).append(")");
       }
     }
   }
   return sb.toString();
 }
Ejemplo n.º 2
0
 @Override
 public String toConstructionString(String spacing) {
   final boolean first = true;
   final StringBuilder sb = new StringBuilder();
   sb.append('\n').append(spacing).append("new HDLInlineFunction()");
   if (annotations != null) {
     if (annotations.size() > 0) {
       sb.append('\n').append(spacing);
       for (final HDLAnnotation o : annotations) {
         sb.append(".addAnnotations(").append(o.toConstructionString(spacing + "\t\t"));
         sb.append('\n').append(spacing).append(")");
       }
     }
   }
   if (name != null) {
     sb.append(".setName(").append('"' + name + '"').append(")");
   }
   if (args != null) {
     if (args.size() > 0) {
       sb.append('\n').append(spacing);
       for (final HDLFunctionParameter o : args) {
         sb.append(".addArgs(").append(o.toConstructionString(spacing + "\t\t"));
         sb.append('\n').append(spacing).append(")");
       }
     }
   }
   if (returnType != null) {
     sb.append(".setReturnType(")
         .append(returnType.toConstructionString(spacing + "\t"))
         .append(")");
   }
   if (expr != null) {
     sb.append(".setExpr(").append(expr.toConstructionString(spacing + "\t")).append(")");
   }
   return sb.toString();
 }