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

Emit separate lists of typedefs and samples

parent 498b7ca0
No related branches found
No related tags found
No related merge requests found
......@@ -80,11 +80,19 @@ aspect Python_CodeGen {
env.println("import labcomm");
env.println();
Python_genTypes(env);
env.println("signatures = [");
env.println("typedef = [");
env.indent();
for (int i = 0 ; i < getNumDecl() ; i++) {
getDecl(i).Python_genTypedefListEntry(env);
}
env.unindent();
env.println("]");
env.println("sample = [");
env.indent();
for (int i = 0 ; i < getNumDecl() ; i++) {
env.println(" ('" + getDecl(i).getName() + "', " +
getDecl(i).getName() + ".signature),");
getDecl(i).Python_genSampleListEntry(env);
}
env.unindent();
env.println("]");
}
......@@ -109,7 +117,7 @@ aspect PythonTypes {
}
public void TypeDecl.Python_genSignature(Python_env env) {
env.println("no_signature = labcomm.typedef('" + getName() + "',");
env.println("signature = labcomm.typedef('" + getName() + "',");
env.indent();
getType().Python_genSignature(env);
env.unindent();
......@@ -181,6 +189,20 @@ aspect PythonTypes {
env.print(")");
}
public void Decl.Python_genTypedefListEntry(Python_env env) {
}
public void TypeDecl.Python_genTypedefListEntry(Python_env env) {
env.println("('" + getName() + "', " + getName() + ".signature),");
}
public void Decl.Python_genSampleListEntry(Python_env env) {
}
public void SampleDecl.Python_genSampleListEntry(Python_env env) {
env.println("('" + getName() + "', " + getName() + ".signature),");
}
public String Exp.Python_getValue() {
throw new Error(this.getClass().getName() +
".Python_getValue()" +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment