[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lojban] Re: PEG left recursive definitions
On Tue, Oct 30, 2007 at 07:44:38PM -0500, Chris Capel wrote:
> Does the PEG currently use left recursive definitions?
The *only* place in Lojban that is unavoidably left-recursive is the
RPN mekso stuff.
> If not, would it be helpful if it could? For instance. Example
> input:
>
> x ? x : x
>
> To parse this, we could write
>
> expr <- tri-cond / x
> tri-cond <- expr '?' expr ':' expr
> x <- 'x'
>
> This would be translated to
>
> expr-1 <- x
> tri-cond <- expr-1 '?' expr ':' expr / expr-1
> expr <- tri-cond / expr-1
> x <- 'x'
If you can show me how to fix the RPN productions in my PEG, I'd
really appreciate it; I never quite got it right. It parses IFF it
should parse, but the resulting tree is wrong.
-Robin
--
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
To unsubscribe from this list, send mail to lojban-list-request@lojban.org
with the subject unsubscribe, or go to http://www.lojban.org/lsg2/, or if
you're really stuck, send mail to secretary@lojban.org for help.