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: ee2c9a7)
raw | patch | inline | side by side (parent: ee2c9a7)
author | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 27 May 2014 22:55:14 +0000 (00:55 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 27 May 2014 22:55:14 +0000 (00:55 +0200) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index a140ced71408bfadd294b01b0886ddd1cca168a7..113bfef0c197ae7d515ee65c9ada0209f9d20486 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
ret.append(createAsciiString());
- ret.append("\nBEGIN ");
- ret.append("\nVAR < \n\t");
- ret.append("mjvm_locals := ARRAY(1,0), ");
- ret.append("\n\tmjvm_statics := ARRAY("+numWords+",0), ");
- ret.append("\n\tmjvm_arrays := < >, ");
- ret.append("\n\tmjvm_objects := < >, ");
- ret.append("\n mjvm_estack := < >, mjvm_mstack := < > > : ");
+ ret.append("\nBEGIN");
+ ret.append("\nVAR <\n\t");
+ ret.append("mjvm_locals := ARRAY(1,0),");
+ ret.append("\n\tmjvm_statics := ARRAY("+numWords+",0),");
+ ret.append("\n\tmjvm_arrays := < >,");
+ ret.append("\n\tmjvm_objects := < >,");
+ ret.append("\n\tmjvm_estack := < >, mjvm_mstack := < > > :");
return ret.toString();
}
}
public String createStandardEnd(){
- StringBuilder ret = new StringBuilder("SKIP\nENDVAR");
+ StringBuilder ret = new StringBuilder("SKIP\nENDVAR\n");
ret.append("\nWHERE\n");
ret.append("\nFUNCT CHR(num) ==:\n");
ret.append("\nPROC Print_MJ_CHAR(val, format VAR)==\n");
ret.append(createComment("print spacing", C_SPEC));
ret.append("\n\tIF val=10 OR val=13 THEN\n");
- ret.append("\t\tPRINT(\"\");");
+ ret.append("\t\tPRINT(\"\");\n");
ret.append("\tELSE\n");
ret.append("\t\tIF format>1 THEN\n\t\t\tFOR i:=2 TO ");
ret.append("format STEP 1 DO PRINFLUSH(\" \") OD\n");
ret.append("\tFI\n");
ret.append("END\n");
- ret.append("\nEND\n");
+ ret.append("\nEND");
return ret.toString();
}
prl("SKIP;\n ACTIONS a" + (14 + mainAdr) + " :");
int op = get();
while (op >= 0) {
- prl(" a" + counter + " == ");
+ prl(" a" + counter + " ==");
if (originalInComments)
prl(createComment(describeOpCode(op), C_OC));
if (genPrintForEachAddress) {
prl("CALL a" + counter + "\n END");
}
prl("SKIP\n END\nENDACTIONS;\n");
- prl(createStandardEnd());
+ pr(createStandardEnd());
}
public void convertFile(File f) {