diff options
Diffstat (limited to 'test/translate1.lm')
-rw-r--r-- | test/translate1.lm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/translate1.lm b/test/translate1.lm new file mode 100644 index 0000000..4403ca6 --- /dev/null +++ b/test/translate1.lm @@ -0,0 +1,28 @@ +##### LM ##### +lex + ignore /space+/ + literal `* `( `) + token id /[a-zA-Z_]+/ + { + t: str = input.pull( match_length ) + input.push( make_token( typeid<id> t ) ) + } +end + +def foo [id] + +def item + [id] +| [foo] +| [`( item* `)] + +def start + [item*] + +parse Input: start[ stdin ] +print( Input ) + +##### IN ##### +a b ( c d ) e f +##### EXP ##### +a b ( c d ) e f |