JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

IT602PC: PRINCIPLES OF COMPILER CONSTRUCTION

B.Tech III Year II Semester (R18)

Course Objectives:

  • To understand the various phases in the design of a compiler.
  • To study various data structures used
  • To understand the design of top-down and bottom-up parsers.
  • To understand syntax directed translation schemes.
  • To introduce lex and yacc tools.
  • To learn intermediate languages
  • To learn to develop algorithms to generate code for a target machine.
  • To learn how to optimize machine code

Course Outcomes:

  • Ability to design, develop, and implement a compiler for any language.
  • Able to use lex and yacc tools for developing a scanner and a parser.
  • Able to design and implement LL and LR parsers.
  • Able to design algorithms to perform code optimization in order to improve the performance of a program in terms of space and time complexity.
  • Ability to design algorithms to generate machine code

UNIT - I

Introduction: Phases of compiler, Groping of phases. Lexical Analysis: The Role of the Lexical Analyzer, Input Buffering, Recognition of Tokens, The Lexical-Analyzer Generator LEX, Finite Automata, From Regular Expressions to Automata.

UNIT - II

Syntax Analysis: Introduction, Context-Free Grammars, Writing a Grammar, Top-Down Parsing, Bottom-Up Parsing, Introduction to LR Parsing: Simple LR, More Powerful LR Parsers.

UNIT - III

Syntax-Directed Translation: Syntax-Directed Definitions, Construction of syntax trees, Bottom-up evaluation of S-attributed definitions, L-attributed definitions, Top down translation, Bottom-up evaluation of inherited attributes. Type checking: Type systems, Specification of a simple type checker, Equivalence of type expressions. Intermediate-Code Generation: Intermediate languages, Declarations

UNIT - IV

Run-Time Environments: Storage organization, Storage allocation strategies, Symbol tables. Code Generation: Issues in the Design of a Code Generator, The Target Machine, Basic Blocks and Flow Graphs, , A Simple Code Generator, Register Allocation and Assignment, Generation of DAGs, Generating code from DAGs.

UNIT - V

Machine-Independent Optimizations: Introduction, The Principal Sources of Optimization, Introduction to Data-Flow Analysis, Foundations of Data-Flow Analysis.

TEXT BOOKS:

  • 1. Compilers: Principles, Techniques and Tools, Second Edition, Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffry D. Ullman, Pearson. R18 B.TECH IT III YEAR

REFERENCE BOOKS:

  • 1. Compiler Construction-Principles and Practice, Kenneth C Louden, Cengage Learning.
  • 2. Modern compiler implementation in C, Andrew W Appel, Revised edition, Cambridge University Press.
  • 3. The Theory and Practice of Compiler writing, J. P. Tremblay and P. G. Sorenson, TMH
  • 4. Writing compilers and interpreters, R. Mak, 3rd edition, Wiley student edition.
  • 5. lex & yacc – John R. Levine, Tony Mason, Doug Brown, O’reilly R18 B.TECH IT III YEAR

Loading Question Papers

Fetching data from database...