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.
BNF rule #802 802
BNF rule #972 972
BNF rule #1100 1100
BNF rule #160 160
BNF rule #161 161
BNF rule #160 160
BNF rule #311 311
BNF rule #932 932
BNF rule #5252, BNF rule #383383, BNF rule #385385, BNF rule #371371, BNF rule #135135, BNF rule #136136, BNF rule #1313, BNF rule #9393, BNF rule #9797, BNF rule #22
BNF rule #3232, BNF rule #385385, BNF rule #300300, BNF rule #9797
BNF rule #152 152
BNF rule #987 987
BNF rule #987 987
BNF rule #413 413
BNF rule #972 972
BNF rule #150 150
BNF rule #82 82
BNF rule #3232, BNF rule #9797, BNF rule #00
BNF rule #132 132
BNF rule #415 415
BNF rule #3232, BNF rule #4040
BNF rule #972 972
BNF rule #413 413
BNF rule #415 415
BNF rule #32 32
BNF rule #83 83
BNF rule #10461046, BNF rule #10451045
BNF rule #1049 1049
BNF rule #815 815
BNF rule #815 815
BNF rule #987 987
BNF rule #310 310
BNF rule #411 411
BNF rule #413 413
BNF rule #807 807
BNF rule #806 806
BNF rule #122 122
BNF rule #807807, BNF rule #816816
BNF rule #818 818
BNF rule #122 122
BNF rule #152 152
BNF rule #808 808
BNF rule #1010, BNF rule #1212, BNF rule #1313, BNF rule #22
BNF rule #805 805
BNF rule #152 152
BNF rule #806 806
BNF rule #385 385
BNF rule #5050, BNF rule #5454, BNF rule #381381, BNF rule #372372, BNF rule #370370, BNF rule #134134, BNF rule #9191, BNF rule #152152
BNF rule #152 152
BNF rule #5050, BNF rule #5454, BNF rule #381381, BNF rule #372372, BNF rule #370370, BNF rule #134134, BNF rule #9191, BNF rule #152152
BNF rule #972 972
BNF rule #97 97
BNF rule #9595, BNF rule #9797, BNF rule #8383
BNF rule #312 312
BNF rule #122 122
BNF rule #97 97
BNF rule #987 987
BNF rule #385385, BNF rule #9797
BNF rule #97 97
BNF rule #97 97
BNF rule #97 97
BNF rule #97 97
BNF rule #97 97
BNF rule #97 97
BNF rule #97 97
BNF rule #385385, BNF rule #9797
BNF rule #32 32
BNF rule #374 374
BNF rule #152 152
BNF rule #152 152
BNF rule #152 152
BNF rule #385 385
BNF rule #1040 1040
BNF rule #802802, BNF rule #2020, BNF rule #5454, BNF rule #818818, BNF rule #805805, BNF rule #131131, BNF rule #8383
BNF rule #802802, BNF rule #807807, BNF rule #818818, BNF rule #816816, BNF rule #808808, BNF rule #413413, BNF rule #10511051, BNF rule #932932, BNF rule #805805, BNF rule #806806, BNF rule #972972, BNF rule #10461046, BNF rule #10451045, BNF rule #152152, BNF rule #00, BNF rule #10331033, BNF rule #10301030, BNF rule #415415
BNF rule #374374, BNF rule #385385, BNF rule #136136, BNF rule #972972, BNF rule #9797, BNF rule #152152
BNF rule #374 374
BNF rule #385 385
BNF rule #122 122
BNF rule #152 152
BNF rule #152 152
BNF rule #85 85
BNF rule #85 85
BNF rule #817817, BNF rule #812812
BNF rule #81 81
BNF rule #312 312
BNF rule #10331033, BNF rule #10301030
BNF rule #152 152
BNF rule #1051 1051
BNF rule #1101 1101
BNF rule #802802, BNF rule #807807, BNF rule #818818, BNF rule #808808, BNF rule #932932, BNF rule #805805, BNF rule #806806, BNF rule #374374, BNF rule #972972, BNF rule #152152
BNF rule #32 32
BNF rule #32 32
BNF rule #1101 1101
BNF rule #32 32
BNF rule #1101 1101
BNF rule #1051 1051
BNF rule #987 987
BNF rule #374374, BNF rule #385385
BNF rule #32 32
BNF rule #32 32
BNF rule #14 14
BNF rule #14 14
BNF rule #413 413
BNF rule #10451045, BNF rule #10401040
BNF rule #2020, BNF rule #7171
BNF rule #3232, BNF rule #300300
BNF rule #1046 1046
BNF rule #3232, BNF rule #300300
BNF rule #1046 1046
BNF rule #90 90
BNF rule #374 374
BNF rule #32 32
BNF rule #413 413
BNF rule #1051 1051
BNF rule #152 152
BNF rule #1030 1030
BNF rule #10331033, BNF rule #10301030
BNF rule #121 121
BNF rule #97 97
BNF rule #97 97
BNF rule #30 30
BNF rule #987987, BNF rule #11011101, BNF rule #9797, BNF rule #152152, BNF rule #11001100
BNF rule #97 97
BNF rule #5050, BNF rule #4040
BNF rule #50 50
BNF rule #5151, BNF rule #5252
BNF rule #52 52
BNF rule #2020, BNF rule #421421, BNF rule #383383, BNF rule #381381, BNF rule #9191, BNF rule #9393
BNF rule #10 10
BNF rule #5454, BNF rule #385385, BNF rule #9494, BNF rule #8585
BNF rule #5353, BNF rule #5454
BNF rule #5151, BNF rule #5252, BNF rule #5050, BNF rule #2020
BNF rule #5454, BNF rule #807807, BNF rule #385385, BNF rule #371371, BNF rule #136136, BNF rule #9494, BNF rule #8585
BNF rule #371371, BNF rule #136136
BNF rule #411 411
BNF rule #00, BNF rule #11001100
BNF rule #806 806
BNF rule #10491049, BNF rule #10301030
BNF rule #422422, BNF rule #371371, BNF rule #135135, BNF rule #971971, BNF rule #1313, BNF rule #22
BNF rule #807807, BNF rule #421421, BNF rule #422422, BNF rule #383383, BNF rule #381381, BNF rule #371371, BNF rule #370370, BNF rule #134134, BNF rule #135135, BNF rule #971971, BNF rule #1313, BNF rule #9191, BNF rule #9393, BNF rule #22
BNF rule #382382, BNF rule #9292
BNF rule #370370, BNF rule #134134, BNF rule #1212, BNF rule #491491, BNF rule #152152, BNF rule #8181, BNF rule #00
BNF rule #3232, BNF rule #987987, BNF rule #385385, BNF rule #9797, BNF rule #152152
BNF rule #817817, BNF rule #987987, BNF rule #812812
BNF rule #2020, BNF rule #151151
BNF rule #2020, BNF rule #160160, BNF rule #161161
BNF rule #3232, BNF rule #374374, BNF rule #300300, BNF rule #9797
BNF rule #311311, BNF rule #310310
BNF rule #311311, BNF rule #312312, BNF rule #385385
BNF rule #374374, BNF rule #372372, BNF rule #152152
BNF rule #3232, BNF rule #10511051, BNF rule #300300, BNF rule #152152
BNF rule #312312, BNF rule #385385, BNF rule #381381, BNF rule #332332
BNF rule #381 381
BNF rule #382382, BNF rule #383383
BNF rule #383383, BNF rule #385385
BNF rule #311311, BNF rule #312312, BNF rule #310310, BNF rule #372372, BNF rule #370370, BNF rule #330330
BNF rule #371371, BNF rule #370370
BNF rule #371 371
BNF rule #2020, BNF rule #1111, BNF rule #4141
BNF rule #2020, BNF rule #385385, BNF rule #9595, BNF rule #112112
BNF rule #121 121
BNF rule #2020, BNF rule #3232, BNF rule #9595, BNF rule #9797, BNF rule #112112, BNF rule #111111, BNF rule #9090
BNF rule #310310, BNF rule #332332
BNF rule #330 330
BNF rule #5353, BNF rule #3232, BNF rule #374374, BNF rule #385385, BNF rule #131131, BNF rule #136136, BNF rule #9595, BNF rule #112112, BNF rule #815815
BNF rule #130 130
BNF rule #131131, BNF rule #132132
BNF rule #132132, BNF rule #134134, BNF rule #152152
BNF rule #133 133
BNF rule #134134, BNF rule #135135
BNF rule #135135, BNF rule #136136
BNF rule #1414, BNF rule #4141
BNF rule #971971, BNF rule #815815
BNF rule #972 972
BNF rule #1046 1046
BNF rule #1040 1040
BNF rule #1040 1040
BNF rule #5252, BNF rule #5050, BNF rule #807807, BNF rule #383383, BNF rule #381381, BNF rule #371371, BNF rule #370370, BNF rule #134134, BNF rule #135135, BNF rule #1313, BNF rule #9191, BNF rule #9393, BNF rule #22
BNF rule #1010, BNF rule #1111
BNF rule #11 11
BNF rule #1212, BNF rule #1313
BNF rule #13 13
BNF rule #5454, BNF rule #122122, BNF rule #4141, BNF rule #152152
BNF rule #3232, BNF rule #385385, BNF rule #9191, BNF rule #9494, BNF rule #9797, BNF rule #112112, BNF rule #152152, BNF rule #8383
BNF rule #90 90
BNF rule #91 91
BNF rule #9292, BNF rule #9393
BNF rule #9393, BNF rule #9494
BNF rule #94 94
BNF rule #9595, BNF rule #111111
BNF rule #97 97
BNF rule #111 111
BNF rule #5454, BNF rule #130130, BNF rule #1414, BNF rule #152152, BNF rule #8383
BNF rule #5151, BNF rule #5252, BNF rule #5353, BNF rule #5050, BNF rule #5454
BNF rule #136 136
BNF rule #150 150
BNF rule #151151, BNF rule #152152
BNF rule #491 491
BNF rule #160160, BNF rule #161161, BNF rule #122122, BNF rule #8282
BNF rule #2020, BNF rule #3232, BNF rule #3030, BNF rule #4040, BNF rule #7171, BNF rule #8585
BNF rule #80 80
BNF rule #81 81
BNF rule #83 83
BNF rule #3232, BNF rule #11011101, BNF rule #9797
BNF rule #972 972
BNF rule #1030 1030
BNF rule #1101 1101
BNF rule #32 32