# The Complete Lojban Language (1997)/Chapter 21

The following two listings constitute the formal grammar of Lojban. The first version is written in the YACC language, which is used to describe parsers, and has been used to create a parser for Lojban texts. This parser is available from the Logical Language Group. The second listing is in Extended Backus-Naur Form (EBNF) and represents the same grammar in a more human-readable form. (In case of discrepancies, the YACC version is official.) There is a cross-reference listing for each format that shows, for each selma'o and rule, which rules refer to it.

## EBNF Grammar of Lojban

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:
namenumber = 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.
The following rules are non-formal:
FAhO is a universal terminator and signals the end of parsable input.

## EBNF Cross-Reference

A
    ek802
BAI
    simple-tense-modal972
BAhE
    word1100
BE
    linkargs160
BEI
    links161
BEhO
    linkargs160
BIhE
    mex-1311
BIhI
    interval932
BO
    bridi-tail-252, operand-2383, operand-3385, operator-1371, selbri-5135, selbri-6136, statement-213, sumti-393, sumti-697, text-12
BOI
    free32, operand-3385, quantifier300, sumti-697
BRIVLA
    tanru-unit-2152
BU
    lerfu-word987
BY
    lerfu-word987
CAI
    indicator413
CAhA
    simple-tense-modal972
CEI
    tanru-unit150
CEhE
    terms-282
CMENE
    free32, sumti-697, text0
CO
    selbri-2132
COI
    vocative415
CU
    free32, sentence40
CUhE
    simple-tense-modal972
DAhO
    indicator413
DOI
    vocative415
DOhU
    free32
FA
    term83
FAhA
    space-interval1046, space-offset1045
FEhE
    space-int-props1049
FEhU
    tense-modal815
FIhO
    tense-modal815
FOI
    lerfu-word987
FUhA
    mex310
FUhE
    indicators411
FUhO
    indicator413
GA
    gek807
GAhO
    joik806
GEhU
    relative-clause122
GI
    gek807, gik816
GIhA
    gihek818
GOI
    relative-clause122
GOhA
    tanru-unit-2152
GUhA
    guhek808
I
    paragraph10, statement-112, statement-213, text-12
JA
    jek805
JAI
    tanru-unit-2152
JOI
    joik806
JOhI
    operand-3385
KE
    bridi-tail50, gek-sentence54, operand381, operator-2372, operator370, selbri-4134, sumti-191, tanru-unit-2152
KEI
    tanru-unit-2152
KEhE
    bridi-tail50, gek-sentence54, operand381, operator-2372, operator370, selbri-4134, sumti-191, tanru-unit-2152
KI
    simple-tense-modal972
KOhA
    sumti-697
KU
    sumti-595, sumti-697, term83
KUhE
    mex-2312
KUhO
    relative-clause122
LA
    sumti-697
LAU
    lerfu-word987
LAhE
    operand-3385, sumti-697
LE
    sumti-697
LEhU
    sumti-697
LI
    sumti-697
LIhU
    sumti-697
LOhO
    sumti-697
LOhU
    sumti-697
LU
    sumti-697
LUhU
    operand-3385, sumti-697
MAI
    free32
MAhO
    mex-operator374
ME
    tanru-unit-2152
MEhU
    tanru-unit-2152
MOI
    tanru-unit-2152
MOhE
    operand-3385
MOhI
    space1040
NA
    ek802, fragment20, gek-sentence54, gihek818, jek805, selbri-1131, term83
NAI
    ek802, gek807, gihek818, gik816, guhek808, indicator413, interval-property1051, interval932, jek805, joik806, simple-tense-modal972, space-interval1046, space-offset1045, tanru-unit-2152, text0, time-offset1033, time1030, vocative415
NAhE
    mex-operator374, operand-3385, selbri-6136, simple-tense-modal972, sumti-697, tanru-unit-2152
NAhU
    mex-operator374
NIhE
    operand-3385
NIhO
    paragraphs4, text-12
NOI
    relative-clause122
NU
    tanru-unit-2152
NUhA
    tanru-unit-2152
NUhI
    termset85
NUhU
    termset85
PA
    lerfu-string817, number812
PEhE
    terms-181
PEhO
    mex-2312
PU
    time-offset1033, time1030
RAhO
    tanru-unit-2152
ROI
    interval-property1051
SA
    null1101
SE
    ek802, gek807, gihek818, guhek808, interval932, jek805, joik806, mex-operator374, simple-tense-modal972, tanru-unit-2152
SEI
    free32
SEhU
    free32
SI
    null1101
SOI
    free32
SU
    null1101
TAhE
    interval-property1051
TEI
    lerfu-word987
TEhU
    mex-operator374, operand-3385
TO
    free32
TOI
    free32
TUhE
    statement-314
TUhU
    statement-314
UI
    indicator413
VA
    space-offset1045, space1040
VAU
    fragment20, tail-terms71
VEI
    free32, quantifier300
VEhA
    space-interval1046
VEhO
    free32, quantifier300
VIhA
    space-interval1046
VUhO
    sumti90
VUhU
    mex-operator374
XI
    free32
Y
    indicator413
ZAhO
    interval-property1051
ZEI
    tanru-unit-2152
ZEhA
    time1030
ZI
    time-offset1033, time1030
ZIhE
    relative-clauses121
ZO
    sumti-697
