▪Example 2.1. Grammar for expressions consisting of digits and plus and minus signs.
•Language of expressions L={9-5+2, 3-1, ...}
•The productions of grammar for this language L are:
list → list + digit
list → list - digit
list → digit
digit → 0|1|2|3|4|5|6|7|8|9
•list, digit: Grammar variables, Grammar symbols
•0,1,2,3,4,5,6,7,8,9,-,+ : Tokens, Terminal symbols
▪Convention specifying grammar
oAlphabets Ai
A0={0,1}
A1={a,b,c}
Languages Li for Ai
L0={0,1,100,101,...}
L1={a,b,c, ac, abcc..}