Joke Collection Website - Bulletin headlines - Principles of Compilation: From Grammar to Target Language

Principles of Compilation: From Grammar to Target Language

Designing a language is no joke, it requires a deep technical foundation. This article will introduce you a little knowledge of the compilation principle to help you better understand the compilation process.

Basic understanding

Compilation is the process of translating a high-level language into machine language. Before learning the principle of compilation, you need to have a basic understanding of compilation and understand what compilation is.

compilation process

The compilation process probably includes lexical analysis, grammatical analysis, semantic analysis, secondary generation, assembly generation, conversion into target language and operation.

Difficult point analysis

In the process of compilation, it is difficult to analyze grammar and semantics and convert them into the target language. In the design grammar stage, you need to conceive a rigorous grammar, preferably above LR(0), otherwise the language you design may be full of loopholes.

Learning suggestion

I really suggest you buy a book about compilation, provided that you have mastered a language. So you can write it yourself block by block. Although you are not making your own programming language, you can understand the compilation principle from a macro perspective. Try to choose books written by domestic authors. Their books are clear in logic and detailed in concept explanation, which is very suitable for beginners.

Domestic author

The books compiled by domestic authors have clear logic and detailed concepts, which are very suitable for beginners. Foreign books are a bit confusing.

* * * There is progress.

I hope this little knowledge can help you! Compilation principle is a very important subject, which needs constant study and practice. Let's cheer together and make progress together!