lex token id /[a-z]+/ ignore /[ \t\n]/ literal `; token PLUS /'+'/ { input->pull( match_length ) parse S: stmt "there is more;" input->push( S ) input->push( "; " ) } end def stmt [id* `;] def main [stmt+] parse M: main [stdin] print "parsed tree [M] "<- ##### IN ##### a b + c d; ##### EXP ##### parsed tree a b ; there is more; c d; <-