ebnf

EBNF or followed by statement


I am looking at this line of EBNF:

<zeg> = <zig>|<zag>[<zug><zug>]

Does [<zug><zug>] only become available when <zag> is used, or is it always available, even with <zig>?


Solution

  • The | would be the most-loosely bound thing. In other words:

    <zeg> is equivalent to <zig> | (<zag>[<zug><zug>])

    and NOT equivalent to (<zig> | <zag>)[<zug><zug>].

    So your first interpretation.