Lojban Machine Grammar, EBNF Version, Final Baseline
This EBNF document is explicitly dedicated to the public domain by its author, The Logical Language Group, Inc. Contact that organization at: 2904 Beau Lane, Fairfax VA 22031 USA 703-385-0273 (intl: +1 703 385 0273)
Explanation of notation: All rules have the form:
name number = bnf-expression
which means that the grammatical construct “name” is defined by “bnf-expression”.
Names in lower case are grammatical constructs.
Names in UPPER CASE are selma'o (lexeme) names, and are terminals.
Concatenation is expressed by juxtaposition with no operator symbol.
| represents alternation (choice).
[] represents an optional element.
& represents and/or. “A & B” is the same as “A | B | A B” but not “B A”. Furthermore, “A & B & C & D” permits one or more of A, B, C, and/or D, but only in that order.
... represents optional repetition of the construct to the left. Left-grouping is implied; right-grouping is shown by explicit self-referential recursion with no “...”
() serves to indicate the grouping of the other operators. Otherwise, “...” binds closer than &, which binds closer than |.
# is shorthand for “[free ...]” , a construct which appears in many places.
// encloses an elidable terminator, which may be omitted (without change of meaning) if no grammatical ambiguity results.
[NAI ...] [CMEVLA ... # | (indicators & free ...)] [joik-jek] text-1
[(I [jek | joik] [[stag] BO] #) ... | NIhO ... #] [paragraphs]
ek # | gihek # | quantifier | NA # | terms /VAU#/ | prenex | relative-clauses | links | linkargs
bridi-tail-1 [gihek [stag] KE # bridi-tail /KEhE#/ tail-terms]
gek subsentence gik subsentence tail-terms | [tag] KE # gek-sentence /KEhE#/ | NA # gek-sentence
NUhI # gek terms /NUhU#/ gik terms /NUhU#/ | NUhI # terms /NUhU#/
[quantifier] sumti-6 [relative-clauses] | quantifier selbri /KU#/ [relative-clauses]
(LAhE # | NAhE BO #) [relative-clauses] sumti /LUhU#/ | KOhA # | lerfu-string /BOI#/ | LA # [relative-clauses] CMEVLA ... # | (LA | LE) # sumti-tail /KU#/ | LI # mex /LOhO#/ | ZO any-word # | LU text /LIhU#/ | LOhU any-word ... LEhU # | ZOI any-word anything any-word #
[sumti-6 [relative-clauses]] sumti-tail-1 | relative-clauses sumti-tail-1
selbri-5 [joik-jek selbri-5 | joik [stag] KE # selbri-3 /KEhE#/] ...
tanru-unit [BO # selbri-6] | [NAhE #] guhek selbri gik selbri-6
BRIVLA # | GOhA [RAhO] # | KE # selbri-3 /KEhE#/ | ME # sumti /MEhU#/ [MOI #] | (number | lerfu-string) MOI # | NUhA # mex-operator | SE # tanru-unit-2 | JAI # [tag] tanru-unit-2 | any-word (ZEI any-word) ... | NAhE # tanru-unit-2 | NU [NAI] # [joik-jek NU [NAI] #] ... subsentence /KEI#/
operator-1 [joik-jek operator-1 | joik [stag] KE # operator /KEhE#/] ...
operator-2 | guhek operator-1 gik operator-2 | operator-2 (jek | joik) [stag] BO # operator-1
SE # mex-operator | NAhE # mex-operator | MAhO # mex /TEhU#/ | NAhU # selbri /TEhU#/ | VUhU #
quantifier | lerfu-string /BOI#/ | NIhE # selbri /TEhU#/ | MOhE # sumti /TEhU#/ | JOhI # mex-2 ... /TEhU#/ | gek operand gik operand-3 | (LAhE # | NAhE BO #) operand /LUhU#/
[NAhE] [SE] BAI [NAI] [KI] | [NAhE] (time [space] | space [time]) & CAhA [KI] | KI | CUhE
ZI & time-offset ... & (ZEhA [PU [NAI]]) & interval-property ...
VA & space-offset ... & space-interval & (MOhI space-offset)
SEI # [terms [CU #]] selbri /SEhU/ | SOI # sumti [sumti] /SEhU/ | vocative [relative-clauses] selbri [relative-clauses] /DOhU/ | vocative [relative-clauses] CMEVLA ... # [relative-clauses] /DOhU/ | vocative [sumti] /DOhU/ | (number | lerfu-string) MAI | TO text /TOI/ | XI # (number | lerfu-string) /BOI/ | XI # VEI # mex /VEhO/
(UI | CAI) [NAI] | Y | DAhO | FUhO
The following rules are non-formal:
FAhO is a universal terminator and signals the end of parsable input.