diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-02-01 19:49:33 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-02-01 19:49:33 +0000 |
commit | 404ae0f284a3b2d41fcdb53826550e4dfec5c65c (patch) | |
tree | cc446af26234e4465b8cc168b720ec44816ff5ab /test/lhs1.lm | |
download | colm-tarball-master.tar.gz |
colm-0.12.0HEADcolm-0.12.0master
Diffstat (limited to 'test/lhs1.lm')
-rw-r--r-- | test/lhs1.lm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/lhs1.lm b/test/lhs1.lm new file mode 100644 index 0000000..f40297f --- /dev/null +++ b/test/lhs1.lm @@ -0,0 +1,42 @@ +##### LM ##### + +lex + ignore /space+/ + literal `* `( `) `! + token SEMI_NL /';\n'/ + token id /[a-zA-Z_0-9]+/ +end + +def item + [id] + { + lhs = cons item ["( " ^r1 " )"] + } +| [`( item* `)] + { + lhs = cons item ["( " ^r2 " )"] + } + +def A + [] { + print( 'A\n' ) + } + +def B + [] { + print( 'B\n' ) + } + +def start + [A item* `!] +| [B item* SEMI_NL] + +parse Start: start[ stdin ] +print( Start "\n" ) +##### IN ##### +a b c ( d1 d2 ) e f g ; +##### EXP ##### +A +B +( a )( b )( c )( ( d1 )( d2 ) )( e )( f )( g ); + |