Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
BackusNaurForm
Edit
PageHistory
Diff
Info
LikePages
This is a language to define the formal grammar of a language, whether that be a ProgrammingLanguage, a MarkupLanguage or simply the syntax of a configuration file. An example grammar would be <sentance> ::= <verb-part> <noun-part> <verb-part> ::= <noun-part> <verb> <noun-part> ::= <proper-noun> | THE <noun> <verb> ::= throws | kicks | hides | fetches <proper-noun> ::= John | Jane <noun> ::= ball ::= dog This grammar accepts sentances such as * Jane throws the ball * The dog fetches the ball * John kicks the dog * John hides Jane * The ball fetches Jane but would not accept sentences such as * John deflates the ball * Jane hides in the basement because __deflates__ is not a verb known in this grammer and __in the basement__ is not a noun. The grammar would have to be extended to cover such cases. Because some common cases are inconvenient to define using pure [BNF], some extensions have been added in [EBNF]: * __...__ means ''1 or more'' * __[[ ]__ means ''optional''
3 pages link to
BackusNaurForm
:
BNF
EBNF
Algol