DCRUST SYLLABUS
CSE302C COMPILER DESIGN
CATEGORY : ENGINEERING SCIENCE COURSE
Course Objectives:
- Apply the knowledge of lex tool & yacc tool to develop a scanner & parser.
- Design and conduct experiments for Intermediate Code Generation in compiler.
- Develop program to solve complex problems in compiler
- Learn the new code optimization techniques to improve the performance of a program in terms of speed and space.
Unit I
Introduction: Compilers and translators need of translators, structure of compiler: its different phases,Compiler construction tools.
Lexical Analysis: Role of lexical analyzer; Design of lexical analyzer; Regular expressions ;Specificationand recognition of tokens; Input buffering; Finite automata; Conversion from regular expression to finite automata, and vice versa; Minimizing the number of states of DFA, Implementation of lexical analyzer.
Click on any topic to read about the topic.
Unit II
Syntactic Techniques & Parsing: Context free Grammars; Derivations & parse trees; Capabilities ofCFGs; Role of parsers, Shift- Reduce Parsing ; Operator precedence parsing; top down parsing; predictive parsing, LR parsers; LR(0) items SLR, LALR and Canonical LR parser.
Click on any topic to read about the topic.
Unit III
Syntax Directed Translation , Symbol Table & Error Handling : Syntax directed definition,construction of syntax trees, syntax directed translation scheme, implementation of syntax directed translation, Intermediate Code ;Parse trees & Syntax trees; Three address code, quadruples and triples; Translation of Boolean Expressions. Symbol tables, its contents and data structure for symbol tables; trees, arrays, linked lists, hash tables ; Operations on symbol table; Errors( lexical phase error, syntactic phase error, semantic error).
Click on any topic to read about the topic.
Unit IV
Code Optimization & Code Generation: Sources of code optimization; Loop optimization (Denominators, Reducible flow graphs, depth first search, loop invariant computation, Induction variable elimination ) ; Directed acyclic representation of basic blocks Code generation, forms of objects code, machine dependent code, register allocation for temporary and user defined variables; Problems in code generation; Peephole optimization.
Click on any topic to read about the topic.
TEXT /REFERENCE BOOKS:
- Compilers Principle, Techniques & Tools – Alfread V. AHO, Ravi Sethi& J.D. Ullman; – 1998Addison Wesley.
- Theory and practice of compiler writing, Tremblay & Sorenson, 1985, Mc. Graw Hill.
- System Software by Dhamdhare, 1986, MGH.
- Principles of Compiler Design, Alfred V Aho , Jeffery D. Ullman , Narosa Publication
Course Outcomes: After successful completion of the course:-
- Students will get the concepts of Compilers and the actual roles of the lexical analyzer
- Students will get the concepts of different Parsing techniques and Construction of syntax trees
- Students will get the concepts of Type checking and Run time environments
- Students will get the concepts of Intermediate code generation, Code optimization and Code generations.