Home  >  Article  >  What does a compiler spend most of its time on?

What does a compiler spend most of its time on?

尚
Original
2020-04-21 15:20:197981browse

What does a compiler spend most of its time on?

#The compiler spends most of its time managing tables. During the compilation process, various information of the source program is retained in various tables. The work at each stage of compilation involves constructing, searching, or updating related tables.

The compiler's process of translating a source program into a target program is divided into five stages: lexical analysis; syntax analysis; semantic checking and intermediate code generation; code optimization; and target code generation. It mainly performs lexical analysis and syntax analysis, also known as source program analysis. During the analysis process, grammatical errors are found and prompt information is given.

Public auxiliary part of the compiled program. Manage various quantities in the source program and register them in the corresponding tables. The required information is obtained by looking up the table during compiler processing.

The above is the detailed content of What does a compiler spend most of its time on?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn