[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lojban] questions about peg grammar
On Fri, Oct 29, 2010 at 03:36:09PM -0400, Luke Bergen wrote:
> Ok, so I'm trying to get a feel for how the peg grammar handles lujvo so
> that I can make my parser be as close to the real deal as possible (i.e.
> not a sloppy hack). I have a question though. I think the relevant section
> that I want to understand is the following, correct?
> ;-----------------------------------------------------------------------------------------------------------------------------------------
> lujvo <- !gismu !fuhivla !cmavo initial-rafsi* brivla-core
> brivla-core <- fuhivla / gismu / CVV-final-rafsi / stressed-initial-rafsi
> short-final-rafsi
> stressed-initial-rafsi <- stressed-extended-rafsi / stressed-y-rafsi /
> stressed-y-less-rafsi
> initial-rafsi <- extended-rafsi / y-rafsi / !any-extended-rafsi
> y-less-rafsi
> any-extended-rafsi <- fuhivla / extended-rafsi / stressed-extended-rafsi
> ;-----------------------------------------------------------------------------------------------------------------------------------------
> Now, I may be reading this incorrectly, but wouldn't this mean that an
> initial rafsi followed by a fuhivla would be considered a lujvo? i.e.
> {bracidrspageti}?
>
This is a bit tricky.
Look at the early part of the lujvo definition, and you can see
there is a predicate-not operation saying "it can't have a fuhivla"
(That is the !fuhivla).
So when the brivla-core matches, even through brivla-core is capable
of having a fuhivla, it won't ever have one in this case, because
the earlier predicate-not operation in the lujvo nonterminal won't let
one be there.
-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.