Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2.
Each syntax diagram becomes one BNF rule. A choice becomes | and a box that can be skipped becomes two alternatives.
<operator> ::= + | – | * | / [1]
<label> ::= <letter><digit> | <letter><digit><digit> [1]
For <equation>, write the first part: <equation> ::= <label> = [1]
Then add the second part: <label><operator><label> [1]
Draw one line from the start. It splits into two routes: a letter box or a symbol box. Both routes join again before a digit box. After the digit, put a symbol box, then a second symbol box that can be skipped by a bypass line, before the end arrow.
Start goes to either letter or symbol [1]
Ends with one symbol or two symbols (second symbol can be bypassed) [1]
Digit box, and all other connections and the label password correct [1]
Write out every possible first character, then the digit, then one or two symbols.
<password> ::= <letter><digit><symbol> |
<letter><digit><symbol><symbol> |
<symbol><digit><symbol> |
<symbol><digit><symbol><symbol>First option, <letter><digit><symbol>, correct [1]
The other three options correct [1]
Another correct way uses helper rules: <first> ::= <letter>|<symbol>, <last> ::= <symbol>|<symbol><symbol> and <password> ::= <first><digit><last>. Any two correct lines score [1], all three [2].
▶ Whole paper
Video solution of the whole paper · by Zafar Ali Khan (ZAK). 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.