0 Grammar: There is no limit on its rules. Any number of symbols can generate any number of symbols. By 0 Language name generated by grammar 0 Language, recognition 0 Language machines correspondTuring Machine.
1 grammar : intuitively, there are two completely different 1 type grammar, but it is actually equivalent. A monotonic language requires no more symbols on the left of its rule than those on the right, for example: n e-> and n . Another language is called context-related. Context-related means that only one symbol on the left of the rule is replaced, and the symbols that are not replaced are kept in the original position. By 1 grammar 1 type language, recognition 1 the type language machine corresponds to linear boundary machine . Example:
Name comma name end-> name and name end.
2Grammar:2Grammar is a context-independent grammar. Simply put, there is only one non-Terminator on the left side of the rule. A typical feature of context-independent grammar is that it can be recursively nested. By2Language name generated by grammar2Language, recognition2Language machines correspondPush-down Automation. For example:
Name-> Tom | dick | Harry
SentenceS-> Name | list and name
List-> name, list | Name
3Grammar: It can only contain two types of rules: one is generated by a non-Terminator0. The second is the generation of a non-Terminator.0One or more Terminators and the last non-Terminator3Language name generated by grammar3Language, recognition3Language machines correspondFinite Automaton. For example:
SentenceS-> T | d | H | list
List-> T listtail | D listtail | H listtail
Listtail-> List | & T | & d | & H
4Grammar: No non-terminator appears on the right of the rule. By4Language name generated by grammar4Language. For example,
SS-> [TDH] | [TDH] & [TDH] | [TDH], [TDH] & [TDH]
N e-> and N