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
- Do Now — Retrieval: Finite State Machines
- I-Do: What Is BNF and Why Do We Need It?
- Quick Check — The ::= Operator
- I-Do: BNF Notation, Precisely
- Quick Check — Terminal or Non-Terminal?
- We-Do: Recursion in a Production Rule
- Hinge Check — Which Alternative Is the Base Case?
- I-Do: Checking a String — Derivation Tree for "352"
- We-Do — Check Your Understanding: Deriving "84"
- I-Do: Checking Validity Against a Grammar
- Hinge Check — Misconception: Is a Single Letter Enough?
- We-Do — Check Your Understanding: Validity Checks
Unit bundlePaper 1
More from 4.4 Theory of computation
- Lesson pack · 4.4.1Abstraction and AutomationSubscription
- Lesson pack · 4.4.2Sets, Regular Expressions and Regular LanguagesSubscription
- Lesson pack · 4.4.2.1Finite State MachinesFree
- Lesson pack · 4.4.4Classification of Algorithms (Big-O, Tractability, Halting)Subscription
- Lesson pack · 4.4.5.1Turing MachinesSubscription
- Knowledge organiser · 4.4Theory of Computation (Part 1) — Abstraction, Automation & Finite State MachinesFree
- Knowledge organiser · 4.4Theory of Computation (Part 2) — Sets, Regular Expressions & BNFSubscription
- Knowledge organiser · 4.4Theory of Computation (Part 3) — Classification of Algorithms & Turing MachinesSubscription


