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 is it in a computer that can convert a source program written in a high-level language into a target program?

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 what the computer can convert the source program written in the high-level language into the target program, which 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.

It is the "compiler" that converts a source program written in a high-level language into a target program. A compiler refers to a translator that translates a source program written in a high-level programming language into an equivalent machine language format object program; 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.

It is the "compiler" that converts a source program written in a high-level language into a target program. A program written by a high-level language is called a "source program", a program represented by a binary code is called a "target program", and the conversion of a source program into a machine-recognized target program is completed by 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.

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. 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

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 can convert the source program written in the high-level language into the target program in the computer" shared by the editor will be 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.

Share To

Internet Technology

Wechat

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

12
Report