Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Terence Parr <parrt <at> cs.usfca.edu>
Subject: Re: Ambiguity
Newsgroups: gmane.comp.parsers.peg.general
Date: Wednesday 18th October 2006 17:02:03 UTC (over 10 years ago)
On Oct 18, 2006, at 6:45 AM, David Mercer wrote:

> This is just my opinion, and does not require any reply, but in my  
> opinion, PEG’s are superior to CFG’s because PEG’s do not allow you
 
> to define an ambiguous grammar.  Practical data languages are never  
> ambiguous.  If you ever find yourself defending PEG’s vs. other  
> grammar models, you can quote me on that. J
Hi David. :)  Yes, but just because something is unambiguous, doesn't  
mean you get what you expect.  Recall the dreaded:

A -> a
A -> ab

problem where the second alt is unreachable.  A CFG will deal with  
this no problem.  This problem occurs in real grammars I find, after  
having built a Java and C grammar using ANTLR's hybrid LL(*)/PEG  
strategy.  It would be worse with straight PEG.  My LL(*) found some  
errors in Grimm's Java grammar, but in general I believe he would  
disagree that it's a serious problem.

I merely point out that it is an issue in the wild; the size of the  
problem is open to debate.  You can quote me on that. ;)

Ter
 
CD: 3ms