Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Erik Jansson
LabComm
Commits
4cc58e6c
Commit
4cc58e6c
authored
May 14, 2013
by
Anders Blomdell
Browse files
Emit separate lists of typedefs and samples
parent
498b7ca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/Python_CodeGen.jrag
View file @
4cc58e6c
...
...
@@ -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()" +
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment