Answer 2

Up Answer 1i Answer 1ii Answer 2 Answer 3

The Question

The implementation of any programming language requires a specification of the syntax rules to be used in
parsing the source code of a program. Often these rules are specified by using syntax diagrams (See on-line notes).
Design a set of syntax diagrams to represent any TWO of the following:

bulletNumerical dates written in European format: (dd-mm-yyyy)
bulletUK telephone numbers in the form: (Areacode) Telephone_number (e.g. (020) 7882 7836).
bulletAny sentence of English text, provided it begins with a capital letter and ends with a full stop.
bulletAny Roman numeral between I (one) and C (one hundred) -- inclusive -- in either upper or lower case characters.

 

The Answer

Numerical dates written in European format: (dd-mm-yyyy)

Main Syntax Diagram

Sub Diagrams

 

Any sentence of English text, provided it begins with a capital
letter and ends with a full stop.

Main Syntax Diagram

Sub Diagrams