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
Metasyntax
(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!
===The standard convention=== * '[[Backus–Naur form]]' denotes [[nonterminal symbol]]s by angle bracketing the name of the [[syntactic category]], while it denotes [[terminal symbol]]s by double quoting the terminal words. Terminals can never appear on the left-hand side of the metasymbol {{code|::{{=}}}} in a [[Parse tree|derivation]] rule. The body of the definition on the right-hand side may be composed with several alternative forms with each alternative syntactic construct being separated by the metasymbol {{code|{{!}}}}. Each of these alternative construct may be either terminal or nonterminal. * '[[Extended Backus–Naur form]]' uses all facilities in BNF and introduces two more metasymbols for additional features. One of these two new features is applied to denote an optional phrase in a statement by square bracketing the optional phrase. The second feature is applied to denote a phrase that is to be repeated zero or more times by curly bracketing the phrase. * '[[Wirth syntax notation]]' uses all facilities in EBNF except that the nonterminals are not necessarily angle bracketed but are always defined on the right-hand side of {{code|{{=}}}} in its production rule. It also does not require every nonterminal to be explicitly defined. Nonterminals such as {{code|<text>}} and {{code|<opt-whitespace>}} are implicitly defined as ASCII-character and optional white space respectively. * '[[Augmented Backus–Naur form]]' denotes nonterminal symbols by starting a one-word-name with an alphabet as the name of the syntactic category. Angle brackets are not required. Terminal symbols are either denoted by double quoted words or denoted by the following numeric structure: a {{code|%}}, followed by {{code|b}} or {{code|x}} or {{code|d}}, followed by a numeric value or a ''concatenation of numeric values'' separated by {{code|.}}. Metasymbol {{code|-}} is placed between two numeric values to denote ''value range''. As that of BNF, the terminals of ABNF never occurs on the left-hand-side of the metasymbol {{code|{{=}}}} in the derivation rule. Metasymbol {{code|/}} denotes ''alternations''. White space is used to separate elements in the body of the definition. The metasyntax for ''repetition'' in ABNF has several forms. A {{code|*}} preceding an element denotes the element to be repeated zero or more times. Numeric value {{var|n1}} followed by {{code|*}} followed by numeric value {{var|n2}} followed by an element denotes the element to be repeated at least {{var|n1}} times and at most {{var|n2}} times. A single numeric value {{var|n}} preceding an element denotes the element to be repeated {{var|n}} times. ''Comments'' may be express after metasymbol {{code|;}}. As in EBNF, square bracketing a phrase denotes the phrase to be ''optional''.
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)