I read somewhere [x],y in this notation, x is optional, but I could not understand what is meant by optional. Does it means, there can be y or x,y or something else? Can anyone give some example about this?
Yes.
Documentation about []:
Optional: The items between
[and]are optional. All or none of the items in the brackets are included.
In EBNF [] stands for optional parameters that can be ommitted, so [x],y defines the possibilities y and xy.
Example:
Bicycle_Accessories = saddle [bell | horn] {water_bottle_holders}
defines next possibilities:
saddle
saddle bell
saddle horn
saddle water_bottle_holder
saddle bell water_bottle_holder
saddle bell water_bottle_holder water_bottle_holder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With