Question 10(b) 2010 · May-June · Paper 33 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 10
Part (b)
Part (b)
<MAIN VARIABLE>::=<NZDIGIT><GROUP><END>
Show text version of question
Question 10
Part (b)
Question 10
A VARIABLE is defined in a certain language by the following BNF rules:
<VARIABLE>::=<GROUP><IDENTIFIER>│<GROUP> <GROUP>::=<LETTER>│<LETTER><DIGIT>│<LETTER><GROUP> <LETTER>::= A│B│C <DIGIT>::=0│1│2│3│4│5│6│7│8│9 <IDENTIFIER>::=%│$
Part (b)
MAIN_VARIABLE is defined as a GROUP which has a NZDIGIT (a DIGIT which must not be
a zero) as the first character and cannot include an IDENTIFIER, but has a ! or a & as the last character.
For example 1A2! and 9BC& are examples of MAIN_VARIABLE but 0A2! and 9BC%& are not examples of MAIN_VARIABLE.
Produce a set of rules to define MAIN_VARIABLE (The BNF rules stated above do not need to be reproduced).
Why this question appears here
92% assigned-topic match · Hardware › Logic gates and logic circuits
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9691_s10_qp_33.pdf
