Real questions for software designers, special exercises in programming language (1)

Video explanation

Software Designer Morning Questions Programming Topic

Compilers and interpreters

Translating high-level language source programs into target programs is (48). (Second half of 2012)
(48) A. Explanation procedure B. CompilerC. Linker D. Assembler

Computers can only understand and execute machine language composed of sequences of 0 and 1, so high-level programming languages ​​need to be translated. The program responsible for this task is called a "language processing program." Due to different applications, translation between languages ​​is also diverse. Language processing programs are mainly divided into three basic types: assembler, compiler and interpreter.
An interpreter is also called an interpreter. It can directly interpret and execute the source program, or translate the source program into some intermediate representation before executing it; while the compiler (compiler) first Translate the source program into a target language program, and then run the target program on the computer. The function of the assembler is to translate source programs written in assembly language into machine instruction programs.
The linker connects each target program to form an executable program.

Among the following descriptions about interpreters and compilers, the correct one is (20). (First half of 2013)
(20)
A. Both the compiler and the interpreter generate the target program of the source program
B. Neither the compiler nor the interpreter generates the target program of the source program
C. A compiler generates an object program for the source program, but an interpreter does not
D. The compiler does not generate the target program of the source program, but the interpreter does the opposite

Compilation and interpretation methods are the two basic methods of translating high-level programming languages.
An interpreter is also called an interpreter. It either interprets and executes the source program directly, or translates the source program into some intermediate representation before executing it; while the compiler (compiler) first Translate the source program into a target language program, and then run the target program on the computer. The fundamental difference between these two language processing programs is: in the compiled mode, what is run on the machine is a target program that is equivalent to the source program, and neither the source program nor the compiled program participate in the execution process of the target program; while in the interpreted mode , the interpreter and the source program (or some equivalent representation thereof) must participate in the running process of the program, and the control of the running program lies with the interpreter. The interpreter does not produce an independent target program when translating the source program, while the compiler needs to translate the source program into an independent target program.

Among the following descriptions of the compilation and interpretation methods for implementing high-level programming languages, the correct one is (48). (First half of 2014)
(48)
A. The target program of the source program is generated in the compiled mode, but not in the interpreted mode.
B. The target program of the source program is generated in the interpretation mode, but not in the compilation mode.
C. The target program of the source program is generated in both the compilation and interpretation modes. The difference is optimization The efficiency is different
D. Neither the compilation nor the interpretation method generates the target program of the source program. The difference lies in whether it is optimized or not

A program written in a certain high-level language or assembly language is called a source program. The source program cannot be executed directly on the computer. If the source program is written in assembly language, a translation program called an assembler is required to translate it into a target program before it can be executed. If the source program is written in a high-level language, it needs a corresponding interpreter or compiler to translate it and then run it on the machine.
An interpreter is also called an interpreter. It can directly interpret and execute the source program, or translate the source program into some intermediate representation before executing it; while the compiler (compiler) first Translate the source program into a target language program, and then run the target program on the computer. The fundamental difference between these two language processing programs is that in the compiled mode, a target program equivalent to the source program is run on the machine, and neither the source program nor the compiled program participates in the execution process of the target program; while in the interpreted mode , the interpreter and the source program (or some equivalent representation thereof) must participate in the running process of the program, and the control of the running program lies with the interpreter. The interpreter does not produce an independent target program when translating the source program, while the compiler needs to translate the source program into an independent target program.

Among the following descriptions about the compilation and interpretation methods of high-level programming languages, the correct one is (20). (First half of 2016)
(20)
A. The compiler does not participate in the running control of the user program, but the interpreter does
B. The compiler can be written in high-level language, while the interpreter can only be written in assembly language
C. The compiler does not optimize the source program, while the interpreter does Optimization
D. The compilation mode does not generate the target program of the source program, but the interpretation mode does

An interpreter, also called an interpreter, either directly interprets and executes the source program, or translates the source program into some intermediate code before executing it; while a compiler (compiler) translates the source program into a target language program, and then Run the target program on the computer. The fundamental difference between these two language processing programs is: in the compilation mode, what runs on the machine is a target program that is equivalent to the source program. Neither the source program nor the compiler program participate in the execution process of the target program; while in the interpretation mode Under this circumstance, the interpreter and the source program (or some equivalent representation thereof) must participate in the running process of the program, and the control of the running program lies with the interpreter. To put it simply, in interpretation mode, when translating the source program, an independent target program is not generated, but the compiler translates the source program into an independently saved target program.

There are many different ways to translate a high-level language source program into a form that can be executed on a computer, among which, (21). (First half of 2018)
(21)
A. Both the compilation method and the interpretation method generate a target program that is logically equivalent to the source program
B. Neither the compilation method nor the interpretation method generates a target program that is logically equivalent to the source program
C. Compilation mode generates a target program that is logically equivalent to the source program, while interpretation mode does not generate a target program that is logically equivalent to the source program.
D. Interpretation mode generates a target program that is logically equivalent to the source program, while compilation mode does not generate a target program that is logically equivalent to the source program.

In the compiled mode, the machine runs a target program that is equivalent to the source program, and neither the source program nor the compiled program participates in the execution process of the target program; while in the interpreted mode, the interpreter program and the source program (Ju Lai Si) D Nongba needs to participate in the running process of the program, and the control of the running program lies in the interpreter. Simply put, in the interpreter mode, when translating the source program, an independent target program is not generated, and the compiler translates the source program into Independently saved target program.

Guess you like

Origin blog.csdn.net/weixin_50843918/article/details/134871378