Site icon i2tutorials

Compiler Design-Context Free Grammars

Context Free Grammars

 

Context free grammar is a language used to retrieve strings in a given language.

 

Four tuples that are used to define context free grammar are:

G = (V, T, P, S)

 

Where:

G describes the grammar.

T describes the finite set of terminal symbols.

V describes a finite set of non-terminal symbols

P describes a set of production rules

S is the start symbol.

 

The derivation of the string starts from the start symbol. We can place a non-terminal repeatedly to derive the string using right-hand production. 

 

Reference Link

Context Free Grammars

Exit mobile version