Lect-03
Lect-03
Parser
7. |–
P = { 1, 2, 3, 4, 5, 6, 7}
CFG - Grammar of Expressions: Example
Given a CFG, we can derive sentences by repeated substitution.
Consider the sentence x + 2 – y
1. goal expr
3. | term
4. term number
5. | id
6. op +
7. |–
CFG - Grammar of Expressions: Example