volume_mute
Two Architectures for a Compiler
publish date: 2026/06/10 22:54:3.427697 UTC
volume_mute
A compiler can be organized using two alternative architectural patterns. Which of the following correctly describes when each is preferable?
Correct Answer
Pipe and Filter is effective in batch environments where programs are compiled without user interaction; Repository is better when the compiler is integrated with other tools like structured editors, debuggers, or prettyprinters, where changes must be reflected immediately across components
Explanation
The Pipe and Filter compiler model is effective in batch environments where programs are compiled and executed without user interaction (e.g., translating XML documents). However, when a compiler is integrated with other language processing tools - a structured editor, interactive debugger, or prettyprinter - changes from one component need to be reflected immediately in others, making a repository-based organization (with the symbol table and syntax tree as the central repository) more appropriate.
Reference
Software Engineering, Ian Sommerville, 10th edition
