Re: Bison Parser negate production rules

George Neuner <gneuner2@comcast.net>
27 Mar 2007 09:28:24 -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: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: 27 Mar 2007 09:28:24 -0400
Organization: Compilers Central
References: 07-03-084 07-03-090 07-03-094
Keywords: parse, LR(1)
Posted-Date: 27 Mar 2007 09:28:24 EDT

On 26 Mar 2007 14:26:17 -0400, Chris F Clark
<cfc@shell01.TheWorld.com> wrote:


>Now, the "modern" parsing methodologies like GLR, PEGs, and predicated
>grammars are closed under complement, so if you use a technique like
>that, you can add a NOT rule and still create a parser.


I'd appreciate some references.


It seems to me that the complement of a rule can't be concretely
defined without limiting the universe to those token strings which
would be legal in the language defined by the complete set of rules.


It also seems that with such limitation, the complemented rule should
be parsable using the same model given sufficient lookahead. That is,
the restriction means the complement subset is just the language minus
the subset which is the rule.




>In fact, Yacc++ can be thought of as taking Yacc/Bison and adding in
>regular expressions and predicates (then cleaning up the syntax a
>little). In it we have a not predicate that allows exactly what you
>are asking for. You will find similar functionality in PCCTS/ANTLR
>although the underlying technology is LL not LR for them, so you
>cannot use left recursion (or precedence rules).


I'm not familiar with Yacc++, but I do use ANTLR and I was unaware
that it has this capability and I don't see any (obvious) syntax for
it in the manual. Do you have a cite or an example?


George
--


Post a followup to this message

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