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

Re: Uncertainties in EBNF Notation

loop!dont@tessi.uucp (Don Taylor) writes:

> I just received the ju'i lobypli mailing with the lojban machine grammar in
> ebnf notation.  It seems that the notation is ambiguous in that no precedence
> is specified for the notation.
> I would greatly appreciate a more precise definition of precedence, and
> associativity if relevant.

Woops.  "..." has highest precedence, "&" intermediate, "|" lowest.  Both
() and [] group with respect to precedence.  All operators are associative
both ways.

> Item 10, "// encloses an elidable terminator, which may be omitted (without
> change of meaning) if no grammatical ambiguity results" disturbs me.  Reading
> bnf as a definition of a language, which I take as the definition of what
> is grammatical and what is not, leaves me uncertain of how to interpret the
> document.

The elidable terminators make the language unambiguous, but may often be
omitted without loss of ambiguity, especially when there is more than one
in a row.  For example:
	le prenu ku cu klama le zarci ku vau
which means
	The person goes to the market.
may be elided to
	le prenu cu klama le zarci
because the first "ku" may be inferred before the "cu" (since "cu" cannot
be found in a sumti) and the second "ku" and the "vau" may be inferred
at the end of text.