Sergio and Peter: I am interested in this topic.
I have been using an implementation that is quite a bit simpler than Warth etal. It has no problem with their test case grammar (after fixing their typo error). I have a draft note on how it works that I can pull out and clean up for anyone interested. But now I see Peter Goodman's grammar! Matching: "dcccbbaaa" etal works fine, but I'm not sure what other strings this grammar should match.... Peter, do you have a formula or some test case examples? Cheers, Peter Cashin. On Wed, Nov 18, 2009 at 12:30 PM, Peter Goodman <peter.good...@gmail.com>wrote: > Sérgio, > > I am quite interested in these semantics. I developed a PEG parser in > C earlier this year as a part of a personal project and I attempted to > come up with my own left recursive handling loosely based off of Warth > et al. but I always had problems with cases such as: > > A <- A 'a' > <- B > > B <- B 'b' > <- A > <- C > > C <- C 'c' > <- B > <- 'd'. > > That is a fairly contrived example, however, the main problems I had > that I eventually could not overcome was with the > intertwining/braiding of A and B. If your semantics are able to > properly handle such awful grammars then I think that would be > excellent and I would be really interested in reading more in-depth > into them. > > Best Regards, > > Peter Goodman, > http://ioreader.com > 70 Winston Circle, > Montreal, Quebec > H9S 4X6 > > > > 2009/11/17 Sérgio Medeiros <tamp...@yahoo.com>: > >> Is there any more recent work that I should be aware of that corrects > this? > > > > > > I am studying left-recursion on PEGs and I am working on a new > operational > > semantics for PEGs that gives meaning for left-recursive rules in a > grammar, > > so it is another approach. > > > > It has some in common with the approach of Warth et al., but I think it > is > > simpler. > > > > The basic idea is based on the expansion of a nonterminal. Given the > > definition: > > A <- A 'a' / 'b' > > > > The expansion of A is as follows: > > A^0 = fail > > A^1 = A^0 'a' / 'b' > > A^2 = A^1 'a' / 'b' > > A^3 = A^2 'a' / 'b' > > ... > > > > A nonterminal (left-recursive or not) should keep expanding while the > > result of the matching increases, where expansion A^n uses the > > previous result of the matching of expansion A^(n-1) > > > > Given the input "bac" > > match A^0 = fail > > match A^1 = "b" > > match A^2 = "ba" > > match A^3 = "b" (stops here) > > > > The result of the matching of A against input "bac" is "ba". > > > > I have a draft of this semantics and I also can give a lengthier > > explanation if somebody is interested on it. > > > > Sérgio > > > > > > > > ____________________________________________________________________________________ > > Veja quais são os assuntos do momento no Yahoo! +Buscados > > http://br.maisbuscados.yahoo.com > > > > _______________________________________________ > > PEG mailing list > > PEG@lists.csail.mit.edu > > https://lists.csail.mit.edu/mailman/listinfo/peg > > > > _______________________________________________ > PEG mailing list > PEG@lists.csail.mit.edu > https://lists.csail.mit.edu/mailman/listinfo/peg >
_______________________________________________ PEG mailing list PEG@lists.csail.mit.edu https://lists.csail.mit.edu/mailman/listinfo/peg