Skip to content

Commit a19f3bd

Browse files
committed
only first 'XXXList shows
1 parent 3bbbe65 commit a19f3bd

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

JavaFrontParser/test/example.jva

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ public class Main {
44

55
public static void Main() {
66
System.out.println("something in a string");
7-
System.out.println("something else in a string");
8-
if (true){System.out.println("something in if is a string");}
9-
for (i=0;i<2;i++){System.out.println("something in for is a string");}
7+
108
}
119

1210
}

JavaFrontParser/trans/starter.str

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ rules
8888
to-kast:
8989
x -> $[# [x](.KList)]
9090
where <is-int> x
91+
92+
to-kast:
93+
a#(b) -> $[[<to-kast-userlist> a#(b)]]
94+
where (!a => "SwitchLabelList")
9195

9296
to-kast:
9397
a#(b) -> $['[a](
@@ -118,6 +122,19 @@ rules
118122

119123

120124

125+
to-kast-userlist:
126+
a#([hd | tl]) -> $['[a]([<to-kast> hd],,
127+
[[<to-kast-userlist> a#(tl)]])]
128+
129+
130+
131+
132+
to-kast-userlist:
133+
a#([]) -> $[.[a]]
134+
135+
136+
137+
121138

122139
// lang -jar strategoxt.jar -i starter.str -o Ocl -la stratego-sglr --lib -I .. -p oclParser.lib --clean
123140
// lang -jar strategoxt.jar -i starter.str -o langParser -la stratego-sglr -I .. -m safecallcmd1 -p ro.uaic.info.fmse.parser

0 commit comments

Comments
 (0)