diff options
Diffstat (limited to 'test/accum1.lm')
-rw-r--r-- | test/accum1.lm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/accum1.lm b/test/accum1.lm new file mode 100644 index 0000000..f4aa963 --- /dev/null +++ b/test/accum1.lm @@ -0,0 +1,36 @@ +##### LM ##### +lex + ignore /space+/ + literal `* `( `) + token id /[a-zA-Z_]+/ +end + +def item + [id] +| [`( item* `)] + +def start + [item*] + +parse Input: start[ stdin ] + +cons Output: accum<start> [] + +for Id: id in Input { + send Output + "( [^Id] ) +} + +S: start = Output() + +print( S ) +##### IN ##### +a b c ( chocolate fudge ) d e +##### EXP ##### +( a ) +( b ) +( c ) +( chocolate ) +( fudge ) +( d ) +( e ) |