Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Extended Backus–Naur form
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Conventions== {{ordered list|According to the section 4 of the ISO/IEC 14977 standard, the following conventions are used: {{blist | Each meta-identifier of Extended BNF is written as one or more words joined together by [[hyphen]]s. However, joining the words seems to apply only to referencing meta-identifiers outside of the metalanguage itself, as seen in the examples of the standard. | A meta-identifier ending with ''-symbol'' is the name of a terminal symbol of Extended BNF. }}|The normal character representing each operator of Extended BNF and its implied precedence is (highest precedence at the top): <syntaxhighlight lang="ebnf"> * repetition-symbol - except-symbol , concatenate-symbol | definition-separator-symbol = defining-symbol ; terminator-symbol . terminator-symbol </syntaxhighlight>|The normal precedence is overridden by the following bracket pairs: <syntaxhighlight lang="ebnf"> (* start-comment-symbol end-comment-symbol *) ' first-quote-symbol first-quote-symbol ' ( start-group-symbol end-group-symbol ) [ start-option-symbol end-option-symbol ] { start-repeat-symbol end-repeat-symbol } ? special-sequence-symbol special-sequence-symbol ? " second-quote-symbol second-quote-symbol " </syntaxhighlight> The first-quote-symbol is the [[apostrophe]] as defined by ISO/IEC 646:1991, that is to say Unicode U+0027 (<code>'</code>)<!-- no apos entity for ' for HTML 4 browsers -->; the font used in ISO/IEC 14977:1996(E) renders it very much like the acute, Unicode U+00B4 (<code>´</code>), so confusion sometimes arises. However, the ISO Extended BNF standard invokes ISO/IEC 646:1991, "ISO 7-bit coded character set for information interchange", as a normative reference and makes no mention of any other character sets, so formally, there is no confusion with Unicode characters outside the 7-bit ASCII range. }} As examples, the following syntax rules illustrate the facilities for expressing repetition: <syntaxhighlight lang="ebnf"> aa = "A"; bb = 3 * aa, "B"; cc = 3 * [aa], "C"; dd = {aa}, "D"; ee = aa, {aa}, "E"; ff = 3 * aa, 3 * [aa], "F"; gg = {3 * aa}, "G"; hh = (aa | bb | cc), "H"; </syntaxhighlight> Terminal strings defined by these rules are as follows: aa: A bb: AAAB cc: C AC AAC AAAC dd: D AD AAD AAAD AAAAD etc. ee: AE AAE AAAE AAAAE AAAAAE etc. ff: AAAF AAAAF AAAAAF AAAAAAF gg: G AAAG AAAAAAG etc. hh: AH AAABH CH ACH AACH AAACH
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)