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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Sven Gestegård Robertz
LabComm
Commits
e4624ac2
Commit
e4624ac2
authored
13 years ago
by
Sven Robertz
Browse files
Options
Downloads
Patches
Plain Diff
applied old patch for block structure in the generated code fixing name clashes
parent
713c78f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CS_CodeGen.jrag
+16
-4
16 additions, 4 deletions
CS_CodeGen.jrag
Java_CodeGen.jrag
+16
-4
16 additions, 4 deletions
Java_CodeGen.jrag
with
32 additions
and
8 deletions
CS_CodeGen.jrag
+
16
−
4
View file @
e4624ac2
...
...
@@ -23,6 +23,10 @@ aspect CS_CodeGenEnv {
public CS_printer(File f) {
file = f;
File parentFile = f.getParentFile();
if(parentFile != null) {
parentFile.mkdirs();
}
}
public CS_printer(PrintStream out) {
...
...
@@ -140,6 +144,16 @@ aspect CS_CodeGenEnv {
println("}");
}
public void print_block_begin() {
println("{");
indent();
}
public void print_block_end() {
unindent();
println("}");
}
public String getUnique(Object o) {
String result = (String)unique.get(o);
if (result == null) {
...
...
@@ -419,8 +433,7 @@ aspect CS_Class {
for (int i = 0 ; i < getNumExp() ; i++) {
String limit = getExp(i).CS_emitEncoder(env,
name + ".GetLength(" + i + ")");
env.println("{");
env.indent();
env.print_block_begin();
env.println("int i_" + (baseDepth + i) + "_max = " + limit + ";");
}
String index = null;
...
...
@@ -435,9 +448,8 @@ aspect CS_Class {
getType().CS_emitEncoder(env, name + "[" + index + "]");
for (int i = 0 ; i < getNumExp() ; i++) {
env.print_for_end();
env.print_block_end();
}
env.unindent();
env.println("}");
}
public String Exp.CS_emitEncoder(CS_env env, String name) {
...
...
This diff is collapsed.
Click to expand it.
Java_CodeGen.jrag
+
16
−
4
View file @
e4624ac2
...
...
@@ -23,6 +23,10 @@ aspect Java_CodeGenEnv {
public Java_printer(File f) {
file = f;
File parentFile = f.getParentFile();
if(parentFile != null) {
parentFile.mkdirs();
}
}
public Java_printer(PrintStream out) {
...
...
@@ -140,6 +144,16 @@ aspect Java_CodeGenEnv {
println("}");
}
public void print_block_begin() {
println("{");
indent();
}
public void print_block_end() {
unindent();
println("}");
}
public String getUnique(Object o) {
String result = (String)unique.get(o);
if (result == null) {
...
...
@@ -445,8 +459,7 @@ aspect Java_Class {
String prefix = "";
for (int i = 0 ; i < getNumExp() ; i++) {
String limit = getExp(i).Java_emitEncoder(env, name + prefix);
env.println("{");
env.indent();
env.print_block_begin();
env.println("int i_" + (baseDepth + i) + "_max = " + limit + ";");
prefix = prefix + "[0]";
}
...
...
@@ -457,9 +470,8 @@ aspect Java_Class {
getType().Java_emitEncoder(env, name);
for (int i = 0 ; i < getNumExp() ; i++) {
env.print_for_end();
env.print_block_end();
}
env.unindent();
env.println("}");
}
public String Exp.Java_emitEncoder(Java_env env, String name) {
...
...
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