gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8a984fa)
raw | patch | inline | side by side (parent: 8a984fa)
author | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 28 Jul 2014 13:11:06 +0000 (15:11 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Mon, 28 Jul 2014 13:11:06 +0000 (15:11 +0200) |
src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java | patch | blob | history |
diff --git a/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java b/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java
index 9a61bbf827dba89de8d19a6c2c8766625a39df01..f5bb3ea96b6e8aecd5f8cbb132f0876a193cdc8b 100644 (file)
ret.append("\nVAR <\n\t");
if (!genLocalVars){
ret.append("\n\ttempa := 0, tempb :=0, tempres := 0,");
- }
+ } else
+ ret.append("\n\tmjvm_flag_jump := 0,");
ret.append("mjvm_locals := ARRAY(1,0),");
ret.append("\n\tmjvm_statics := ARRAY("+numWords+",0),");
ret.append("\n\tmjvm_arrays := < >,");
- ret.append("\n\tmjvm_flag_jump := 0,");
ret.append("\n\tmjvm_objects := < >,");
ret.append("\n\tmjvm_estack := < >, mjvm_mstack := < > > :");
case jle:
case jgt:
case jge: {
- prl(createStartVar("tempa", "tempb"));
- prl(createTopTwoEStack());
- prl("IF tempb " + mjInput.getRelationFor(op)
- + " tempa THEN mjvm_flag_jump := 1"
- + " ELSE mjvm_flag_jump := 0"
- + " FI;");
- prl(createEndVar());
- prl("IF mjvm_flag_jump = 1 THEN CALL a"
- + (mjInput.getCounter() + mjInput.get2())
- + " ELSE CALL a" + (mjInput.getCounter() + 1)
- + " FI;");
-
+ if (genLocalVars) {
+ prl(createStartVar("tempa", "tempb"));
+ prl(createTopTwoEStack());
+ prl("IF tempb " + mjInput.getRelationFor(op)
+ + " tempa THEN mjvm_flag_jump := 1"
+ + " ELSE mjvm_flag_jump := 0"
+ + " FI;");
+ prl(createEndVar());
+ prl("IF mjvm_flag_jump = 1 THEN CALL a"
+ + (mjInput.getCounter() + mjInput.get2())
+ + " ELSE CALL a" + (mjInput.getCounter() + 1)
+ + " FI;");
+ } else {
+ prl(createTopTwoEStack());
+ prl("IF tempb " + mjInput.getRelationFor(op)
+ + " tempa THEN CALL a"
+ + (mjInput.getCounter() + mjInput.get2())
+ + " ELSE CALL a" + (mjInput.getCounter() + 1)
+ + " FI;");
+ }
break;
}