SHSubjectHub

Context-Free Languages: BNF and Syntax Diagrams

AQA 75174.4.3.1A-levelLesson packSubscription
Also online

This worksheet marks itself

Set it as homework or classwork and every answer is marked as pupils go, with feedback on what they got wrong. The scores go straight into your mark book, so you can see who needs help before the next lesson.

  • 11 questions
  • 45 marks
  • about 55 minutes
  • marked instantly

Question types: short answer, multi-part, multiple choice, fill the gap, true or false.

About this resource

AQA A-level Computer Science (7517) Paper 1, 4.4.3.1 Context-free languages — checking language syntax against Backus-Naur Form (BNF) or syntax (railroad) diagrams, formulating simple production rules, and explaining why BNF can represent recursive/nested languages that regular expressions and FS…

27 slides.

Lesson outline

  1. Do Now — Retrieval: Finite State Machines
  2. I-Do: What Is BNF and Why Do We Need It?
  3. Quick Check — The ::= Operator
  4. I-Do: BNF Notation, Precisely
  5. Quick Check — Terminal or Non-Terminal?
  6. We-Do: Recursion in a Production Rule
  7. Hinge Check — Which Alternative Is the Base Case?
  8. I-Do: Checking a String — Derivation Tree for "352"
  9. We-Do — Check Your Understanding: Deriving "84"
  10. I-Do: Checking Validity Against a Grammar
  11. Hinge Check — Misconception: Is a Single Letter Enough?
  12. We-Do — Check Your Understanding: Validity Checks
Unit bundlePaper 1
Part of: Paper 1: the whole unitEvery resource in the unit in one zip.

More from 4.4 Theory of computation