Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Commits
4cc58e6c
Commit
4cc58e6c
authored
11 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Emit separate lists of typedefs and samples
parent
498b7ca0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/Python_CodeGen.jrag
+26
-4
26 additions, 4 deletions
compiler/Python_CodeGen.jrag
with
26 additions
and
4 deletions
compiler/Python_CodeGen.jrag
+
26
−
4
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()" +
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment