> 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

Reply via email to