The first job - understanding of compiler theory

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

  Compilation process sequence - sequence is running a full compilation of the first; is an interpreter and a translator translate and execute the program .

Source code by the C compiler, an assembler source, and then generate the target program by the assembler, and finally generate executable by the linker.

Translation program - refer to translate high-level language source code into machine language source code (object code) software. Translation program, there are two: one is the compiler, it will be high-level language source programs all at once translated into the target program, each time the execution of the program, as long as the target program. Another is to explain the program, its execution is a translation of an execution, and do not generate the target program.

Assembler - also a language translation program that translates assembly language source code into machine language program.
If the source language is a "high-level language", and the target language such as assembly language or machine language like "low-level language," such a translation program called a compiler.
If the source language is assembly language and the target language is the machine language, such a translation program called assembler.

 

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

  Compilation process is generally divided into lexical analysis, syntax analysis, semantic analysis and code generation, code optimization and code generation targets six main stages. The main function of the various stages are as follows:

Lexical analysis - from left to right to read a character by character into the source code, the source code for the character stream constituting the scanning and decomposed to identify.

Parsing - the basis on sequence of words in lexical analysis broken down into various types of grammatical phrases.

Semantic Analysis - review whether the source semantic errors, code generation phase information collection types.

Intermediate code generation - After work syntax analysis and semantic analysis phase, some compiler source program into an internal representation.

Generating object code - the intermediate code into an instruction code on the absolute or specific machine instructions relocatable instruction code or assembler code.

3) the difference between DESCRIPTION compiler and interpreter.

The compiler can generate the target program, but the program can not interpret. Compiler to compile the overall finished, and then a one-time execution. The interpreter is he explains, while execution. Submit an explanation after the implementation of a computer, do not form the target program. Like a foreign language translation of "interpretation", as a turn to say, do not produce the full text of the translated text. The compiler is the source of each statement are compiled into machine language, and save it as a binary file, the computer can directly in machine language to run this program is running so fast. The interpreter is only in the implementation of the program, only one by one into machine language to explain the computer to perform, so speed is not as good as the program compiled to run fast. This is because the computer can not directly recognize and enforce our written statement, it can only recognize machine language (binary form).

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.

Ark compiler is designed to support multiple programming languages, jointly compiled a variety of chip platforms, designed to run unified programming platform, including compilers, tools, chain, and other key components of the runtime. Ark compiler also continue to evolve, the ability to continue to achieve the above and open source.

Hardware trends - smart times, all things Internet, terminal equipment complex and diverse, and gradually form a mobile phone-centric, multi-device interoperability trends.

Software ecological development demands - terminal equipment varied, endless scenarios, programming languages, diverse operating environment, the efficiency of interoperability between different programming languages continue to affect application performance, device platform differences inconvenience to developers.

Ark compiler bring solutions - through a unified multi-language IR representation can be achieved in a variety of application programming language compiler optimization to enhance the joint performance; at the same time, multi-platform support, providing easy development and deployment strategy to enhance the efficiency of the device according to feature .

Guess you like

Origin www.cnblogs.com/pangminhua/p/11458093.html