ZOI
    sumti-697
ZOhU
    prenex30
any-word
    lerfu-word987, null1101, sumti-697, tanru-unit-2152, word1100
anything
    sumti-697
bridi-tail
    bridi-tail50, sentence40
bridi-tail-1
    bridi-tail50
bridi-tail-2
    bridi-tail-151, bridi-tail-252
bridi-tail-3
    bridi-tail-252
ek
    fragment20, joik-ek421, operand-2383, operand381, sumti-191, sumti-393
fragment
    paragraph10
free
    text0
gek
    gek-sentence54, operand-3385, sumti-494, termset85
gek-sentence
    bridi-tail-353, gek-sentence54
gihek
    bridi-tail-151, bridi-tail-252, bridi-tail50, fragment20
gik
    gek-sentence54, gek807, operand-3385, operator-1371, selbri-6136, sumti-494, termset85
guhek
    operator-1371, selbri-6136
indicator
    indicators411
indicators
    text0, word1100
interval
    joik806
interval-property
    space-int-props1049, time1030
jek
    joik-jek422, operator-1371, selbri-5135, stag971, statement-213, text-12
joik
    gek807, joik-ek421, joik-jek422, operand-2383, operand381, operator-1371, operator370, selbri-4134, selbri-5135, stag971, statement-213, sumti-191, sumti-393, text-12
joik-ek
    operand-1382, sumti-292
joik-jek
    operator370, selbri-4134, statement-112, tag491, tanru-unit-2152, terms-181, text0
lerfu-string
    free32, lerfu-word987, operand-3385, sumti-697, tanru-unit-2152
lerfu-word
    lerfu-string817, lerfu-word987, number812
linkargs
    fragment20, tanru-unit-1151
links
    fragment20, linkargs160, links161
mex
    free32, mex-operator374, quantifier300, sumti-697
mex-1
    mex-1311, mex310
mex-2
    mex-1311, mex-2312, operand-3385
mex-operator
    mex-operator374, operator-2372, tanru-unit-2152
number
    free32, interval-property1051, quantifier300, tanru-unit-2152
operand
    mex-2312, operand-3385, operand381, rp-operand332
operand-1
    operand381
operand-2
    operand-1382, operand-2383
operand-3
    operand-2383, operand-3385
operator
    mex-1311, mex-2312, mex310, operator-2372, operator370, rp-expression330
operator-1
    operator-1371, operator370
operator-2
    operator-1371
paragraph
    paragraphs4
paragraphs
    paragraphs4, text-12
prenex
    fragment20, statement11, subsentence41
quantifier
    fragment20, operand-3385, sumti-595, sumti-tail-1112
relative-clause
    relative-clauses121
relative-clauses
    fragment20, free32, sumti-595, sumti-697, sumti-tail-1112, sumti-tail111, sumti90
rp-expression
    mex310, rp-operand332
rp-operand
    rp-expression330
selbri
    bridi-tail-353, free32, mex-operator374, operand-3385, selbri-1131, selbri-6136, sumti-595, sumti-tail-1112, tense-modal815
selbri-1
    selbri130
selbri-2
    selbri-1131, selbri-2132
selbri-3
    selbri-2132, selbri-4134, tanru-unit-2152
selbri-4
    selbri-3133
selbri-5
    selbri-4134, selbri-5135
selbri-6
    selbri-5135, selbri-6136
sentence
    statement-314, subsentence41
simple-tense-modal
    stag971, tense-modal815
space
    simple-tense-modal972
space-int-props
    space-interval1046
space-interval
    space1040
space-offset
    space1040
stag
    bridi-tail-252, bridi-tail50, gek807, operand-2383, operand381, operator-1371, operator370, selbri-4134, selbri-5135, statement-213, sumti-191, sumti-393, text-12
statement
    paragraph10, statement11
statement-1
    statement11
statement-2
    statement-112, statement-213
statement-3
    statement-213
subsentence
    gek-sentence54, relative-clause122, subsentence41, tanru-unit-2152
sumti
    free32, operand-3385, sumti-191, sumti-494, sumti-697, sumti-tail-1112, tanru-unit-2152, term83
sumti-1
    sumti90
sumti-2
    sumti-191
sumti-3
    sumti-292, sumti-393
sumti-4
    sumti-393, sumti-494
sumti-5
    sumti-494
sumti-6
    sumti-595, sumti-tail111
sumti-tail
    sumti-697
sumti-tail-1
    sumti-tail111
tag
    gek-sentence54, selbri130, statement-314, tanru-unit-2152, term83
tail-terms
    bridi-tail-151, bridi-tail-252, bridi-tail-353, bridi-tail50, gek-sentence54
tanru-unit
    selbri-6136
tanru-unit-1
    tanru-unit150
tanru-unit-2
    tanru-unit-1151, tanru-unit-2152
tense-modal
    tag491
term
    linkargs160, links161, relative-clause122, terms-282
terms
    fragment20, free32, prenex30, sentence40, tail-terms71, termset85
terms-1
    terms80
terms-2
    terms-181
termset
    term83
text
    free32, null1101, sumti-697
text-1
    statement-314, text0
time
    simple-tense-modal972
time-offset
    time1030
utterance
    null1101
vocative
    free32
This work is in the public domain worldwide because it has been so released by the author.
Public domainPublic domainfalsefalse