MCA-20-24(iii): Compiler Design
Type: Elective
Contact Hours: 4 hours/week
Examination Duration: 3 Hours
Mode: Lecture
External Maximum Marks: 75
External Pass Marks: 30(i.e. 40%)
Internal Maximum Marks: 25
Total Maximum Marks: 100
Total Pass Marks: 40(i.e. 40%)
Instructions to paper setter for End semester exam:
Total number of questions shall be nine. Question number one will be compulsory and will be consisting of short/objective type questions from complete syllabus. In addition to compulsory first question there shall be four units in the question paper each consisting of two questions. Student will attempt one question from each unit in addition to compulsory question. All questions will carry equal marks.
Course Objectives: The objective of the course is to provide in-depth coverage of underlying concepts & techniques used in compiler design and to cover major topics in compilation Theory. This course will make students ready for job assignments involving compilers and prepare students to undertake projects on compilers Construction.
Course Outcomes (COs) At the end of this course, the student will be able to:
MCA-20-24(iii).1 understand overall process of compilation;
MCA-20-24(iii).2 understand the process of parsing in compilers;
MCA-20-24(iii).3 analyze semantic analysis, building a symbol table, handle storage management and error-detection in the process of compiler designing;
MCA-20-24(iii).4 design a compiler and understand the concept of code generation and optimization.
Unit – I
Compilers and Translators, Need of Translators, Tools used for compilation, Structure of Compiler, Single-Pass and Multi-Pass Compilers, Bootstrapping, Compiler Construction Tools, Phases of Compilation process, Classification of grammars.
Lexical Analysis: Design, Finite Automata and Regular Expressions, Process of Lexical Analysis, Lexical Analyzer generators, Derivations and parse trees.
Unit – II
Parsing Techniques: Top down Parsing- Predictive Parsers, Left Recursion and its removal, Recursive Descent Parsers, LL Grammars.
Bottom-up parsing: Shift Reduce Parsing, Operator Precedence Parsing, LR Parsers, LR grammars, Comparison of parsing methods, Parser Generators.
Unit – III
Semantic Analysis: Syntax-Directed Translation Schemes.
Building Symbol Table, Data Structures for symbol table, representing scope information.
An overview of Run-time Storage Administration.
Error Detection and Recovery: Errors, Lexical-Phase Errors, Syntactic Phase Errors, Semantic Errors.
Unit – IV
Intermediate Source Forms: Postfix Notation, Syntax Trees, Triples & Quadruples.
Code Optimization: Potential cases of Code Optimization, Optimization of basic blocks, Local and Global optimizations, Code Improving Transformation.
Code Generator: Issues in the design of a code generator.
Text Books:
1. Alfred V Aho, Principles of Compiler Design, Narosa Publishing House.
2. Jean Paul Tremblay and Sorenson, The Theory and Practice of Compiler Writing, McGraw Hill.
Reference Books:
1. Dhamdhere D.M, System programming and operating system, McGraw Hill.
2. Beck L. Leland, System Software, Pearson Education.
3. Aho, Sethi, & Ullman, Compilers Principles, Techniques and Tools, Pearson Education.
4. Fischer, Crafting a compiler in C, Pearson Education.