Exemplo n.º 1
0
 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";
   }
 }
Exemplo n.º 2
0
 public static String getArgumentWithFormal(
     Argument arg, Context context, boolean objPtr, boolean inStub, boolean isExec)
     throws CodeGenerationException {
   final Type type = arg.getType();
   if (Type.ENUM == type.getDetailedType()) {
     return getEnumName(type.getSymbolID())
         + ((arg.getMode() != Argument.IN) ? "* " : " ")
         + arg.getFormalName();
   } else {
     return IOR.getArgumentWithFormal(arg, context, objPtr, inStub, isExec);
   }
 }
Exemplo n.º 3
0
 /**
  * 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();
   }
 }
Exemplo n.º 4
0
 public static String getReturnString(Type type, Context context, boolean objPtr, boolean inStub)
     throws CodeGenerationException {
   return (Type.ENUM == type.getDetailedType())
       ? getEnumName(type.getSymbolID())
       : IOR.getReturnString(type, context, objPtr, inStub);
 }