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) |
[1 later articles] |
From: | George Neuner <gneuner2@comcast.net> |
Newsgroups: | comp.compilers |
Date: | 26 Mar 2007 09:13:38 -0400 |
Organization: | Compilers Central |
References: | 07-03-084 |
Keywords: | yacc, parse |
Posted-Date: | 26 Mar 2007 09:13:38 EDT |
On 23 Mar 2007 22:16:22 -0400, royzlife@gmail.com wrote:
>Can any one help in explaining how to negate a production rule in
>Bison parser?
>e.g A:B
> B: C
> |D
> |E
> (here i want to write a block of statements or rules which will be
>executed if B doesnt match to C/D/E.)
>
>[Basically, you can't other than by enumerating all of the other
>possibilities. What do you really want to do here? -John]
There is no way to specify the complement of a rule because it isn't a
terribly useful thing to do. Context free languages are drawn from an
infinite set of strings, the complement of any particular subset of a
language is also an infinite set of strings. Not very practical to
match.
If you can tell us more about what you are trying to do, we might be
able to suggest some alternatives.
George
Return to the
comp.compilers page.
Search the
comp.compilers archives again.