Compiler Design
Compiler Graphics
Module 1: Introduction to Compilers (8 Questions)
Define compiler and explain its different phases with a neat diagram.
Differentiate between compiler and interpreter.
Explain the structure of a compiler.
What is lexical analysis? Explain its role in the compilation process.
Describe the concept of input buffering and its importance.
Explain regular expressions and how they are used in lexical analysis.
What is finite automata? Differentiate between NFA and DFA.
Explain the process of minimizing DFA with an example.
Module 2: Syntax Analysis (9 Questions)
What is a parser? Explain its role in compiler design.
Differentiate between top-down and bottom-up parsing.
Explain context-free grammar with an example.
What are parsing errors? Discuss error handling techniques in parsers.
Describe the working of recursive descent parsing.
Explain LL(1) parser with an example grammar.
What is shift-reduce parsing? Explain its steps.
Compare LR(0), SLR(1), LALR, and CLR parsers.
Write short notes on syntax analyzer and its tools like YACC.
Module 3: Syntax-Directed Translation (8 Questions)
Define syntax-directed definition (SDD) and syntax-directed translation (SDT).
What are synthesized and inherited attributes? Give examples.
Explain dependency graphs and evaluation order of SDDs.
What is an annotated parse tree? Explain with an example.
Explain how syntax-directed translation helps in intermediate code generation.
Describe L-attributed and S-attributed grammars.
Explain translation schemes for arithmetic expressions.
Discuss implementation of syntax-directed definitions.
Module 4: Run-Time Environments (9 Questions)
What is a run-time environment? Explain its significance.
Describe stack allocation of space in runtime memory.
Differentiate between stack and heap memory management.
Explain activation records with their structure.
What is access to non-local data on the stack? Explain with example.
Describe memory management and garbage collection.
Explain static and dynamic memory allocation.
What is trace-based collection?
Explain the concept of runtime storage organization.
Module 5: Code Generation & Machine-Independent Optimization (15 Questions)
Code Generation (7 Questions)
What are the main issues in the design of a code generator?
Explain intermediate code generation and its types.
Define basic block and flow graph with examples.
What is optimization of basic blocks? Explain DAG representation.
Explain register allocation and assignment.
Describe code generation phases in detail.
Write short notes on simple code generator design.
Machine-Independent Optimization (8 Questions)
What is code optimization? Why is it necessary?
Differentiate between machine-dependent and machine-independent optimization.
Explain the role of data-flow analysis in optimization.
What are common subexpression elimination and constant propagation?
Define partial redundancy elimination with example.
Explain dead code elimination and loop optimization techniques.
What is peephole optimization? Give examples.
Discuss the flow graph representation used in optimization.
Comments
Post a Comment