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”. The number cross-references this grammar with the rule numbers in the YACC grammar. The names are the same as those in the YACC grammar, except that subrules are labeled with A, B, C, ... in the YACC grammar and with 1, 2, 3, ... in this grammar. In addition, rule 971 is “simple_tag” in the YACC grammar but “stag” in this grammar, because of its frequent appearance.
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”).
... 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 ...] [CMENE ... # | (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] CMENE ... # | (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] CMENE ... # [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.