private static String buildSizeableArray(Type type, final ParseArrayMode What) { final StringBuffer result = new StringBuffer(); String arraySpec = ""; while (type instanceof ArrayOf) { final String size = ((ArrayOf) type).getSize(); if (size != null) { arraySpec = "[" + size + "]" + arraySpec; } else { arraySpec = "[]" + arraySpec; } type = getContainedType((ArrayOf) type); } if (What == ParseArrayMode.TYPE) result.append(buildComplexOrPrimitiveType(type)); if (What == ParseArrayMode.SIZEOF) result.append(arraySpec); return result.toString(); }
public void visitMethod(final Method method) throws Exception { methenum_cw.append(method.getName() + "_ID,"); methcode_cw.append(buildMethodDefinition(method, false, "METHOD(input," + method.getName().toString() + ")")); methcode_cw.appendln("{"); // trigger reporter BEGIN(methodeid) methcode_cw.appendln("CALL(REQUIRED.trigger,begin,(void*)" + method.getName() + "_ID" + ");"); // call application method methcode_cw.append("CALL(REQUIRED.output," + method.getName().toString()); for (final Parameter p : ((ParameterContainer) method).getParameters()) { methcode_cw.append("," + "\n"); methcode_cw.append(" " + p.getName()); } methcode_cw.append(");" + "\n"); // trigger report END methcode_cw.appendln("CALL(REQUIRED.trigger,end);"); methcode_cw.appendln("}"); } }
methcode_cw.append(buildMethodDefinition(method, false, "METHOD(input," + method.getName().toString() + ")")); methcode_cw.appendln("{"); result = localVars.validateName("result"); methcode_cw.append(CUtil.buildReturnType(returnType)).append(" ") .append(result).append(";").endl();
final String qualifier = p.getQualifier(); p.setQualifier(Parameter.IN); cw.append(CUtil.buildParameter(p)).append(";").endl(); p.setQualifier(qualifier); } else { cw.append(CUtil.buildParameter(p)).append(";").endl(); cw.append(CUtil.buildReturnType(returnType)).append(" ").append(result) .append(";").endl();
methCode_cw.append(buildMethodDefinition(method, false, "METHOD(input," + method.getName().toString() + ")")); args_cw.append(buildParameter(p) + ";\n");
final String attrValue = attribute.getValue(); final Type attType = fieldTypes.get(attrName); final String attTypeStr = CUtil.buildReturnType(attType); if (attrValue != null) { cw.append("static const ").append(
args_cw.appendln("void *" + p.getName() + ";"); else args_cw.appendln(buildParameter(p) + ";");
case BOOLEAN : cw.append(sizeofName).append(" += sizeof(").append( buildPrimitiveType(varType)).append(");").endl(); break; case STRING :
cw.append(buildMethodDefinition(method, false, methodName)).append(" {") .endl(); cw.append(CUtil.buildReturnType(returnType)).append(" ").append(result) .append(";").endl();
code_cw.appendln(buildMethodDefinition(method, false, "METHOD(itf," + method.getName().toString() + ")")); args_cw.appendln("void *" + p.getName() + ";"); else args_cw.appendln(buildParameter(p) + ";");
cw.append(CUtil.buildParameter(p)).append(";").endl();
private static String buildSizeableArray(Type type, final ParseArrayMode What) { final StringBuffer result = new StringBuffer(); String arraySpec = ""; while (type instanceof ArrayOf) { final String size = ((ArrayOf) type).getSize(); if (size != null) { arraySpec = "[" + size + "]" + arraySpec; } else { arraySpec = "[]" + arraySpec; } type = getContainedType((ArrayOf) type); } if (What == ParseArrayMode.TYPE) result.append(buildComplexOrPrimitiveType(type)); if (What == ParseArrayMode.SIZEOF) result.append(arraySpec); return result.toString(); }
public void visitMethod(final Method method) throws Exception { methCode_cw.append(buildMethodDefinition(method, false, "METHOD(input," + method.getName().toString() + ")")); methCode_cw.appendln("{");
private static String buildSizeableArray(Type type, final ParseArrayMode What) { final StringBuffer result = new StringBuffer(); String arraySpec = ""; while (type instanceof ArrayOf) { final String size = ((ArrayOf) type).getSize(); if (size != null) { arraySpec = "[" + size + "]" + arraySpec; } else { arraySpec = "[]" + arraySpec; } type = getContainedType((ArrayOf) type); } if (What == ParseArrayMode.TYPE) result.append(buildComplexOrPrimitiveType(type)); if (What == ParseArrayMode.SIZEOF) result.append(arraySpec); return result.toString(); }
public void visitMethod(final Method method) throws Exception { methCode_cw.append(buildMethodDefinition(method, false, "METHOD(input," + method.getName().toString() + ")")); methCode_cw.appendln("{");
private static String buildSizeableArray(Type type, final ParseArrayMode What) { final StringBuffer result = new StringBuffer(); String arraySpec = ""; while (type instanceof ArrayOf) { final String size = ((ArrayOf) type).getSize(); if (size != null) { arraySpec = "[" + size + "]" + arraySpec; } else { arraySpec = "[]" + arraySpec; } type = getContainedType((ArrayOf) type); } if (What == ParseArrayMode.TYPE) result.append(buildComplexOrPrimitiveType(type)); if (What == ParseArrayMode.SIZEOF) result.append(arraySpec); return result.toString(); }
method.getName()).append("_method").toString(); cw.append(buildMethodDefinition(method, false, methodName)).append(" {") .endl();
/** * Returns the equivalent in C of the given return type. * * @param type the type * @return the equivalent in C of the given return type. */ public static String buildType(Type type) { final StringBuffer result = new StringBuffer(); int nbPointer = 0; // A return type is an [ArrayOf](PointerOf)*(PrimitiveType|ComplexType) while (type instanceof ArrayOf) { nbPointer++; type = getContainedType((ArrayOf) type); } while (type instanceof PointerOf) { nbPointer++; type = getContainedType((PointerOf) type); } result.append(buildComplexOrPrimitiveType(type)); for (int i = 0; i < nbPointer; i++) result.append('*'); return result.toString(); }