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: 9eb1172)
raw | patch | inline | side by side (parent: 9eb1172)
author | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 5 Jan 2014 20:40:19 +0000 (21:40 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 5 Jan 2014 20:40:19 +0000 (21:40 +0100) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index f05d271f4b8055b5fc4dc31220d2c3be48d50335..2f6aa8d944212439f6405405c04435bb7343c502 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
}
throw new Exception("Wrong opcode for a relation");
}
+
+ private boolean isJumpCode(int opcode) {
+ return (opcode>=jmp) && (opcode<=jge);
+ }
public void convertStream(InputStream ins) throws Exception{
mainIn = ins;
prl(getTopTwo());
prl("IF tempb "+ getRelationFor(op)
+" tempa THEN CALL a" + (counter + get2())
+ +" ELSE CALL a" + (counter+1)
+ " FI;");
break;
}
break;
}
+ boolean wasJump = isJumpCode(op);
op = get();
if (op >= 0)
- prl("CALL a" + counter + " END");
+ if (wasJump)
+ prl("SKIP END");
+ else
+ prl("CALL a" + counter + " END");
}
prl("CALL Z;\nSKIP END\nENDACTIONS;\n");
prl(getStandardEnd());