written 8.5 years ago by | • modified 8.5 years ago |
(i) Pipe and Filter (ii) Layered architecture (iii) Blackboard style
Mumbai University > Computer engineering > Sem 7 > Software.
Marks: 10 M
Year: May 11
written 8.5 years ago by | • modified 8.5 years ago |
(i) Pipe and Filter (ii) Layered architecture (iii) Blackboard style
Mumbai University > Computer engineering > Sem 7 > Software.
Marks: 10 M
Year: May 11
written 8.5 years ago by |
Compilers: A language translator whose input is source code and output is machine code.
Phases of a compiler:
It consist of 2 phase
Analysis phase is further divided into
Synthesis phase is further divided into - Intermediate Code Generation - Code Optimization - Code Generation
Phase1: Lexical Analysis
Phase2: Syntax Analysis
Phase3: Semantic Analysis
Phase4: Intermediate Code Generation
Phase5: Code Optimization
Phase6: Code Generation
Pipe and Filter style
The above figure shows different stages of compiler in pipe and filter style. It is a partial pipe and filter style. Each component has a set of input and output. The source code in high level language is given to the first component which processes the input and generates a corresponding output. The output is carried to the next component by the connector, here pipes. Thus, after a series of processes the target code generated is given as output.
Layered architecture
The above figure shows different stages of compiler in layered architecture style. It is a partial layered architecture. Each layer offer services to other layers. Communication takes place between the layers with the help of connectors, here procedural calls. The compiler, at each phase connect to the symbol table and the tree to complete its processes and move further to the next phase. Finally, the target code is given as output.
Blackboard style
The figure below shows different stages of compiler in blackboard style. The blackboard consisting of the symbol table and tree and the individual phases of the compiler constitute the components. The connectors can be direct memory reference, database query and so on.