Back close

Course Detail

Course Name Compiler Design MCA
Course Code 26CSA560
Program M. C. A.
Credits 3
Campuses Amritapuri, Mysuru

Syllabus

Unit 1

Introduction To Compilers: Definition of compiler, interpreter and its differences, the phases of a compiler, role of lexical analyzer, regular expressions, finite automata, from regular expressions to finite automata, pass and phases of translation, bootstrapping, LEX-lexical analyzer generator.

Unit 2

Parsing: Parsing, the role of the parser, context free grammar, derivations, parse trees, ambiguity, elimination of left recursion, left factoring, eliminating ambiguity from dangling-else grammar, classes of ptop-downtop down parsing – backtracking, recursive descent parsing, predictive parsers, LL (1) grammars.  

Bottom-Up Parsing: Definition of bottom-up parsing, handles, handle pruning, stack implementation of shift-reduce parsing, conflicts during shift-reduce parsing, LR grammars, LR parsers-simple LR, canonical LR(CLR) and Look Ahead LR (LALR) parsers, error recovery in parsing, parsing ambiguous grammars, YACC-automatic parser generator.  

Unit 3

Syntax Directed Translation: Syntax directed definition, construction of syntax trees, S-attributed and L-attributed definitions, translation schemes. 

 Intermediate Code Generation: intermediate forms of source programs– abstract syntax tree, polish notation and three address code, types of three address statements and their implementation syntax-directed translation into three-address code, translation of simple statements, Boolean expressions and flow-of-control statements.  

Unit 4

Type Checking: Definition of type checking, type expressions, type systems, static and dynamic checking of types, specification of a simple type of checker, equivalence of type expressions, type conversions, overloading of functions and operators.  

Run Time Environments: Source language issues, Storage organization, storage-allocation strategies, access to non-local names, parameter passing, symbol tables and language facilities for dynamic storage allocation.  

Unit 5

Code Optimization: Organization of code optimizer, basic blocks and flow graphs, optimization of basic blocks, the principal sources of optimization, the directed acyclic graph (DAG) representation of basic block, and global data flow analysis.  

Code Generation: Machine dependent code generation, object code forms, the target machine, a simple code generator, register allocation and assignment, peephole optimization.  

Objectives and Outcomes

Course Description 

A compiler is system software that is required to convert computer programmes into a format that can be executed on the intended machine. Creating a compiler necessitates knowledge of several areas of computer science, including logic, formalism, mathematics, data structures, algorithms, and programming. This course is intended to serve as an introduction to the various stages involved in the design of standard compilers, beginning with the front-end stages of compilation and progressing to the back end and some recent advancements in the field. 

Course Objectives 

The goal of this course is to educate students on the phases of a compiler and the techniques for designing a compiler. This course introduces students to the fundamental concepts of compilation phases such as lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and code generation. 

Course Outcomes 

COs 

Description 

CO1 

Describe stages of compilation, and lexical Analysis 

CO2 

Compare different types of parsers (Bottom-up and Top-down) and construct a parser for a given grammar.

CO3 

Analyze syntax directed translation and representations of intermediate code 

CO4 

Describe type checking and run time environment 

CO5 

Illustrate code optimization and code generation techniques in the compilation. 

CO-PO Mapping 

PO/PSO 

PO1 

PO2 

PO3 

PO4 

PO5 

PO6 

PO7 

PO8 

CO 

CO1 

– 

– 

– 

– 

– 

CO2 

– 

– 

– 

– 

– 

CO3 

– 

– 

– 

– 

CO4 

– 

– 

– 

– 

CO5 

– 

– 

– 

– 

– 

Textbooks / References

  1. Keith Cooper and Linda Torczon, “Engineering a Compiler”, Second Edition, Morgan Kauffmann, 2011.
  2. Alfred V.Aho, Monica S. Lam, Ravi Sethi and Jeffrey D. Ullman, “Compilers: Principles, Techniques and Tools”, Prentice Hall, Second Edition, 2006.
  3. Andrew W. Appel and Jens Palsberg, “Modern Compiler Implementation in Java”, Cambridge University Press, Second Edition, 2002.
  4. Tremblay and Sorenson, The Theory and Practice of Compiler Writing, Tata McGraw Hill & Company.

DISCLAIMER: The appearance of external links on this web site does not constitute endorsement by the School of Biotechnology/Amrita Vishwa Vidyapeetham or the information, products or services contained therein. For other than authorized activities, the Amrita Vishwa Vidyapeetham does not exercise any editorial control over the information you may find at these locations. These links are provided consistent with the stated purpose of this web site.

Admissions Apply Now