Multi-pass compiler
A multi-pass compiler is a type of compiler that processes the source code or abstract syntax tree of a program several times. This is in contrast to a one-pass compiler, which traverses the program only once. Each pass takes the result of the previous pass as the input, and creates an intermediate output. In this way, the (intermediate) code is improved pass by pass, until the final pass produces the final code. Multi-pass compilers are sometimes called wide compilers, referring to the greater scope of the passes: they can "see" the entire program being compiled, instead of just a small portion of it. The wider scope thus available to these compilers allows better code generation (e.g.... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
A multi-pass compiler is a type of compiler that processes the source code or abstract syntax tree of a program several times. This is in contrast to a one-pass compiler, which traverses the program only once. Each pass takes the result of the previous pass as the input, and creates an intermediate output. In this way, the (intermediate) code is improved pass by pass, until the final pass produces the final code. Multi-pass compilers are sometimes called wide compilers, referring to the greater scope of the passes: they can "see" the entire program being compiled, instead of just a small portion of it. The wider scope thus available to these compilers allows better code generation (e.g. smaller code size, faster code) compared to the output of one-pass compilers, at the cost of higher compiler time and memory consumption. In addition, some languages cannot be compiled in a single pass, as a result of their design. if (cond) { ... } else { ... } In addition to performing semantic analysis at this stage of compilation, often symbol tables are created in order to assist in code generation. ==Frameworks== There are a number of meta-frameworks for designing multi-pass compilers, such as nanopass compilers which use explicit intermediate languages. Bornat, Richard, Understanding and Writing Compilers: A Do It Yourself Guide, Macmillan Publishing, 1979. Bent Thomsen, Languages and Compilers SProg og Overseattere, Department of Computer Science, Aalborg University
Cite this
"Multi-pass compiler". 1787318309. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1370512628 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy