Context Free Grammar
Parse Tree Visualization
What is CFG ?
Context-free grammars (CFGs) are used to describe context-free languages. A context-free grammar is a set of
recursive rules used to generate patterns of strings. A context-free grammar can describe all regular languages
and more, but they cannot describe all possible languages.
Context-free grammars are studied in fields of theoretical computer science, compiler design, and
linguistics. CFG’s are used to describe programming languages and parser programs in compilers can be generated
automatically from context-free grammars.
A context-free grammar can be described by a four-element tuple (V,∑,R,S) where