[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lojban] rp-expression-tail ordered choice with empty grouping
On Tue, Nov 23, 2010 at 10:52:11AM -0800, Robin Lee Powell wrote:
> On Tue, Nov 23, 2010 at 11:43:52AM -0700, .alyn.post. wrote:
> > What does the following production in the lojban grammar mean?:
> >
> > rp-expression-tail <- rp-expression operator rp-expression-tail /
> > ()
> >
> > Do I understand that to mean 'the sequence of rp-expression,
> > operator, and rp-expression-tail OR nothing?' Could the above
> > also be expressed:
> >
> > rp-expression-tail <- (rp-expression operator rp-expression-tail)?
> >
> > And if so, why the odd way of specifying it? I'm weak on pitfalls
> > of recursive behavior in grammars, am I looking at a workaround
> > related to that?
>
> Yes, and it mostly doesn't work. Lojban's RPN (which, if I have my
> druthers, the next version of the language will not have, by the
> way) is left-recursive, which is problematic. See the peg mailing
> list for various solutions, but IMO since a number of PEG parser
> generators handle this on their own, I think we should just have it
> be left-recursive and say that people have to use such a generator.
>
> If you can figure out how to fix it in in the rules so the right
> behaviour pops out, though, *please* do so. There are links to
> papers on the peg mailing list; it came up just last week; "*[1]*
> *Packrat Parsers Can Support Left Recursion*, Alessandro Warth,
> James R. Douglass, and Todd Millstein (2008)" is the citation I'm
> seeing at a brief glance.
>
Great. I saw that thread and ignored it as not being relevant in
the moment, but I'm happy to read it and play with it when I get to
that point.
I've downloaded the paper and cached it with this problem, as I'm a
bit ahead of myself with it.
-Alan
--
.i ko djuno fi le do sevzi
--
You received this message because you are subscribed to the Google Groups "lojban" group.
To post to this group, send email to lojban@googlegroups.com.
To unsubscribe from this group, send email to lojban+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lojban?hl=en.