port of bnf parser from algorithms+data structures=programs