lex literal '{', '}' literal 'struct', 'type' token id /[A-Za-z_][A-Za-z_0-9]*/ ignore /'/*' any* :>> '*/'/ ignore /[ \t\r\n]+/ end def attribute ['type' id] def struct ['struct' id '{' attribute* '}'] def program [struct*] int func( P: program ) { } int main() { InputFile: stream = open( 'func.in' "r" ) parse PP: program[ InputFile ] P: program = PP.tree func( P ) print( P '\n' ) } main()