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: 9a00b56)
raw | patch | inline | side by side (parent: 9a00b56)
author | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 8 Jan 2014 16:29:51 +0000 (17:29 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 8 Jan 2014 16:29:51 +0000 (17:29 +0100) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index 65b6348cf19b08e6e239f10510daf14464b3a69a..886cd7d3ba0588bb4f413d5362e8e378c1b045e3 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
}
private boolean addPauseAfterEachAddress=false,
- addPrintForEachAddress = false;
+ addPrintForEachAddress = false,
+ genPrintEStackOnChange = false;
/** Constant used for marking a regular comment from the original file */
public static final char C_REG = ' ';
//Expression stack
private String cmdToEStack(int i) {
- return "mjvm_estack := <" + i + " > ++ mjvm_estack;";
+ String res = "mjvm_estack := <" + i + " > ++ mjvm_estack;";
+ if (genPrintEStackOnChange) res +="PRINT(\"eStack\",mjvm_estack);";
+ return res;
}
private String cmdToEStack(String i) {
- return "mjvm_estack := <" + i + " > ++ mjvm_estack;";
+ String res = "mjvm_estack := <" + i + " > ++ mjvm_estack;";
+ if (genPrintEStackOnChange) res +="PRINT(\"eStack\",mjvm_estack);";
+ return res;
}
private String cmdFromEStack(String st) {
- return st + " := HEAD(mjvm_estack); mjvm_estack := TAIL(mjvm_estack);";
+ String res = st + " := HEAD(mjvm_estack); mjvm_estack := TAIL(mjvm_estack);";
+ if (genPrintEStackOnChange) res +="PRINT(\"eStack\",mjvm_estack);";
+ return res;
}
private String getTopTwo(){
originalInComments = args[i].charAt(4) == '+';
else
originalInComments = true;
- } else if (args[i].startsWith("--screen")) {
+ } else if (args[i].compareTo("--screen") == 0) {
out = new PrintWriter(System.out);
} else if (args[i].compareTo("-d") == 0) {
printLevel = M_DEB;//print debug info
} else if (args[i].compareTo("-v") == 0) {
printLevel = M_WAR;//print warnings
} else if (args[i].compareTo("-q") == 0) {
- printLevel = M_ERR+1;//no printing
- }
- i++;
+ printLevel = M_ERR+1;//no printing
+ } else if (args[i].compareToIgnoreCase("--genEStackPrint") == 0) {
+ genPrintEStackOnChange = true;
+ } else if (args[i].compareToIgnoreCase("--genAll") == 0) {
+ genPrintEStackOnChange = true;
+ addPrintForEachAddress = true;
+ addPauseAfterEachAddress = true;
+ }i++;
}
if (i >= args.length) {