In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces why the translation program that translates the high-level language source program into the target program in the computer has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let's take a look at it.
A translator that translates a high-level language source program into a target program is called a compiler. The compiler takes the source program written in the high-level programming language as the input and the object program expressed in assembly language or machine language as the output.
A translator that translates a high-level language source program into a target program is called a compiler.
A Compiler,compiling program, also known as a compiler, is a translator that translates a source program written in a high-level programming language into an equivalent machine language format target program. The compiler belongs to the translator realized by the way of generative implementation. It takes the source program written by the high-level programming language as the input and the object program represented by the assembly language or machine language as the output. The compiled target program usually goes through the running phase in order to run with the support of the running program, process the initial data and calculate the required calculation results.
Characteristics of the compiler:
The compiler must analyze the source program and then synthesize it into the target program. First of all, check the correctness of the source program and decompose it into several basic components; secondly, according to these basic components to establish the corresponding equivalent part of the target program. In order to accomplish this work, the compiler needs to establish some tables in the analysis phase and transform the source program into an intermediate language form so that it can be easily referenced and processed in analysis and synthesis.
The main data structures used in data structure analysis and synthesis, including symbol tables, constant tables and intermediate language programs. The symbol table consists of identifiers used in the source program along with their attributes, which include categories (such as variables, arrays, structures, functions, procedures, etc.), types (such as integers, real types, strings, duplicates, labels, etc.), and other information needed by the target program. The constant table consists of the constants used in the source program, including the in-machine representation of the constants and the target program address assigned to them. An intermediate language program is an intermediate program introduced before translating a source program into a target program, and the choice of its representation depends on how the compiler uses and processes it later. The commonly used intermediate language forms are Polish, triple, quad, indirect triple and so on.
The analysis of some source programs is realized through three steps: lexical analysis, grammatical analysis and semantic analysis. Lexical analysis is done by a lexical analysis program (also known as a scanning program), whose task is to identify words (that is, identifiers, constants, reserved words, as well as various operators, punctuation marks, etc.), create symbol tables and constant tables, and transcode the source program into an internal form that is easy for the compiler to analyze and process.
The parser is the core part of the compiler, and its main task is to check whether the source program is grammatical or not according to the syntax rules of the language. If it is not grammatical, the syntax error information is output; if grammatical, the grammatical structure of the source program is decomposed and the internal program in the intermediate language form is constructed.
The purpose of grammatical analysis is to understand how words form sentences and how sentences form programs. The semantic analysis program is to further check the semantic correctness of the legal program structure, and its purpose is to ensure the correct use of identifiers and constants, collect and save the necessary information into the symbol table or intermediate language program, and carry on the corresponding semantic processing.
Thank you for reading this article carefully. I hope the article "what is the translation program that translates a high-level language source program into a target program in a computer" shared by the editor is helpful to everyone. At the same time, I also hope that you will support it and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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: 0
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.