Formal systemic grammar
G is called grammar, if G=, where

N is a set of non-terminators.

T is a set of terminal symbols.

For the opening symbol, n.

P is a set of production rules, for example, where (N T)*,; That is, it cannot be an empty string.

N T=。

Some start symbols are denoted by s.

Generally, non-terminators are represented by uppercase English letters and terminators.

These symbols are represented by lowercase English letters.

Grammar (continued)

example

N={A,B,},T={a,b}

Students: Ab, A Ba, B b, B Bb.

The language it can recognize.

Ab Bab … Bbnab bbnab bn+ 1ab

b+ab

Corresponding FSA

Grammar (continued)

Four types of languages and their corresponding grammars and machines

Type 0: Its corresponding grammar is unrestricted grammar. Its product rule has no limit.

Type 1: Its corresponding grammar is context-sensitive grammar. Its generation rule is related to the up and down, that is, in the generation rule 1 2 1 2, 1 2 will be exported only if the left side of the generation rule must be1and the right side must be 2. The length of all symbols on the right side of the generation rule must be greater than.

Grammar (continued)

Type 2: Its corresponding grammar is a text-free grammar. Its generation rule is context-free, but there is only one non-terminal on the left side of the generation rule.

Third, its corresponding grammar is regular grammar. Its generation rules limit that there can be at most one non-terminator on the left and right sides of the generation rule, and only one terminator on the right side of the generation rule.