Re: Bison Parser negate production rules

"mco333" <mco333@sympatico.ca>
27 Mar 2007 09:27:57 -0400

          From comp.compilers

Related articles
Bison Parser negate production rules royzlife@gmail.com (2007-03-23)
Re: Bison Parser negate production rules gneuner2@comcast.net (George Neuner) (2007-03-26)
Re: Bison Parser negate production rules cfc@shell01.TheWorld.com (Chris F Clark) (2007-03-26)
Re: Bison Parser negate production rules mco333@sympatico.ca (mco333) (2007-03-27)
Re: Bison Parser negate production rules gneuner2@comcast.net (George Neuner) (2007-03-27)
Re: Bison Parser negate production rules cfc@shell01.TheWorld.com (Chris F Clark) (2007-03-29)
Re: Bison Parser negate production rules Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2007-03-29)
Re: Bison Parser negate production rules gneuner2@comcast.net (George Neuner) (2007-03-29)
Re: Bison Parser negate production rules cfc@shell01.TheWorld.com (Chris F Clark) (2007-04-02)
| List of all articles for this month |
From: "mco333" <mco333@sympatico.ca>
Newsgroups: comp.compilers
Date: 27 Mar 2007 09:27:57 -0400
Organization: SunSITE.dk - Supporting Open source
References: 07-03-084
Keywords: parse, yacc
Posted-Date: 27 Mar 2007 09:27:57 EDT

May be you are after an error recovery procedure.
If so, then


    X : Y
        | U
        | error <read the doc>
        ;


will do the job. This does not negate the productions,
but is executed if X does not match Y or U.


This is documented in the Bison documentation.
eg:
http://www.slac.stanford.edu/comp/unix/gnu-info/bison_9.html



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.