![Terminals And Nonterminals In Bnf Terminals And Nonterminals In Bnf](/uploads/1/2/4/7/124789407/725815601.jpg)
![Terminals And Nonterminals In Bnf Terminals And Nonterminals In Bnf](http://slideplayer.com/6397442/22/images/8/BNF+rule+%28or+production%29%3A+It+is+a+definition+of+an+abstraction.jpg)
Backus-Naur FormThis page outlines basics of the Backus-Naur Form (BNF) notation, sothat the file format pages can be more easily understood.The basis of the Backus-Naur Form is a set of production rules, or inother words, rules for forming more complex objects from simplerones. These objects may be simple (or terminal) symbols, or objects built fromsymbols by production rules. A production rule is of the form:x::= ywhere x is a non-terminal symbol, and y is a sequence ofone or more terminal and/or non-terminal symbols. Non-terminalsymbols are enclosed in brackets,whereas terminal symbols are represented in non-italic font.The symbol may be used as an 'or' on the right-hand side of aproduction so that it can be seen that x can be produced byone of several possible production rules.The parsing of a data format proceeds by substitution.
The componentsof a sentence are built up by starting with the head of thegrammar and repeatedly substituting the right-hand part of aproduction for a corresponding non-terminal symbol until onlyterminal symbols remain.The special symbols of BNF are:.::= which means 'is defined as'. which means 'or'. which are used to surround category names.The angle brackets distinguish syntax rules names (also callednon-terminal symbols) from terminal symbols which are written exactlyas they are to be represented. A BNF rule defining a nonterminal hasthe form:nonterminal::= sequence of alternatives consisting of strings ofterminals or nonterminals separated by the meta-symbol For further details, see:M.
Marcotty & H. Ledgard, The World of ProgrammingLanguages, Springer-Verlag, Berlin 1986., pages 41 and following.
Choose a statement for a programming language of your choice and write a BNF production that defines the syntax of that statement. Clearly distinguish between the terminal and nonterminals symbols. Backus-Naur Form. The traditional notation used by computer scientists to represent a context-free grammar is called Backus-Naur form, or bnf. Bnf denoted nonterminal symbols by wrapping them in angle brackets, like 〈SheepNoise〉. Terminal symbols were underlined. The symbol::= means “derives,” and the symbol means “also derives.”.