This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC-3.2.2 bootstrap FAILURE: 1 reduce/reduce conflict in objc-parse.y
- From: Ziemowit Laski <zlaski at apple dot com>
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Cc: Gabriel Dos_Reis <gdosreis at sophia dot inria dot fr>, gcc-bugs at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Tue, 28 Jan 2003 16:49:50 -0800
- Subject: Re: GCC-3.2.2 bootstrap FAILURE: 1 reduce/reduce conflict in objc-parse.y
On Tuesday, Jan 28, 2003, at 15:38 US/Pacific, Joseph S. Myers wrote:
On Tue, 28 Jan 2003, Ziemowit Laski wrote:
I respectfully part company. :-) The grammar must, first and
foremost, be readable and maintainable. Why else would one use a
parser generator in the first place?
Maintainability is the reason to avoid parser conflicts. Every change
to
a parser that changes the number of conflicts requires all the
conflicts
to be examined carefully to ensure that the parser will parse
correctly in
each case and that no conflicts have been added without good reason.
If one's _adding_ a new conflict, then I agree that one must be careful.
Ensuring that the "parser will parse correctly in each case" has a
slight
"halting problem" flavor to it (esp. since we don't know if it parsed
things correctly to begin with); still, one should at least add a
comment
in the grammar explaining what the conflict is and how it _should_ be
be resolved (lest the user move around the rules!).
In the case at hand, though, the reduce/reduce conflict has been there
for generations... :-)
--Zem
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477