adds definitions to grammar and generates parser output