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: Paolo Bonzini <paolo dot bonzini at polimi dot it>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 28 Jan 2003 13:28:02 +0100
- Subject: Re: GCC-3.2.2 bootstrap FAILURE: 1 reduce/reduce conflict in objc-parse.y
- Reply-to: bonzini at gnu dot org
> I'm not the maintainer, but the patch is wrong. One cannot replace
> 'protocolrefs' with 'non_empty_protocolrefs', as they are optional.
Right. Then the solution is to add a special non-terminal to identify an
identifier_list of at least two identifiers.
! /* The @protocol forward-declaration production introduces a
! reduce/reduce conflict on ';', which should be resolved in
! favor of the production 'identifier_list -> identifier'. */
! | PROTOCOL identifier_list ';'
! {
! objc_declare_protocols ($2);
! }
This is never reduced if identifier_list is a single identifier.
The 3.2 and 3.3 branch solution might be simply to remove %expect, but
something else should be done on mainline (possibly 3.3 too).
While I agree in principle that reduce/reduce conflicts are bugs,
they are often (like in this case) problems in the language spec
which is not really LR(1). Bison should have an option for
"%expect" to specify the count of RR conflicts in the grammar;
new Bisons use a Bison grammar and the change should be
quite simple.
Paolo