The difference between context free grammar and context sensitive grammar are:
Context free grammar | Context sensitive grammar |
1.In context free grammar, there will be no context. | 1. In context sensitive grammar, there is either left context or right context. |
2.It is a set of recursive rules used to generate patterns of strings. | 2.It is a formal language in which the left-hand sides and right-hand sides of any production rules may be surrounded. |
3.It can describe all regular languages but cannot describe all possible languages. | 3.There are languages that can be described by a CSG but not by a context-free grammar. |
4.CFG are studied in the field of theoretical computer science, design etc. | 4.CSG can describe the syntaxes of some visual programming language. |
5.It has four-element tuple (V,Σ,R,S), R is a set of production rules where each production rule maps a variable to a string. | 5.It also has four-element tuple G=(Σ, V, S, P), P is also a set of production rules but does not maps each production rule. |
Click here to submit your answer.
s