Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does an interpreter mean in a computer?

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces what the interpreter in the computer refers to. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.

An interpreter is a language processor that can directly execute the source program or the internal form of the source program (intermediate code) when running the user program. The interpreter has the advantages of simple structure, easy to implement, convenient for program scheduling and modification, man-machine dialogue, and suitable for programming and execution in interactive conversation mode.

The interpreter is a language processor, which is basically the same as the compiler in lexical, grammatical and semantic analysis, but when running the user program, it directly executes the internal form of the source program or the source program (intermediate code). Therefore, the interpreter does not produce the target program, which is the main difference between it and the compiler.

The interpreter consists of a general control program and several execution subroutines. The working process of the interpreter is as follows: first, the master control program performs the initial preparation work and sets the initial state of work; then, a statement S is taken from the source program and syntax checking is carried out. If there is an error in the syntax, the error message is output; otherwise, the corresponding execution subroutine is transferred to the execution subroutine according to the determined statement type. After returning, check whether the explanation work is completed, and if not, continue to explain the next sentence; otherwise, carry out the necessary follow-up work.

The work of the interpreter is as follows:

The initialization of ① is completed by the master control program.

② successively takes a statement from the source program for syntax checking, and if there is an error, it outputs the error message; if it passes the syntax check, it translates the statement into the corresponding instruction and executes it.

③ checks to see if the source program has been fully interpreted and executed, and if not, continues to interpret and execute the next statement until all statements have been processed.

Features:

The way the interpreter works is very suitable for people to talk to the computer through the terminal device, such as typing a command or statement on the terminal, the interpreter immediately interprets the statement as one or more instructions and submits it to the hardware for immediate execution and reflects the execution result to the terminal. After entering the command from the terminal, the calculation result can be obtained immediately.

This is indeed very convenient and suitable for the calculation of some minicomputers. However, the execution speed of the interpreter is very slow, for example, if there is a loop in the source program, the interpreter also repeatedly interprets and submits for execution of this set of statements, which causes a lot of waste.

A high-level language program that executes while interpreting and translating source code into machine code. Therefore, the function of the interpreter is to interpret and execute high-level language programs. Because of its convenience and interactivity, some early high-level languages adopted this approach, such as BASIC and dBASE. However, its weakness is that the running efficiency is low, and the running of the program depends on the development environment, so it can not be run directly under the operating system.

The outstanding advantage of the interpreter is that it can be easily implemented, and it is easy to insert modification and debugging measures flexibly and conveniently in the process of interpretation and execution, but the biggest disadvantage is that the execution efficiency is very low. For example, statements that need to be executed repeatedly need to be translated only once when using the compiler, but they need to be translated and executed repeatedly in the interpreter.

The above is all the contents of the article "what does the interpreter in the computer mean?" Thank you for your reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 242

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report