introduction to parsing attribute_file ::(attribute '\ ')attribute ::name '=value name ::[ -za- ]\wvalue ::'true'false\ [ -za- ]\wfigure bnf for file of attributes the symbol ::means is defined as nonterminals are written in uppercase italics ( valueterminals are either literal strings enclosed in quotes (such as '=and 'true'or regular expressions (such as \ +the definitions (on the right of the ::=are made up of one or more terminals or nonterminals--these must be encountered in the sequence given to meet the definition howeverthe vertical bar (|is used to indicate alternativesso instead of matching in sequencematching any one of the alternatives is sufficient to meet the definition terminals and nonterminals can be quantified with (zero or onei optional)(one or more)or (zero or more)without an explicit quantifier they are quantified to match exactly once parentheses can be used for grouping two or more terminals or nonterminals that we want to treat as unitfor exampleto group alternatives or for quantification bnf always has "start symbol"--this is the nonterminal that must be matched by the entire input we have adopted the convention that the first nonterminal is always the start symbol in this example there are four nonterminalsattribute_file (the start symbol)attributenameand value an attribute_file is defined as one or more of an attribute followed by newline an attribute is defined as name followed by literal ( terminal)followed by value since both the name and value parts are nonterminalsthey must themselves be defined the name is defined by regular expression ( terminalthe value is defined by any of four alternativestwo literals and two regular expressions (all of which are terminalssince all the nonterminals are defined in terms of terminals (or in terms of nonterminals which themselves are ultimately defined in terms of terminals)the bnf is complete there is generally more than one way to write bnf figure shows an alternative version of the attribute_file bnf attribute_file ::attributeattribute ::name '=value '\nname ::[ -za- ]\wvalue ::'true'false\dname figure an alternative bnf for file of attributes