About the principle of compiling this piece has not been involved before, this time to use the knowledge here will need to contact the content here. The principle of compiling, as its name implies, is the principle of dealing with high-level languages, which are called language (low-level languages) that computers can recognize. And what about grammar? Is the method used to describe the programming language. Similar to the Dharma, used to describe the Buddhist scriptures of Zen Buddhism. No need to tangle the name, know the meaning, enough.
Grammar
Concept
Non-terminal and non-non-terminal
Figure: In the set of the derivation of P, there are six deduced formulas. where S, A, and B are not terminators. A, B, C, D, Q, p are terminators. Non-terminal is an atom that cannot be divided.
Classification
The classification of grammar is also a few, first look at their definition, in the definition, first understand the approximate. To understand the meaning of some of the keywords in the definition can be, in the back through the example to consolidate there is no problem.
O-Type grammar
When I saw this definition, I remembered the time when I was in high school like a song. Ha ha! Vn,vt,p,s in the definition above
Vn: That means a non terminator.
Vt: Terminator.
P: Represents a collection of derivations. As we see in the first picture, the six derivations are p.
S: Start character, SAB. It is important to know the above keywords.
In the derivation, the derivation of the left only satisfies at least one non-terminal and then the 0-type grammar.
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/project/