BNF questions and comments
Jascha Wetzel
"[firstname]" at mainia.de
Sat Sep 8 03:46:38 PDT 2007
0ffh wrote:
> BLS wrote:
>> What is the meaning of : epsilon ?
>
> Usually this means nothing, erm, "nothing" in such a context.
>
> Something like "a <- b / epsilon" is equivalent to "a <- b?".
>
> Regards, Frank
yep, epsilon means, the production rule may produce nothing. in the
seatd grammar, in most cases, non-terminals that have an epsilon rule,
also have a name with suffix "Opt" for "optional".
note that epsilon rules are just a convenient shortcut:
EnumDeclaration -> "enum" EnumBaseTypeOpt EnumBody
may be rewritten as:
EnumDeclaration -> "enum" EnumBaseType EnumBody
EnumDeclaration -> "enum" EnumBody
More information about the Digitalmars-d-learn
mailing list