Talk:Tiki forum archive/Forum 5/6811

From Lojban

Source: 2013 Tiki forum 5, thread #6811. Original authors, UTC times, post IDs, and reply-parent IDs are preserved. This is an archive, not an active article discussion.

PEG left recursion

PEG left recursion

pdf23ds · 2008-06-17 16:43 UTC · Tiki post #6811

Use this thread to discuss the PEG left recursion page.

PEG left recursion

pdf23ds · 2008-06-17 16:43 UTC · Tiki post #6812 · reply to Tiki post #6811

The PEG grammar has some left-recursion issues that could be taken

care of if I implement support for left recursion in my parser. On the other hand, Rats!, which is what the grammar was initially written toward, and *many* other PEG parsers/parsegens don't support real left-recursion. So I don't know if we want the (eventual) official grammar to use a non-standard feature of a tool. But it wouldn't be a feature unique to my parser:

http://www.mail-archive.com/[email protected]/msg00096.html

Left recursion is a very desirable feature to have, even though it's hard to implement, so other parsers have it and will have it. (Rewriting doesn't count (ever, I think), because it creates parse trees that group things right-associatively even though they match the same inputs.)

Another worry would be that you actually have to change PEG semantics to do left recursion like this, and the change that needs to be made isn't obvious or unique, so it could end up that different PEG parsers implement different left recursion semantics that require slight modifications to lojban's grammar to use with it, which would be less than ideal.

Chris Capel -- "What is it like to be a bat? What is it like to bat a bee? What is it like to be a bee being batted? What is it like to be a batted bee?" -- The Mind's I (Hofstadter, Dennet)


To unsubscribe from this list, send mail to [email protected] with the subject unsubscribe, or go to http://www.lojban.org/lsg2/, or if

you're really stuck, send mail to [email protected] for help.