Regular Grammar Right and Left Linear Grammar
For Complete YouTube Video: Click Here
In this class, We discuss Regular Grammar Right and Left Linear Grammar.
The reader should have prior knowledge of Grammar. Click Here.
Regular Grammar is used to represent regular languages.
Regular Grammar is of two types.
right linear Grammar
left linear Grammar
The grammar contain G = {V, T, P, S}
V means set of variables. We call them nonterminals.
T means set of terminals
P means set of productions
S is the start symbol
Right Linear Grammar:
Production conditions
The right linear Grammar should follow the following conditions.
The left side of the production contains a single nonterminal.
The right side of the production should have a terminal or a terminal followed by a nonterminal.
A – x
A – xB where A, B belongs to V and x belongs to T.
The productions should follow these conditions for right linear Grammar.
Left Linear Grammar
Production conditions
The left side of the production contains Nonterminal
The right side of the production should have a terminal or a nonterminal followed by the terminal.
A – x
A – Bx where A, B belongs to V and x belongs to T.