Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Backus–Naur form
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
==Example== A practical illustration of BNF is a specification for a simplified U.S. [[Address (geography)|postal address]]: <syntaxhighlight lang="bnf"><postal-address> ::= <name-part> <street-address> <zip-part> <name-part> ::= <personal-part> <last-name> <opt-suffix-part> <EOL> | <personal-part> <name-part> <personal-part> ::= <first-name> | <initial> "." <street-address> ::= <house-num> <street-name> <opt-apt-num> <EOL> <zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL> <opt-suffix-part> ::= "Sr." | "Jr." | <roman-numeral> | "" <opt-apt-num> ::= "Apt" <apt-num> | ""</syntaxhighlight> This translates into English as: * A postal address consists of a name-part, followed by a [[street name|street-address]] part, followed by a [[ZIP Code|zip-code]] part. * A name-part consists of either: a personal-part followed by a [[last name]] followed by an optional [[Suffix (name)|suffix]] (Jr. Sr., or dynastic number) and [[end-of-line]], or a personal part followed by a name part (this rule illustrates the use of [[Recursion (computer science)|recursion]] in BNFs, covering the case of people who use multiple first and middle names and initials).<ref>{{FOLDOC|Backus-Naur+Form}}</ref> * A personal-part consists of either a [[first name]] or an [[initial]] followed by a dot. * A street address consists of a house number, followed by a street name, followed by an optional [[apartment]] specifier, followed by an end-of-line. * A zip-part consists of a [[town]]-name, followed by a comma, followed by a [[U.S. postal abbreviations|state code]], followed by a ZIP-code followed by an end-of-line. * An opt-suffix-part consists of a suffix, such as "Sr.", "Jr." or a [[Roman numerals|roman-numeral]], or an empty string (i.e. nothing). * An opt-apt-num consists of a prefix "Apt" followed by an apartment number, or an empty string (i.e. nothing). Note that many things (such as the format of a first-name, apartment number, ZIP-code, and Roman numeral) are left unspecified here. If necessary, they may be described using additional BNF rules.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Backus–Naur form
(section)
Add topic