The Implementation of the Icon Programming Language. Available online at Source files c-parse.y and java/parse.y were used in this paper. GNU C Compiler Source Distribution Version 3.0. Merr enables useful syntax error messages in LR-based compilers in a manner that is robust in the presence of grammar changes. From a specification of errors and messages, Merr runs the compiler on each example error to obtain the relevant parse state and input token, and generates a yyerror() function that maps parse states and input tokens to diagnostic messages. Merr is a tool that allows a compiler writer to associate diagnostic messages with syntax errors by example, avoiding the need to add error productions to the grammar or interpret integer parse states. Unfortunately, every change to the grammar may significantly alter the mapping from parse states to diagnostic messages, creating a maintenance problem. Interpreting the parse state (and input token) at the time of error is a nonintrusive alternative that does not entangle the error recovery mechanism in error message production. Many compilers incur extensive modifications to the source grammar to produce useful syntax error messages. LR parser generators are powerful and well-understood, but the parsers they generate are not suited to provide good error messages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |