Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Generating LR syntax error messages from examples
Jeffery C. ACM Transactions on Programming Languages and Systems25 (5):631-640,2003.Type:Article
Date Reviewed: Jan 27 2004

Jeffery explains the need for a new type of error message generation system for LR parsers. Yet another compiler-compiler (YACC)-generated parsers support error messages by either adding error productions or synchronizing error diagnostics with parse states. The former approach is problematic: it clutters the grammar, inhibits manageability, and may cause cascading errors and detrimental reduce/reduce conflicts. The latter approach ties error messages directly to parse states, and introduces maintenance problems: as grammars change, parse states change. Different YACC implementations also represent a grammar with different parse states.

The author describes the meta error generator (MERR), which synchronizes error messages with parse states in YACC-generated parsers while keeping the two separate. MERR enables the compiler designer to specify code fragments and error messages to be generated by the parser when encountering these fragments. It generates a table of (state, token) pairs and associated error messages for the parser to output when a pair is encountered. Pairs not present in the table generate default error messages.

MERR is an attempt to raise the lowest common denominator. It succeeds, presenting a simple yet effective solution to problems in YACC-style error message generation. However, Jeffery overlooks the issue of whether MERR truly reduces maintenance problems, since as grammars change, some code fragments will likely become outdated.

The presentation in the paper is clear and concise, and uses effective examples, except in the few instances where LR parsing terms are used imprecisely, or where the author conflates MERRs use with YACC-style parser generators with other LR parser generators.

Reviewer:  John Colby Review #: CR129000 (0407-0830)
Bookmark and Share
 
Translator Writing Systems And Compiler Generators (D.3.4 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Translator Writing Systems And Compiler Generators": Date
The art of compiler design
Pittman T., Peters J., Prentice-Hall, Inc., Upper Saddle River, NJ, 1992. Type: Book (9780130481900)
Apr 1 1994
Compiler generation from denotational semantics
Paulson L., Cambridge University Press, New York, NY, 1984. Type: Book (9780521268431)
Jun 1 1985
Automatic compiler production: the front end
Reiss S. IEEE Transactions on Software Engineering SE-13(6): 609-627, 1987. Type: Article
Feb 1 1988
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy