According to Chomsky's hierarchy, four basic types of grammar are used in the automaton theory. These are the following:
The four types of grammar are explained below.
The productions in this type 0 have no restrictions. This type of grammar includes all types of formal grammar.
The productions produced by this grammar are of the format
The following is an example of type 0 grammar:
Type 1 grammar produces productions in the format
There is an exception in this grammar. It is that the rule
The following is an example of type 1 grammar:
Type 2 grammar produces rules in the form of
The following is an example of type 2 grammar:
Type 3 grammar has a nonterminal on the left side of the arrow and a nonterminal or a combination of a terminal and a nonterminal.
The productions produced are in the form of
The production
The following is an example of type 3 grammar:
Free Resources