Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2.
A variable is one or more letters, then at most one digit. It must begin with a letter.
9SW: invalid, because it begins with a digit and a variable must begin with a letter [1]
UWY: valid, because it begins with a letter and is followed by two other letters [1]
<word> is one or more letters, so it needs a rule that repeats itself:
<word> ::= <letter> | <word><letter> <variable> ::= <word> | <word><digit>
<word> ::= <letter> | [1]
... <word><letter> [1]
<variable> ::= <word> | <word><digit> [1]
Also accepted: <word> ::= <letter><word> | <letter>.
Use two letters and one to three digits from the diagrams.
Write an example such as AC768 [1]
Draw a diagram named vehicle registration, with an arrow in and an arrow out, in this order: letter box, letter box, digit box, then a second digit box and a third digit box that can each be skipped by a bypass line.
Always exactly two letters (two letter boxes, no loops) [1]
One, two or three digits possible (the extra digit boxes can be bypassed) [1]
Correct arrows, boxes and name of the syntax diagram [1]
▶ Whole paper
Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.