levo

Software Engineering and Program Construction

Syntax and semantic analysis

  • 3 things to know
  • AS Unit 1

Overview

Faults that syntax analysis would report and type error found by semantic analysis.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Explain why checking types before the program runs is safer than checking them as it runs.

Key term

Give two examples of faults that syntax analysis would report.

Key term

What is parsing?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What does syntax analysis check?

    Model answer

    It checks that the stream of tokens forms statements that obey the grammatical rules of the language.

  2. 2

    Give two examples of faults that syntax analysis would report.

    Model answer

    A selection statement left without its closing keyword, and an arithmetic expression with an operator but no second operand.

  3. 3

    What is parsing?

    Model answer

    Parsing is the process of working out how a sequence of tokens fits the rules of the language, and building a structure that records how the statement is put together.

  4. 4

    What does syntax analysis pass on to the next stage?

    Model answer

    It passes on a structured representation of the program showing how its statements and expressions are nested, rather than the flat sequence of tokens it received.

  5. 5

    Why does a translator normally continue after finding the first syntax error?

    Model answer

    So the programmer can be given a list of all the faults it can detect in one run, instead of having to retranslate after correcting each one.

  6. 6

    Why can one genuine mistake produce several error messages?

    Model answer

    The analyser loses track of the structure at the point of the fault, so the statements that follow no longer fit the rules until it manages to resynchronise.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Hardware: Architecture, Memory and Storage
Networks and Data Transmission
Logic Gates and Boolean Algebra
Data Representation and Data Types

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

Fetch, , execute.
decodecompilestore

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AEncryption is reversible.
BThe stored form could be decrypted.
CA hash cannot be reversed.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A bit is a single binary digit.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Software Engineering and Program Construction, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.