13 // output "s2:{s2:{s0 s0} x}";
14 // output "s2:{s0 x}";
24 output "1:{{a b} {c}}";
27 ids = "1":: id (" " ids &~ id ~[]*)
28 | "2":: id ( ids &~ id ~[]*)
36 output "2:{{a} 1:{{b} {c}}}";
37 output "1:{{a b} {c}}";
40 ids = "1":: id " " ids
73 output "xbx:{{a} abab:{a b} {b}}";
83 output "ac:{{2 1 2 1}}";
84 //output "a:{{2 1 2 1}}";
85 //output "c:{{c:{1 1} c:{1 1}}}";
98 c = ("c":: x "2" x "1")*
104 output "bam:{a bam:{a bam:{a x:{x}}}}";
114 output "s2:{b0 a:{a:{epsilon}}}";
115 output "b:{a:{a:{epsilon}} epsilon}";
126 output "q:{a:{s1:{epsilon}}}";
136 output "s1:{a2:{a2:{a0 b0} b0}}";
147 output "s3:{s3:{epsilon a0 epsilon epsilon} epsilon epsilon epsilon}";
148 output "s3:{s3:{epsilon epsilon epsilon epsilon} a0 epsilon epsilon}";
149 output "s3:{s3:{epsilon epsilon a0 epsilon} epsilon epsilon epsilon}";
150 output "s3:{s3:{epsilon epsilon epsilon a0} epsilon epsilon epsilon}";
151 output "s3:{epsilon epsilon a0 a0}";
152 output "s3:{s3:{s3:{epsilon epsilon epsilon epsilon} epsilon epsilon epsilon} epsilon epsilon epsilon}";
153 output "s3:{s3:{epsilon epsilon epsilon epsilon} epsilon epsilon a0}";
154 output "s3:{s3:{epsilon epsilon epsilon epsilon} epsilon a0 epsilon}";
155 output "s3:{epsilon a0 epsilon a0}";
156 output "s3:{epsilon a0 a0 epsilon}";
166 output "poo:{poo:{poox poox} poox}";
167 output "poo:{poox poo:{poox poox}}";
174 output "s:{aa:{aa:{a b} b}}";
183 output "sx:{b aa:{aa:{b b} b}}";
194 output "+:{{a} *:{{b} {c}}}";
206 output "plus:{stringify:{{a}} minus:{stringify:{{b}} times:{stringify:{{d}} stringify:{{c}}}}}";
207 output "times:{plus:{stringify:{{a}} minus:{stringify:{{b}} stringify:{{d}}}} stringify:{{c}}}";
208 output "plus:{stringify:{{a}} times:{minus:{stringify:{{b}} stringify:{{d}}} stringify:{{c}}}}";
209 output "times:{minus:{plus:{stringify:{{a}} stringify:{{b}}} stringify:{{d}}} stringify:{{c}}}";
210 output "minus:{plus:{stringify:{{a}} stringify:{{b}}} times:{stringify:{{d}} stringify:{{c}}}}";
221 id = stringify:: idl++
227 // output "times:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}";
230 // s = l "=" r => "assign"
233 // | l "=" r => "assign"
234 // | r "+" r => "plus"
235 // | (r) "*" r => "times"
238 // id = idl++ => "stringify"
244 output "plus:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}";
255 id = stringify:: idl++
261 output "{q:{{a a}} q:{{b b}}}";
288 // output "smt:{while:{>:{{x} {0}} while:{>:{{y} {0}} sbb:{{f o o} {b a r}}}} while:{>:{{x} {0}} sbb:{while:{>:{{y} {0}} {f o o}} {b a r}}}}";
291 //outdent ! = " " outdent " "
294 //w ! = " " | "\n" | "\r"
300 //s = ws statement ws statement ws => smt
302 //block = "\n" indent blockBody
303 // &~ "\n" outdent ~[\ ] ~[]*
305 //blockBody = statement
306 // > statement ws blockBody => "sbb"
309 // | ^"while" expr block /ws
313 // | expr ^">" expr /ws
316 //call = expr "()" /ws
320 //ident = [a-z]++ &~ keyword
321 //keyword = "if" | "then" | "else" | "while"
333 q = a3:: [a-z] [a-z] [a-z]
341 s = s:: [a-z] [a-z] [a-z] " "*
347 output "Plus:{left:{Foo} right:{{2}}}";
351 | Plus:: left:Expra "+" right:Expr
352 Expra = Foo:: ("a" | "b")