Commit 05c5fb26 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

A version of labcomm2006 that is hopefully working after some major

lobotomy.
parent 1f17be8a
SUBDIRS=compiler lib test examples packaging
export LABCOMM_JAR=$(shell pwd)/compiler/labcomm_compiler.jar
export LABCOMM_JAR=$(shell pwd)/compiler/labcomm2006_compiler.jar
export LABCOMM=java -jar $(LABCOMM_JAR)
.PHONY: all
......
gen
labcomm2006_compiler.jar
labcomm2014_compiler.jar
labcomm_compiler.jar
......@@ -8,8 +8,6 @@ aspect CS_CodeGenEnv {
public class CS_env {
public final int version;
public final String verStr;
private int indent;
private int depth;
private CS_printer printer;
......@@ -77,19 +75,17 @@ aspect CS_CodeGenEnv {
}
}
private CS_env(int indent, CS_printer printer, int version) {
this.version = version;
private CS_env(int indent, CS_printer printer) {
this.indent = indent;
this.printer = printer;
this.verStr = LabCommVersion.versionString(version);
}
public CS_env(File f, int version) {
this(0, new CS_printer(f), version);
public CS_env(File f) {
this(0, new CS_printer(f));
}
public CS_env(PrintStream out, int version) {
this(0, new CS_printer(out), version);
public CS_env(PrintStream out) {
this(0, new CS_printer(out));
}
public void close() throws IOException {
......@@ -202,9 +198,9 @@ aspect CS_Void {
aspect CS_CodeGen {
public void Program.CS_gen(String file,
String namespace, int version) throws IOException {
String namespace) throws IOException {
// Registration class
CS_env env = new CS_env(new File(file), version);
CS_env env = new CS_env(new File(file));
if (namespace != null && namespace.length() > 0) {
env.println("namespace " + namespace + "{");
env.indent();
......@@ -244,7 +240,6 @@ aspect CS_Register {
}
public void TypeDecl.CS_emitTypeRegister(CS_env env) {
// TODO
}
}
......@@ -258,45 +253,9 @@ aspect CS_Class {
}
public void Decl.CS_emitDeclPP(CS_env env){
env.println("/* ");
pp(env.getPrintStream());
CS_emitUserTypeDeps(env,null,false);
CS_emitUserTypeRefs(env,null,false);
env.println("*/");
}
public void Decl.CS_emitUserTypeDeps(CS_env env, String via, boolean outputCode){
Iterator<Decl> it = type_dependencies().iterator();
while(it.hasNext()) {
Decl t = it.next();
t.CS_emitUserTypeDeps(env, t.getName(), outputCode);
if( outputCode && t.getType().isUserType() ) {
env.println(t.getName()+".register(e);");
} else { // Just output a comment
String refpath = (via == null) ? "directly" : "indirectly via "+via;
env.println(" //Depends ("+refpath+") on "+t.getName() );
}
}
}
public void Decl.CS_emitUserTypeRefs(CS_env env, String via, boolean outputCode){
if( isReferenced() ) {
Iterator<Decl> it = type_references().iterator();
while(it.hasNext()) {
Decl t = it.next();
t.CS_emitUserTypeRefs(env, t.getName(), outputCode);
if(outputCode) {
env.println(t.getName()+".register(e);");
} else { // Just output a comment
String refpath = (via == null) ? "directly" : "indirectly via "+via;
env.println(" //Is referenced ("+refpath+") by "+t.getName() );
}
}
}
env.println("/* ");
pp(env.getPrintStream());
env.println("*/");
}
public void Decl.CS_emitRegisterEncoder(CS_env env) {
......@@ -305,11 +264,6 @@ aspect CS_Class {
env.println("e.register(dispatcher);");
env.unindent();
env.println("}");
env.println("public static void registerSampleRef(Encoder e) {");
env.indent();
env.println("e.registerSampleRef(dispatcher);");
env.unindent();
env.println("}");
env.println();
}
......@@ -320,12 +274,6 @@ aspect CS_Class {
env.unindent();
env.println("}");
env.println();
env.println("public static void registerSampleRef(Decoder d) {");
env.indent();
env.println("d.registerSampleRef(dispatcher);");
env.unindent();
env.println("}");
env.println();
}
public void TypeDecl.CS_emitClass(CS_env env) {
......@@ -339,11 +287,6 @@ aspect CS_Class {
env.println();
env.indent();
getType().CS_emitInstance(env);
if( isReferenced()) {
CS_emitRegisterEncoder(env);
CS_emitDispatcher(env,false);
}
CS_emitSignature(env);
CS_emitEncoder(env);
CS_emitDecoder(env);
env.unindent();
......@@ -381,22 +324,18 @@ aspect CS_Class {
public void Decl.CS_emitSignature(CS_env env) {
CS_emitFlatSignature(env);
// if(isReferenced() || isSampleDecl()){
// Signature signature = getSignature();
// signature.CS_emitSignature(env, !isSampleDecl());
// }
}
public void Decl.CS_emitFlatSignature(CS_env env){
env.println("private static byte[] signature = new byte[] {");
env.indent();
SignatureList signature = flatSignature(env.version);
SignatureList signature = flatSignature(2006);
for (int i = 0 ; i < signature.size() ; i++) {
String comment = signature.getComment(i);
if (comment != null) {
env.println(signature.getIndent(i) + "// " + comment);
}
byte[] data = signature.getData(i, env.version);
byte[] data = signature.getData(i, 2006);
if (data != null) {
env.print(signature.getIndent(i));
for (int j = 0 ; j < data.length ; j++) {
......@@ -413,7 +352,7 @@ aspect CS_Class {
//XXX TODO: refactor: split into a static class ("TypeDefSingleton"?)and a (smaller) dispatcher
public void Decl.CS_emitDispatcher(CS_env env, boolean isSample) {
String genericStr = ""; //env.versionHasMetaData()?"<"+getName()+">":"";
String genericStr = "";
env.println("private static Dispatcher dispatcher = new Dispatcher();");
env.println();
env.println("public SampleDispatcher getDispatcher() {");
......@@ -467,8 +406,8 @@ aspect CS_Class {
// env.println();
// env.println("public void encodeSignatureMetadata(Encoder e, int index){");
// env.indent();
// env.println("e.encodePacked32(Constant.TYPE_DEF);");
// env.println("e.encodePacked32(index);");
// env.println("e.encodeInt(Constant.TYPE_DEF);");
// env.println("e.encodeInt(index);");
// env.println("e.encodeString(getName());");
// env.println("emitSignature(e);");
// env.unindent();
......@@ -553,7 +492,6 @@ aspect CS_Class {
case LABCOMM_FLOAT: { env.print("e.encodeFloat"); } break;
case LABCOMM_DOUBLE: { env.print("e.encodeDouble"); } break;
case LABCOMM_STRING: { env.print("e.encodeString"); } break;
case LABCOMM_SAMPLE: { env.print("e.encodeSampleRef"); } break;
}
env.println("(" + name + ");");
}
......@@ -593,7 +531,7 @@ aspect CS_Class {
}
public String VariableSize.CS_emitEncoder(CS_env env, String name) {
env.println("e.encodePacked32(" + name + ");");
env.println("e.encodeInt(" + name + ");");
return name;
}
......@@ -648,7 +586,6 @@ aspect CS_Class {
case LABCOMM_FLOAT: { env.println("d.decodeFloat();"); } break;
case LABCOMM_DOUBLE: { env.println("d.decodeDouble();"); } break;
case LABCOMM_STRING: { env.println("d.decodeString();"); } break;
case LABCOMM_SAMPLE: { env.println("d.decodeSampleRef();"); } break;
default: {
throw new Error("PrimType.CS_emitDecoder(CS_env env, String name)" +
" unknown token type");
......@@ -706,7 +643,7 @@ aspect CS_Class {
}
public void VariableSize.CS_emitDecoder(CS_env env) {
env.print("d.decodePacked32()");
env.print("d.decodeInt()");
}
public void StructType.CS_emitDecoder(CS_env env, String name) {
......@@ -892,51 +829,51 @@ aspect CS_Class {
}
aspect CS_Signature {
public void Signature.CS_emitSignature(CS_env env, boolean decl){
SignatureList sl = getSignatureList();
sl.CS_emitSignature(env, decl);
}
public abstract void SignatureLine.CS_emitSignature(CS_env env, boolean decl);
public void Signature.CS_emitSignature(CS_env env, boolean decl) {
SignatureList sl = getSignatureList();
sl.CS_emitSignature(env, decl);
}
public abstract void SignatureLine.CS_emitSignature(CS_env env, boolean decl);
public void TypeRefSignatureLine.CS_emitSignature(CS_env env, boolean isDecl) {
env.print(getIndentString());
env.println("e.encodeInt(e.getTypeId( typeof("+decl.getName()+")));");
}
public void TypeRefSignatureLine.CS_emitSignature(CS_env env, boolean isDecl){
public void DataSignatureLine.CS_emitSignature(CS_env env, boolean decl) {
byte[] data = getData(2006);
if (data != null) {
env.print(getIndentString());
env.println("e.encodePacked32(e.getTypeId( typeof("+decl.getName()+")));");
}
public void DataSignatureLine.CS_emitSignature(CS_env env, boolean decl){
byte[] data = getData(env.version);
if (data != null) {
env.print(getIndentString());
for (int j = 0 ; j < data.length ; j++) {
//env.print("e.encodeByte((byte)"+data[j]+");");
env.print("e.encodeByte((byte)"+ String.format("0x%02X ", data[j]) +"); ");
}
env.println();
}
for (int j = 0 ; j < data.length ; j++) {
env.print("e.encodeByte((byte)"+ String.format("0x%02X ", data[j]) +"); ");
}
env.println();
}
}
public void SignatureList.CS_emitSignature(CS_env env, boolean decl) {
env.println("private static void emitSignature(Encoder e){");
env.indent();
for (int i = 0 ; i < size() ; i++) {
String comment = getComment(i);
if (comment != null && comment.length() > 0) {
env.println(getIndent(i) + "// " + comment);
}
SignatureLine l = getSignatureLine(i);
l.CS_emitSignature(env, decl);
public void SignatureList.CS_emitSignature(CS_env env, boolean decl) {
env.println("private static void emitSignature(Encoder e){");
env.indent();
for (int i = 0 ; i < size() ; i++) {
String comment = getComment(i);
if (comment != null && comment.length() > 0) {
env.println(getIndent(i) + "// " + comment);
}
env.println("}");
env.unindent();
SignatureLine l = getSignatureLine(i);
l.CS_emitSignature(env, decl);
}
env.println("}");
env.unindent();
}
}
aspect CS_Info {
public void Program.CS_info(PrintStream out, String namespace, int version) {
CS_env env = new CS_env(out, version);
public void Program.CS_info(PrintStream out, String namespace) {
CS_env env = new CS_env(out);
if (namespace == null) {
namespace = "";
} else {
......
......@@ -33,9 +33,6 @@ aspect C_CodeGenEnv {
}
}
public final int version; //labcomm version (2006 or 2014)
public final String verStr; // version suffix to append (currently _2006 and empty string)
public final String qualid;
public final String lcName;
public final String rawPrefix;
......@@ -47,16 +44,10 @@ aspect C_CodeGenEnv {
private boolean rootIsPointer;
private int rootLevel;
public boolean versionHasMetaData() {
return version != 2006;
}
private C_env(String qualid, String lcName, String rawPrefix,
int indent, int depth, C_printer printer,
int nestedLevel, int version)
int nestedLevel)
{
this.version = version;
this.verStr = LabCommVersion.versionString(version);
this.qualid = qualid;
this.lcName = lcName;
this.rawPrefix = rawPrefix;
......@@ -75,24 +66,24 @@ aspect C_CodeGenEnv {
}
public C_env(String qualid, String lcName, String rawPrefix,
PrintStream out, int version)
PrintStream out)
{
this(qualid, lcName, rawPrefix, 0, 0, new C_printer(out), 0, version);
this(qualid, lcName, rawPrefix, 0, 0, new C_printer(out), 0);
}
public C_env(String qualid, String lcName, String rawPrefix,
int indent, int depth, C_printer printer, int version) {
this(qualid, lcName, rawPrefix, indent, depth, printer, 0, version);
int indent, int depth, C_printer printer) {
this(qualid, lcName, rawPrefix, indent, depth, printer, 0);
}
public C_env nestArray(String suffix) {
return new C_env(qualid + suffix, lcName, rawPrefix,
indent, depth + 1, printer, nestedLevel + 1, version);
indent, depth + 1, printer, nestedLevel + 1);
}
public C_env nestStruct(String suffix) {
return new C_env(qualid + suffix, lcName, rawPrefix,
indent, depth, printer, nestedLevel + 1, version);
indent, depth, printer, nestedLevel + 1);
}
public void indent() {
......@@ -178,8 +169,8 @@ aspect C_IsDynamic {
aspect C_CodeGen {
public void Program.C_genH(PrintStream out, Vector includes,
String lcName, String prefix, int version) {
C_env env = new C_env("", lcName, prefix, out, version);
String lcName, String prefix) {
C_env env = new C_env("", lcName, prefix, out);
// Hackish prettyprint preamble
out.println("/* LabComm declarations:");
......@@ -192,7 +183,7 @@ aspect C_CodeGen {
env.println("");
// Include
env.println("#include \"labcomm"+env.verStr+".h\"");
env.println("#include \"labcomm2006.h\"");
for (int i = 0 ; i < includes.size() ; i++) {
env.println("#include \"" + includes.get(i) + "\"");
}
......@@ -204,12 +195,12 @@ aspect C_CodeGen {
}
public void Program.C_genC(PrintStream out, Vector includes,
String lcName, String prefix, int version) {
C_env env = new C_env("", lcName, prefix, out, version);
String lcName, String prefix) {
C_env env = new C_env("", lcName, prefix, out);
// Include
env.println("#include \"labcomm"+env.verStr+".h\"");
env.println("#include \"labcomm"+env.verStr+"_private.h\"");
env.println("#include \"labcomm2006.h\"");
env.println("#include \"labcomm2006_private.h\"");
for (int i = 0 ; i < includes.size() ; i++) {
env.println("#include \"" + includes.get(i) + "\"");
}
......@@ -285,8 +276,8 @@ aspect C_Type {
env.println(";");
env.println("#define LABCOMM_DEFINED_" + env.prefix + getName());
env.println("#endif");
env.println("extern const struct labcomm"+env.verStr+"_signature " +
"*labcomm"+env.verStr+"_signature_" + env.prefix + getName() +
env.println("extern const struct labcomm2006_signature " +
"*labcomm2006_signature_" + env.prefix + getName() +
";");
}
......@@ -383,10 +374,10 @@ aspect C_Declarations {
}
public void SampleDecl.C_emitDecoderDeclaration(C_env env) {
env.println("int labcomm"+env.verStr+"_decoder_register_" +
env.println("int labcomm2006_decoder_register_" +
env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_decoder *d,");
env.println("struct labcomm2006_decoder *d,");
env.println("void (*handler)(");
env.indent();
env.println(env.prefix + getName() + " *v,");
......@@ -397,9 +388,9 @@ aspect C_Declarations {
env.unindent();
env.println(");");
env.println("int labcomm"+env.verStr+"_decoder_ioctl_" + env.prefix + getName() + "(");
env.println("int labcomm2006_decoder_ioctl_" + env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_decoder *d,");
env.println("struct labcomm2006_decoder *d,");
env.println("int ioctl_action,");
env.println("...");
env.unindent();
......@@ -410,24 +401,24 @@ aspect C_Declarations {
}
//
public void SampleDecl.C_emitEncoderDeclaration(C_env env) {
env.println("int labcomm"+env.verStr+"_encoder_register_" +
env.println("int labcomm2006_encoder_register_" +
env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_encoder *e);");
env.println("struct labcomm2006_encoder *e);");
env.unindent();
env.println("int labcomm"+env.verStr+"_encode_" + env.prefix + getName() + "(");
env.println("int labcomm2006_encode_" + env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_encoder *e");
env.println("struct labcomm2006_encoder *e");
if(!isVoid() ) {
env.println(", "+env.prefix + getName() + " *v");
}
env.unindent();
env.println(");");
env.println("int labcomm"+env.verStr+"_encoder_ioctl_" + env.prefix + getName() + "(");
env.println("int labcomm2006_encoder_ioctl_" + env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_encoder *e,");
env.println("struct labcomm2006_encoder *e,");
env.println("int ioctl_action,");
env.println("...");
env.unindent();
......@@ -489,7 +480,7 @@ aspect C_Decoder {
env = env.nestStruct("v");
env.println("static void decode_" + env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_reader *r,");
env.println("struct labcomm2006_reader *r,");
env.println("void (*handle)(");
env.indent();
env.println(env.prefix + getName() + " *v,");
......@@ -529,10 +520,10 @@ aspect C_Decoder {
switch (getToken()) {
case LABCOMM_SAMPLE: {
env.println("labcomm_internal_decoder_index_to_signature(" +
"r->decoder, labcomm"+env.verStr+"_read_int(r));");
"r->decoder, labcomm2006_read_int(r));");
} break;
default: {
env.println("labcomm"+env.verStr+"_read_" + getName() + "(r);");
env.println("labcomm2006_read_" + getName() + "(r);");
}; break;
}
}
......@@ -580,7 +571,7 @@ aspect C_Decoder {
}
public void VariableSize.C_emitDecoderDecodeLimit(C_env env, int i) {
env.println(env.qualid + ".n_" + i + " = labcomm"+env.verStr+"_read_packed32(r);");
env.println(env.qualid + ".n_" + i + " = labcomm2006_read_int(r);");
}
public void ArrayType.C_emitDecoderDecodeLimit(C_env env) {
......@@ -594,7 +585,7 @@ aspect C_Decoder {
public void VariableArrayType.C_emitDecoderArrayAllocate(C_env env) {
env.print(env.qualid +
".a = labcomm"+env.verStr+"_memory_alloc(r->memory, 1, sizeof(" +
".a = labcomm2006_memory_alloc(r->memory, 1, sizeof(" +
env.qualid + ".a[0])");
for (int i = 0 ; i < getNumExp() ; i++) {
env.print(" * " + getExp(i).C_getLimit(env, i));
......@@ -612,7 +603,7 @@ aspect C_Decoder {
public void PrimType.C_emitDecoderDeallocation(C_env env) {
if (C_isDynamic()) {
env.println("labcomm"+env.verStr+"_memory_free(r->memory, 1, " +
env.println("labcomm2006_memory_free(r->memory, 1, " +
env.qualid + ");");
}
}
......@@ -658,7 +649,7 @@ aspect C_Decoder {
public void VariableArrayType.C_emitDecoderDeallocation(C_env env) {
super.C_emitDecoderDeallocation(env);
env.println("labcomm"+env.verStr+"_memory_free(r->memory, 1, " +
env.println("labcomm2006_memory_free(r->memory, 1, " +
env.qualid + ".a);");
}
......@@ -676,10 +667,10 @@ aspect C_Decoder {
}
public void SampleDecl.C_emitDecoderRegisterHandler(C_env env) {
env.println("int labcomm"+env.verStr+"_decoder_register_" +
env.println("int labcomm2006_decoder_register_" +
env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_decoder *d,");
env.println("struct labcomm2006_decoder *d,");
env.println("void (*handler)(");
env.indent();
env.println(env.prefix + getName() + " *v,");
......@@ -691,12 +682,12 @@ aspect C_Decoder {
env.println(")");
env.println("{");
env.indent();
env.println("return labcomm"+env.verStr+"_internal_decoder_register(");
env.println("return labcomm2006_internal_decoder_register(");
env.indent();
env.println("d,");
env.println("&signature_" + env.prefix + getName() + ",");
env.println("(labcomm"+env.verStr+"_decoder_function)decode_" + env.prefix + getName() + ",");
env.println("(labcomm"+env.verStr+"_handler_function)handler,");
env.println("(labcomm2006_decoder_function)decode_" + env.prefix + getName() + ",");
env.println("(labcomm2006_handler_function)handler,");
env.println("context");
env.unindent();
env.println(");");
......@@ -711,10 +702,10 @@ aspect C_copy {
private void SampleDecl.C_emitCopyFunctionParam(C_env env, String src,
String dst)
{
env.println("void labcomm" + env.verStr + "_copy_" +
env.println("void labcomm2006_copy_" +
env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm" + env.verStr + "_memory *mem,");
env.println("struct labcomm2006_memory *mem,");
env.println(env.prefix + getName() + " *" + dst + ",");
env.println(env.prefix + getName() + " *" + src);
env.unindent();
......@@ -765,9 +756,8 @@ aspect C_copy {
public void PrimType.C_emitCopy(C_env env_src, C_env env_dst) {
if (C_isDynamic()) {
env_src.println(String.format(
"%s%s = labcomm%s_memory_alloc(mem, 1, strlen(%s%s)+1);",
"%s%s = labcomm2006_memory_alloc(mem, 1, strlen(%s%s)+1);",
env_dst.accessor(), env_dst.qualid,
env_src.verStr,
env_src.accessor(), env_src.qualid));
env_src.println(String.format(
"memcpy(%s%s, %s%s, strlen(%s%s)+1);",
......@@ -843,8 +833,7 @@ aspect C_copy {
C_env env_dst)
{
env_src.print(env_dst.qualid + env_dst.memberAccessor() +
"a = labcomm" + env_src.verStr +
"_memory_alloc(mem, 1, sizeof(" +
"a = labcomm2006_memory_alloc(mem, 1, sizeof(" +
env_src.qualid + env_src.memberAccessor() + "a[0])");
for (int i = 0 ; i < getNumExp() ; i++) {
env_src.print(" * " + getExp(i).C_getLimit(env_src, i));
......@@ -857,10 +846,10 @@ aspect C_copy {
private void SampleDecl.C_emitCopyDeallocationFunctionParam(C_env env,
String par)
{
env.println("void labcomm" + env.verStr + "_copy_free_" +
env.println("void labcomm2006_copy_free_" +
env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm" + env.verStr + "_memory *mem,");
env.println("struct labcomm2006_memory *mem,");
env.println(env.prefix + getName() + " *" + par);
env.unindent();
env.print(")");
......@@ -907,7 +896,7 @@ aspect C_copy {
public void PrimType.C_emitCopyDeallocation(C_env env) {
if (C_isDynamic()) {
env.println("labcomm" + env.verStr + "_memory_free(mem, 1, " +
env.println("labcomm2006_memory_free(mem, 1, " +
env.accessor() + env.qualid + ");");
}
}
......@@ -953,7 +942,7 @@ aspect C_copy {
public void VariableArrayType.C_emitCopyDeallocation(C_env env) {
super.C_emitCopyDeallocation(env);
env.println("labcomm" + env.verStr + "_memory_free(mem, 1, " +
env.println("labcomm2006_memory_free(mem, 1, " +
env.qualid + env.memberAccessor() + "a);");
}
......@@ -975,9 +964,9 @@ aspect C_DecoderIoctl {
}
public void SampleDecl.C_emitDecoderIoctl(C_env env) {
env.println("int labcomm"+env.verStr+"_decoder_ioctl_" + env.prefix + getName() + "(");
env.println("int labcomm2006_decoder_ioctl_" + env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_decoder *d,");
env.println("struct labcomm2006_decoder *d,");
env.println("int ioctl_action,");
env.println("...");
env.unindent();
......@@ -987,7 +976,7 @@ aspect C_DecoderIoctl {
env.println("int result;");
env.println("va_list va;");
env.println("va_start(va, ioctl_action);");
env.println("result = labcomm"+env.verStr+"_internal_decoder_ioctl(");
env.println("result = labcomm2006_internal_decoder_ioctl(");
env.indent();
env.println("d, &signature_" + env.prefix + getName() + ", ");
env.println("ioctl_action, va);");
......@@ -1016,7 +1005,7 @@ aspect C_Encoder {
env = env.nestStruct("(*v)");
env.println("static int encode_" + env.prefix + getName() + "(");
env.indent();
env.println("struct labcomm"+env.verStr+"_writer *w");
env.println("struct labcomm2006_writer *w");
if(!isVoid() ) {
env.println(", "+env.prefix + getName() + " *v");
}
......@@ -1031,8 +1020,8 @@ aspect C_Encoder {
env.println("}");
// Typesafe encode wrapper
env.println("int labcomm"+env.verStr+"_encode_" + env.prefix + getName() + "(");
env.println("struct labcomm"+env.verStr+"_encoder *e");
env.println("int labcomm2006_encode_" + env.prefix + getName() + "(");
env.println("struct labcomm2006_encoder *e");
if(!isVoid() ) {
env.println(", "+env.prefix + getName() + " *v");
}
......@@ -1040,9 +1029,9 @@ aspect C_Encoder {
env.println(")");
env.println("{");
env.indent();
env.println("return labcomm"+env.verStr+"_internal_encode(e, &signature_" +
env.println("return labcomm2006_internal_encode(e, &signature_" +
env.prefix + getName() +
", (labcomm"+env.verStr+"_encoder_function)encode_" +