Page 212 - DCAP507_SYSTEM_SOFTWARE
P. 212

System Software




                    Notes          No semicolon is required in these cases, as there are no two adjacent component statements to be
                                   kept disconnected.
                                   We'll state this  separated-repetition  rule  by  means of a  modification  of  the star  notation,
                                   positioning the separator symbol in braces after the star:
                                   <compound-statement> ::= begin {<statement>}*{;} end

                                   13.2.4 Data Type Definitions for Extensions

                                   All of the extensions just illustrated can be managed within the framework offered by define-
                                   datatypes and cases.
                                   For the question-mark expansion, it's frequently simpler to develop it into two variants:
                                   (define-datatype break-expression break-expression?
                                   (simple-break ())
                                   (targeted-break (target identifier?)))
                                   When there is more than one optional constituent in the similar rule, so that separating all the
                                   variants would lead to a combinatorial explosion, one can offer a single variant but permit some
                                   type of an absence marker to any or all of the possible locations:
                                   <for-stmt> ::= for ( {<expr>}? ; {<expr>}? ; {<expr>}? ) <stmt>
                                   (define-datatype for-stmt for-stmt?
                                   (a-for-stmt (initializer (maybe expr?))
                                   (entry-test (maybe expr?))
                                   (updater (maybe expr?))
                                   (for-body stmt?)))
                                   Given a unary predicate, the perhaps procedure constructs and returns a new predicate that is
                                   contented by everything that satisfies the specified predicate, but also by the symbol  absent
                                   (conventionally signalling an absent optional component of a syntactic construction).
                                   13.2.5 The Name of the Notation


                                   Backus-Naur form is named after John Backus (1924-2007) and Peter Naur (b. 1928). Backus, who
                                   used to lead the team that produced the first high-level programming language (FORTRAN),
                                   invented the formalism in 1959. Naur assisted to make it likable by adapting and utilizing it in
                                   the definition of the Algol 60 programming language.

                                   Self Assessment

                                   Fill in the blanks:

                                   9.  BNF is a formal meta syntax used to articulate ................................ grammars.
                                   10.  Backus Normal Form was renamed  as ................................  at the suggestion of  Donald
                                       Knuth.

                                   11.  The Backus-Naur formalism displays exactly how to construct the recursive data structures
                                       for syntax .................................
                                   12.  Each rule depicts one possible method of building a constituent belonging to a specific
                                       ................................ category, which is named at the commencement of the rule.




          206                               LOVELY PROFESSIONAL UNIVERSITY
   207   208   209   210   211   212   213   214   215   216   217