Chapter 2. EBNF symbols used in this document

Because there are several variations of EBNF, the following table explains the symbols used in this document:

Table 2.1. EBNF symbols used in this document

SymbolMeaningExample
[space]concatenation

"foo" "bar"

yields:
foo bar
foo  bar
foo   bar

etc.

|or

"yes" | "no" | "maybe"

yields:
yes
no
maybe

->alternative or

-> "foo" "bar"
-> "tar" "zar"


is equivalent to:
( "foo" "bar" ) | ( "tar" "zar" )

yields:
foo bar
tar zar

?optional (0 or 1 occurrences)

"foo" ?

yields:
[nothing]
foo

*0, 1 or more occurrences

"foo" *

yields:
[nothing]
foo
foo foo
foo foo foo

etc.

+1 or more occurrences

"foo" +

yields:
foo
foo foo
foo foo foo

etc.

( )grouping of several elements

( "foo" | "bar" ) +

yields:
foo
bar
foo bar
bar foo
foo foo
foo bar foo foo bar

etc.

&

line continuation character
(not standard EBNF)

"foo" | &
"bar | &
"zar"


is equivalent to:
"foo" | "bar | "zar"

/* */

comment
(not standard EBNF)

/* this is a comment */