The grammar of compiling principle

Source: Internet
Author: User
Tags definition

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.