Context Free Grammar : A CFG is a way of describing language by recursive rules. A CFG consists four tuples, denoted G = {V, T, P, S}
Where,
V = Finite set of variables. [Eg. {S, E}etc.]
T = Finite set of terminals. [Eg. {a, b, c,+}etc.]
P = Finite set of productions. [Eg. E E+E]
S = Start symbol.
Example :
Let a CFG which is given :
Here, V = {E}
T = {+, *, id}
S = E
So, the grammar notation is written as; G = (E, {+, *, id}, P, E)
0 comments:
Post a Comment