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: 70a6333)
raw | patch | inline | side by side (parent: 70a6333)
author | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 4 Nov 2012 21:02:45 +0000 (22:02 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 4 Nov 2012 21:02:45 +0000 (22:02 +0100) |
mjc2wsl.java | patch | blob | history | |
samples/sample0.wsl | patch | blob | history |
diff --git a/mjc2wsl.java b/mjc2wsl.java
index 7146de30c40877d268aab4e2db0ca385ee2b8478..77d1c2816e49705fcc0f29cd1f363ca0891025e6 100644 (file)
--- a/mjc2wsl.java
+++ b/mjc2wsl.java
private InputStream mainIn;
private PrintWriter out = null;
- private int counter = 0;
+ private int counter = -1;
private void pr(int i){
out.print(i);
for (int i=0;i<14;i++) get();
prl(getStandardStart());
- prl("SKIP;\n ACTIONS A_S_start:\n A_S_start == CALL a15 END");
+ prl("SKIP;\n ACTIONS A_S_start:\n A_S_start == CALL a14 END");
int op = get();
while (op>=0){
if (originalInComments) prl(createComment(""+op,C_OC));
diff --git a/samples/sample0.wsl b/samples/sample0.wsl
index cc20ab3e9b05c75dd56df37cb07734eefa4c1841..7fcb0243c21c4fc44675ff628492eeb8a58547ff 100644 (file)
--- a/samples/sample0.wsl
+++ b/samples/sample0.wsl
C:" This file automatically converted from microjava bytecode";
-C:" with mjc2wsl v 0.1";
+C:" with mjc2wsl v 0.1.2";
VAR < tempa := 0, tempb := 0, tempres :=0,
loc0 := 0, loc1 := 0, loc2 := 0, loc3 := 0,
estack := < >, t_e_m_p := 0 > :
SKIP;
ACTIONS A_S_start:
A_S_start == CALL a14 END
-a15 ==
+a14 ==
C:" enter not fully procesed yet";
+CALL a17 END
+a17 ==
+estack := <0 > ++ estack;
CALL a18 END
a18 ==
-estack := <0 > ++ estack;
+loc0 := HEAD(estack); estack := TAIL(estack);
CALL a19 END
a19 ==
-loc0 := HEAD(estack); estack := TAIL(estack);
+estack := <loc0 > ++ estack;
CALL a20 END
a20 ==
-estack := <loc0 > ++ estack;
+estack := <5 > ++ estack;
CALL a21 END
a21 ==
-estack := <5 > ++ estack;
-CALL a22 END
-a22 ==
tempa := HEAD(estack); estack := TAIL(estack);
tempb := HEAD(estack); estack := TAIL(estack);
-IF tempb >= tempa THEN CALL a35 FI;
+IF tempb >= tempa THEN CALL a34 FI;
+CALL a24 END
+a24 ==
+estack := <loc0 > ++ estack;
CALL a25 END
a25 ==
-estack := <loc0 > ++ estack;
+estack := <0 > ++ estack;
CALL a26 END
a26 ==
-estack := <0 > ++ estack;
-CALL a27 END
-a27 ==
tempa := HEAD(estack); estack := TAIL(estack);
tempb := HEAD(estack); estack := TAIL(estack);
PRINT(tempb);
+CALL a27 END
+a27 ==
+estack := <loc0 > ++ estack;
CALL a28 END
a28 ==
-estack := <loc0 > ++ estack;
+estack := <1 > ++ estack;
CALL a29 END
a29 ==
-estack := <1 > ++ estack;
-CALL a30 END
-a30 ==
tempa := HEAD(estack); estack := TAIL(estack);
tempb := HEAD(estack); estack := TAIL(estack);
tempres := tempb + tempa;
estack := <tempres > ++ estack;
+CALL a30 END
+a30 ==
+loc0 := HEAD(estack); estack := TAIL(estack);
CALL a31 END
a31 ==
-loc0 := HEAD(estack); estack := TAIL(estack);
-CALL a32 END
-a32 ==
-CALL a20;
+CALL a19;
+CALL a34 END
+a34 ==
+C:" exit not fully procesed yet";
CALL a35 END
a35 ==
-C:" exit not fully procesed yet";
-CALL a36 END
-a36 ==
C:" return not fully procesed yet";
CALL Z;
SKIP END