Package nothing; Helpers tab = 9; cr = 13; lf = 10; eol = [[cr + lf] + [cr + lf]]; white = [[' ' + tab] + eol]; lowercase = ['a' .. 'z']; uppercase = ['A' .. 'Z']; letter = [uppercase + lowercase]; digit = ['0'..'9']; id_part = lowercase (lowercase | digit)*; blank = (' ' | tab | eol)+; Tokens id = id_part ('_' id_part)*; minus = '-'; semicolon = ';'; letter = letter; tar = 'tar'; l_bkt = '['; r_bkt = ']'; blank = blank; Ignored Tokens /* These tokens are simply ignored by the parser. */ blank; /*****************/ Productions tar {-> grammar} = principal {-> New grammar(New tar(New anotherone( Null, []))) }; principal {->} = T.tar [f]:another letter [s]:another id {-> }; another {-> } = {-> } ; Abstract Syntax Tree grammar = P.tar; tar = anotherone; anotherone = id letter+ ;