Skip to content
Snippets Groups Projects
Commit e29ea626 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Made --cprefix= omit extraneous '_' in generated names.

C typeinfo now includes the cprefix. 
parent 36839bac
Branches
Tags
No related merge requests found
...@@ -46,7 +46,11 @@ aspect C_CodeGenEnv { ...@@ -46,7 +46,11 @@ aspect C_CodeGenEnv {
this.qualid = qualid; this.qualid = qualid;
this.lcName = lcName; this.lcName = lcName;
this.rawPrefix = rawPrefix; this.rawPrefix = rawPrefix;
if (rawPrefix.equals("")) {
this.prefix = rawPrefix;
} else {
this.prefix = rawPrefix + "_"; this.prefix = rawPrefix + "_";
}
this.indent = indent; this.indent = indent;
this.depth = depth; this.depth = depth;
this.printer = printer; this.printer = printer;
...@@ -57,7 +61,11 @@ aspect C_CodeGenEnv { ...@@ -57,7 +61,11 @@ aspect C_CodeGenEnv {
this.qualid = qualid; this.qualid = qualid;
this.lcName = lcName; this.lcName = lcName;
this.rawPrefix = rawPrefix; this.rawPrefix = rawPrefix;
if (rawPrefix.equals("")) {
this.prefix = rawPrefix;
} else {
this.prefix = rawPrefix + "_"; this.prefix = rawPrefix + "_";
}
this.depth = 0; this.depth = 0;
this.indent = 0; this.indent = 0;
this.printer = new C_printer(out); this.printer = new C_printer(out);
...@@ -641,7 +649,7 @@ aspect C_Encoder { ...@@ -641,7 +649,7 @@ aspect C_Encoder {
env.println(")"); env.println(")");
env.println("{"); env.println("{");
env.indent(); env.indent();
env.println("int result;"); env.println("int result = 0;");
getType().C_emitEncoder(env); getType().C_emitEncoder(env);
env.println("return result;"); env.println("return result;");
env.unindent(); env.unindent();
...@@ -1094,11 +1102,13 @@ aspect C_Info { ...@@ -1094,11 +1102,13 @@ aspect C_Info {
} }
public void TypeDecl.C_info(C_env env) { public void TypeDecl.C_info(C_env env) {
env.println("C,typedef," + getName() + "," + getName()); env.println("C,typedef," + env.prefix + getName() + "," +
env.prefix + getName());
} }
public void SampleDecl.C_info(C_env env) { public void SampleDecl.C_info(C_env env) {
env.println("C,sample," + getName() + "," + getName()); env.println("C,sample," + env.prefix + getName() + "," +
env.prefix + getName());
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment