示例#1
0
文件: C.java 项目: csdms/cca-babel
 public static String getDelRefArray(Type arrayType) {
   switch (arrayType.getDetailedType()) {
     case Type.CLASS:
     case Type.INTERFACE:
       return ArrayMethods.generateDelRefName(arrayType.getSymbolID());
     case Type.ENUM:
       return "sidl_long__array_deleteRef";
     default:
       return "sidl_" + arrayType.getTypeString() + "__array_deleteRef";
   }
 }
示例#2
0
文件: C.java 项目: csdms/cca-babel
 /**
  * Create a comment to describe the SIDL type for the C signature.
  *
  * @param arg the argument to make a comment from
  * @return usually this is just the mode as a string. For arrays and rarrays more information is
  *     returned.
  */
 public static String argComment(Argument arg) {
   final Type argType = arg.getType();
   if (Type.ARRAY == argType.getDetailedType()) {
     StringBuffer buf = new StringBuffer(arg.getModeString());
     if (argType.isRarray()) {
       buf.append(" rarray[");
       Iterator i = argType.getArrayIndexExprs().iterator();
       while (i.hasNext()) {
         AssertionExpression ae = (AssertionExpression) i.next();
         buf.append(ae.accept(new CExprString(), null).toString());
         if (i.hasNext()) buf.append(',');
       }
       buf.append(']');
     } else {
       buf.append(' ');
       buf.append(argType.getTypeString());
     }
     return buf.toString();
   } else {
     return arg.getModeString();
   }
 }