Job 1 for the compiler theory

1) Description of the compiler and interpreter, contact the differences of the assembler.

Contact: compiler, assembler translation programs and the programs are written in a language transformed into a program in another language. A compiler is a kind of translator, assembler is a translation program.

Difference: the compiler is the high level of low-level source language into the target language. Through a translator between the language is transformed, the goal of the program is finally completed an equivalent program. The assembler is a program to translate assembly language into machine language program.

2) compilation process, including the main function of which several main stages and each stage.

Compilation process includes lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and code generation target.

Lexical analysis: read the character stream source scanning and decomposition, the character identifying each collective meaning.

Parsing: The syntax is correct according to the rules of the source language examination. If an error is an error message is output, put right after the "lexical analysis" identified word sequence broken down into various types of grammatical phrases, forms of internal structure of the intermediate language program.

Semantic Analysis: further examine the source semantic correctness, then generates the code type information collection section.

Intermediate code generation: After the "parse" and by "semantic analysis", some of the source code compiler into an internal representation form, called "intermediate code."

Code optimization: The "intermediate code" to transform transformation to make it more efficient and achieve the purpose of saving time and space.

Object code generation: the "optimized intermediate code" into the absolute or relocatable instruction code generation instruction code or assembler instruction code on a particular machine, thereby forming a target program.

3) Description of the difference between the interpreter and compiler.

Compiler compiler can support system platform to run on, when the program execution is not dependent on other software environments;
interpreter is needed to explain the implementation of the program through the software environment.

4 ) understand the new open-source compiler Huawei's Ark , understand and talk about its basic ideas and technology route, as well as its Android software ecosystem will be affected.

The basic idea : the intermediate compiler representation Ark ( the IR ) converter converts the input into the front end of the ark the IR , and fed to the rear end of the optimizer finally generate binary file, an executable file links to libraries binary runtime compiler, you can execute the file in the operating environment in the ark.

Technology route of : providing a mechanism to compile and run the new systems and applications, from dynamic compilation into a statically compiled directly to the high-level language compiled directly into machine code.

Android software ecosystem of the impact : Ark compiler can achieve a variety of applications in joint programming language compiler optimization to improve performance, but at the same time, multi-platform support, providing easy development and deployment strategy to enhance the efficiency of the device according to feature. Eliminate the overhead of VM dynamic compilation to achieve compatible development and operational efficiency of both.

Guess you like

Origin www.cnblogs.com/seele233/p/11458076.html