#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!