This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC-3.2.2 bootstrap FAILURE: 1 reduce/reduce conflict in objc-parse.y


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]