开发者

Definition of a compiler pipeline

Can someone explain this term to me in an开发者_C百科 abstract way and then give me a small example how this works. In my opinion it has something to do with the front end and back end of a compiler and how the phases are performed. I have problems to describe it in my own words.

Thanks for your replies Matthias


A compiler performs language transformation: Input is in language A and output is in language B (and usually there are some requirements attached to the type of languages and the result of the transformation). In oder to do that the input goes through various stages inside the compiler - these stages form the pipeline.
The most commonly used division consists of 3 stages: Front End - Middle End - Back End
The Front End is responsible for parsing the input language and performing syntax and semantic checks (to make sure the input program is conformant to language specification A) and then transforms it into an intermediate language. The Middle End takes the intermediate representation and usually performs several (language independent) optimization steps on it (although one could skip that). After the Middle End is finished the resulting transformed program in intermediate language is passed to the backend which transforms it into language B usually also performs some optimizations specific to language B.
Each of the three stages consists of several steps as well. And everything together forms the pipeline of the compiler as it is basically how the programs flows through the system being transformed along the way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