[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lojban] vocative production in PEG grammar



On Tue, Jan 11, 2011 at 11:25 AM, .alyn.post.
<alyn.post@lodockikumazvati.org> wrote:
> The PEG grammar has the following production:
>
> vocative <- ( COI-clause NAI-clause? )+ DOI-clause
>          / ( COI-clause NAI-clause? ) ( COI-clause NAI-clause? )*
>          / DOI-clause
>
> Which is a bit curious to me.  It *seems* like it could be
> rewritten as:
>
> vocative <- ( COI-clause NAI-clause? )* DOI-clause?
>
> The only difference I can see between these two cases are that the
> second form will match the empty string, whereas the first will not.

Right.

> It looks like that is a problem for one of the ordered choices in the
> 'free' production.  (I'm not sure if that can be addressed yet.)
>
> If vocative is written this way so that it does not match the empty
> string, why isn't it written this way?:
>
> vocative <- ( COI-clause NAI-clause? )+ DOI-clause
>          / ( COI-clause NAI-clause? )+
>          / DOI-clause
>
> Where the second ordered choice uses the + operator instead of
> FOO FOO*?

Or even better:

vocative <- ( COI-clause NAI-clause? )* DOI-clause
           / ( COI-clause NAI-clause? )+

It was probably generated by some automatic conversion from the EBNF,
and Robin didn't bother to write it more efficiently.

mu'o mi'e xorxes

-- 
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.