Which compilation stage checks the program follows the language's rules?
- Tokens are checked against the grammar.
- A parse tree is built.
- Syntax analysis.
Answer Syntax analysis
A-level Computer Science revision · Processors, software and development
Compilers translate the whole source code into machine code before running; interpreters translate and run line by line; assemblers translate assembly language. Compilation stages: lexical analysis (tokens, symbol table), syntax analysis (grammar, parse tree), code generation and optimisation. Linkers combine object code with libraries; loaders place code in memory.
Watch out Lexical analysis removes whitespace and comments and builds the symbol table; it does not check grammar.
Which compilation stage checks the program follows the language's rules?
Answer Syntax analysis
Which translator converts assembly language into machine code?
What does a linker do?
Give one advantage of an interpreter during development.
Answer Errors are reported as each line runs, so the programmer can find and fix them quickly without recompiling the whole program.
A-level Computer Science Pro, OCR H446
£119 once
Price rises to £199 on 1 January. Save £80 by joining before then.
At least 12 months of access
No VAT is charged.