Cambridge A2 Level Computer Science 9618 · 16.2 Translation Software

Q34 · 9618/32/M/J/25 Q8

Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2.

Q349618/32/M/J/25original Q8Structured · 4 marks
Question 8 from 9618/32/M/J/25

Worked solution

Lexical analysis is the first stage of compilation. Write any four of these:

It is the first stage of compilation [1]

White space and comments are removed [1]

The source code is broken into a series of tokens [1]

Each token is given a type (categorised) [1]

Other points that score: identifiers are stored in a symbol table; invalid tokens give an error; good tokens pass to the syntax analyser (only 4 marks available).

KEY IDEALexical analysis strips out white space and comments and turns the code into typed tokens for the next stage.
TOTAL 4 marks

Official mark scheme

Mark scheme for 9618/32/M/J/25 question 8
VIDEO
▶ Topic lesson

A lesson on this topic · by Craig'n'Dave. 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.