Automata Theory and Compiler Design Course Handout
Automata Theory and Compiler Design Course Handout
Course Objective: The objective of this course is to enable the student to equip with the concepts of Formal language,
Automata theory and Compiler design necessary to analyse the core of all computers and their applications. It provides
the notion of automata which helps to model the hardware of a computer.
Course Rationale: This course covers the concepts of Automata and Compiler design which helps in the construction of
the abstract models of Computers and Computations. These models embody the important features that are common to
both hardware and software and that are essential to many of the special and complex constructs we encounter while
working with the computers. Even when such models are too simple to be applicable immediately to real world situations,
the insight we gain from studying them provide the foundation on which specific development is based. The development
of models is one of essentials of any scientific discipline.
Blooms
Taxonomy
C.O.No Course Outcome (CO) PO/PSO Level(BTL)
Course Highest COI-1 (BTL 1) COI-2 (BTL 2) COI-3 (BTL 3) COI-4 (BTL 4)
Outcome BTL
No.
CO1 3 Recalling the basic Understand the Apply the concepts Finite Analyze the concept
concepts of Discrete concepts of FA and Automata to convert DFA of FA for its
Mathematics (its Regular Expression. to NFA and introduction minimization and
prerequisite) and to € NFA. Conversion of regular
Introduction to expression to NFA
automata and compiler with examples
design.
CO2 4 Recall and Remember Understand the Apply the concepts of Able to analyze the
the basic concepts of concept of designing a Parse Tree and check for concept of parsing
Grammar, CFG, Parse CFG for a given the ambiguity of a CFG, and construction of
Tree and derivations to language, Introduction Parser, Types of parses, parsing table,
solve some conceptual to Parsing, Parse tree and Backtracking with introduction to
questions. and different types of examples. Bottom-Up parsing,
parsing. Construction of
LALR Parser and
construction of parser
with ambiguous
grammar.
CO3 4 Concept of SDT, Understanding the
Apply the concepts type Analysis of Storage
Syntax trees, Bottom concepts of control
checking for type allocation strategies,
Up evaluation of S- flow statements and
conversion, overloading Access to non-local
attributed and L- building Abstract
of the functions and Names, parametric
attributed definition. Syntax tree, Type
operators and storage passing, symbol
checking
organization. tables and dynamic
storage allocation.
CO4 4 Concept of Understanding the Principal source of Analysis of global
Intermediate code concept of a simple optimization, Peephole data flow of
generation, The basic code generator, DAG optimization structured flow
flow graphs. representation of graph, symbolic
block. debugging of
optimized code.
CO5 The implementation of the problems related to the Automata in JFLAP and lexical
Analysis using C programming as well as LEX tool apart from the fundamentals.
Program Outcomes (POs):
PSO No Description
An ability to solve Electronics Engineering problems, using latest hardware and software tools, to arrive cost
PSO1 effective and appropriate solutions in the domain of embedded systems and Internet of Things.
An ability to demonstrate basic knowledge of Web Technologies for development of web based applications
PSO2 along with knowledge and skill related to cyber security.
SYLLABUS (As approved by BOS):
Formal Language and Regular Expressions: Languages, Definition Languages regular expressions, Finite Automata - DFA,
NFA. Conversion of regular expression to NFA, NFA to DFA. Applications of Finite Automata to lexical analysis, lex tools.
Context Free grammars and parsing: Context free grammars, derivation, parse trees, ambiguity LL (K) grammars and LL (1)
parsing. Bottom up parsing handle pruning LR Grammar Parsing, LALR parsing, parsing ambiguous grammars.
Syntax directed translation, S-attributed and L-attributed grammars, Intermediate code - abstract syntax tree, translation of simple
statements and control flow statements. Context Sensitive features - Chomsky hierarchy of languages and recognizers. Type
checking, type conversions, equivalence of type expressions, overloading of functions and operations. Run time storage: Storage
organization, storage allocation strategies scope access to now local names, parameters, language facilities for dynamics storage
allocation. Code optimization: Principal sources of optimization, optimization of basic blocks, peephole optimization, flow graphs,
Dataflow analysis of flow graphs. Code generation: Machine dependent code generation, object code forms, generic
code generation algorithm, Register allocation and assignment. Using DAG representation of Block.
TEXT BOOKS:
1. Introduction to Theory of Computation by Sipser, 2nd Edition,Thomson.,2009.
2. Compilers Principles, Techniques and Tools Aho, Ullman, Ravisethi, Pearson Education,2009.
REFERENCES :
1. Introduction Automata theory and formal languages, and computation, John E Hopcraft and JD Ullman,2007.
2. Modern Compiler Construction in C, Andrew W.Appel Cambridge University Press. 2005.
3. Compiler Construction, LOUDEN, Thomson,2006.
Deviations (if any) from BoS approved syllabus and the topics planned:
YES NO NA
Sess. Evaluation
CO COI Topic (s) Teaching-Learning Methods
No. Components
14. Represent CFG, Parse Tree and its Test-1, End Exam,
2 1 Chalk and Talk, PPT - Observe
relation to CFG, Tutorial
Types of Derivations in deriving a
15. string from any CFG, Parse trees Chalk and Talk, PPT - Observe Test-1, End Exam,
2 1
Construction. Tutorial
18. Top Down and Bottom Up Parsing Chalk and Talk, PPT - Observe Test-1, End Exam,
2 2
Tutorial
25.
2 4 Construction of LALR Parser Test-1, End Exam,
Chalk and Talk, PPT – Observe Tutorial
26. Construction of bottom-up parser with Chalk and Talk, PPT – Observe Test-1, End Exam,
2 4
ambiguous grammar Tutorial
27. Syntax directed translation definition Chalk and Talk, PPT – Observe Test-2, End Exam,
3 1
(Attribute Grammar) Tutorial
28. Construction of Syntax Trees Chalk and Talk, PPT – Observe Test-2, End Exam,
3 1
Tutorial
29. Bottom Up evaluation of S- attributed Chalk and Talk, PPT – Observe Test-2, End Exam,
3 1
definition Tutorial
31. Translation of simple statements and Chalk and Talk, PPT – Observe Test-2, End Exam,
3 2
control flow statements Tutorial
32. Building Chalk and Talk, PPT – Observe Test-2, End Exam,
3 2
Abstract Syntax Tree(AST) Tutorial
37. Run Time Storage- Source language Chalk and Talk, PPT – Observe Test-2, End Exam,
3 3
issues Tutorial
43. Language facilities for dynamic storage Chalk and Talk, PPT – Observe Test-2, End Exam,
3 4
allocation Tutorial
46.
3 1 Basic blocks and flow graphs Chalk and Talk, PPT – Observe Test-2, End Exam,
Tutorial
51.
4 3 Peephole optimization Chalk and Talk, PPT – Practice Test-2, End Exam,
Online Quiz
52.
4 3 The principal source of optimization Chalk and Talk, PPT - Practice Test-2, End Exam
Lecture Number: 1
Lecture Outcome:
Recap to discrete mathematics
05 Attendance
10 Mathematical Preliminaries and notations.(Sets, Functions and Relations) 1 Talk - Discussion
30 Overview of the Course Outcomes (Handout) 1 PPT’s - Observe
05 Conclusion & Summary Discussion
Lecture Number: 2
Lecture Outcome:
Understand the basics of Compiler and automata
Lecture Number: 3
Lecture Outcome:
Understand the Finite Automata
Lecture Number: 4
Lecture Outcome:
Understand DFA
Lecture Number: 5
Lecture Outcome:
Understand Regular Expresssions
Topic BTL Teaching – Learning Method
Time(min)
05 Attendance
10 Recap of DFA 1 Talk – Discussion
20 Regular Expression and Regular language with examples. 1 Chalk and Talk, PPT’s - Observe
10 ALM : related problems 2 Quiz
05 Conclusion & Summary Discussion
Lecture Number: 6
Lecture Outcome:
Understand the Problems on Regular Expresssions.
Lecture Number: 7
Lecture Outcome:
Understand Non Deterministic Finite Automata (NFA)
Lecture Number: 8
Lecture Outcome:
Understand the conversion from NFA to DFA
Lecture Number: 9
Lecture Outcome:
Understand the CFG
Lecture Number: 10
Lecture Outcome:
Understand converstion from NFA with € - Transitions to NFA without ε transitions and hence to DFA
Lecture Number: 11
Lecture Outcome:
Understand Minimization of FA
Lecture Number: 12
Lecture Outcome:
Understand Conversion of regular expression to NFA
Lecture Number: 13
Lecture Outcome:
Understand CFG
Lecture Number: 14
Lecture Outcome:
Represent CFG, Parse Tree and its relation to CFG,
Lecture Number: 15
Lecture Outcome:
Understand Representation of CFG, Parse Tree and its relation to CFG,
Lecture Number: 16
Lecture Outcome:
Understand CFG for a given language.
Lecture Number: 17
Lecture Outcome:
Understand to Parsing and Parse Trees
Lecture Number: 18
Lecture Outcome:
Understand Top Down and Bottom Up Parsing
Lecture Number: 19
Lecture Outcome:
Checking the Ambiguity of a CFG by constructing the parse trees
Lecture Number: 20
Lecture Outcome:
How eliminating ambiguity in CFG
Time(min) Topic BTL Teaching – Learning Method
05 Attendance
10 Recap on Checking the Ambiguity of a CFG by constructing the parse trees 1 Talk – Discussion
20 Ambiguous grammars & eliminating ambiguity 1 Chalk and Talk – Listen
10 ALM : related problems 1 In class assessment
05 Conclusion & Summary Discussion
Lecture Number: 21
Lecture Outcome:
Understand Parsers, Backtracking.
Lecture Number: 22
Lecture Outcome:
Understand Recursive Descent Parsing, Predictive Parsing .
Lecture Number: 23
Lecture Outcome:
Learn Construction of LL(1) Parsing Table
Lecture Number: 24
Lecture Outcome:
Understand Bottom-up Parsing
Lecture Number: 25
Lecture Outcome:
Learn Construction of LALR Parser
Time(min) Topic BTL Teaching – Learning Method
05 Attendance
10 Recap on Construction of LL(1) Parsing Table 1 Talk – Discussion
20 Construction of LALR Parser 1 Chalk and Talk, PPT’s - Observe
10 ALM 2 In class assessment
05 Conclusion & Summary Discussion
Lecture Number: 26
Lecture Outcome:
Construction of bottom-up parser
Time(min) Topic BTL Teaching – Learning Method
05 Attendance
10 Recap on Construction of LALR Parser 1 Talk – Discussion
20 Construction of bottom-up parser with ambiguous grammar 1 Chalk and Talk, PPT’s – Observe
10 ALM: construction of bottom -up parser 2 In class assessment
5 Conclusion & Summary Discussion
Lecture Number: 27
Lecture Outcome:
Understand Syntax directed translation definition (Attribute Grammar)
Lecture Number: 28
Lecture Outcome:
Understand Construction of Syntax Trees
Lecture Number: 29
Lecture Outcome:
Learn Bottom Up evaluation of S- attributed definition
Lecture Number: 30
Lecture Outcome:
Understand L-attributed definition
Lecture Number: 31
Lecture Outcome:
Understand Translation of simple statements and control flow statements
Lecture Number: 32
Lecture Outcome:
Understand building AST
Lecture Number: 33
Lecture Outcome:
Understand Type Checking- Type systems
Lecture Number: 34
Lecture Outcome:
Apply Equivalence of type expression
Lecture Number: 35
Lecture Outcome:
Understand type conversion
Lecture Number: 36
Lecture Outcome:
Understand Overloading of functions and operators
Lecture Number: 37
Lecture Outcome:
Understand POSETS
Lecture Number: 38
Lecture Outcome:
Understand Problems on Lattices
Lecture Number: 39
Lecture Outcome:
Understand and Apply Topological sorting
Lecture Number: 40
Lecture Outcome:
Analyzes Graphs, Types of Graphs and Subgraphs
Time(min) Topic BTL Teaching – Learning Method
05 Attendance
10 Recap on Storage allocation strategies 1 Talk – Discussion
20 Access to non-local names 1 Chalk and Talk – Listen
10 Active Learning Program (LTC) 2 Match the following
5 Conclusion & Summary Discussion
Lecture Number:41
Lecture Outcome:
Understand concepts of Isomorphism
Lecture Number: 42
Lecture Outcome:
Understand the Symbol tables
Lecture Number: 43
Lecture Outcome:
Understand Language facilities for dynamic storage allocation
Lecture Number: 44
Lecture Outcome:
Understand Intermediate code generation
Lecture Number: 45
Lecture Outcome:
Understand The target machine
Lecture Number: 46
Lecture Outcome:
Understand concepts Basic blocks and flow graphs
Lecture Number: 47
Lecture Outcome:
A simple code generator
Lecture Number: 48
Lecture Outcome:
Register Allocation and assignment
Lecture Number: 49
Lecture Outcome:
DAG representation of Block
Lecture Number: 50
Lecture Outcome:
Generate code for DAG’s
Lecture Number: 51
Lecture Outcome:
Peephole optimization
Lecture Number: 52
Lecture Outcome:
Understand source of optimization
Lecture Number: 53
Lecture Outcome:
Optimization of basic blocks
Lecture Number: 54
Lecture Outcome:
Global data flow analysis
Time(min) Topic BTL Teaching – Learning Method
05
Attendance
10 Recap on Optimization of basic blocks 1 Talk – Discussion
20 Introduction to global data flow analysis 1 Chalk and Talk, Practice
10 Active Learning Program : related applications 2 Develops applications
5 Conclusion & Summary Discussion
Lecture Number: 55
Lecture Outcome:
Understand structured flow graph
Lecture Number: 56
Lecture Outcome:
Understand Symbolic debugging of optimized code
1 CO 1
Write a program to perform operations on sets.
2 CO 1
Write a program to find the possible subsets for a given set.
3 CO 1
a) Write a program to find the inversion of a given matrix.
b) Write a program to display the rows of a given matrix by eliminating the duplicate rows.
4 CO 1
a) Write a program to display the ncr table.
b)Write a program to find the no. of ways to rearrange the given word by placing the vowels
together
5 CO 2
Write a program to find the given expression is tautology or not.
6 CO 2
Write a program to find the super digit of an integer.
7 CO 3
Write a program to sort the given elements in an array using divide and conquer approach.
8 CO 4
Write a program to find the minimum cost spanning tree for a given graph using kruskal's
algorithm
9 CO 4
Write a program to implement the shortest path routing using dijsktra's algorithm
10 CO 4
Write a program to find the minimum number of colors for a given graph.
1 CO 1
2 CO 1
3 CO 1
4 CO 2
5 CO 2
6 CO 2
7 CO 3
8 CO 3
9 CO 3
10 CO 4
11 CO 4
12 CO 4
EVALUATION PLAN:
Evaluation CO CO CO CO CO
Type Evaluation Component Weightage /Marks Assessment Dates Duration 1 2 3 4 5
Bloom's Taxonomy Level 2,3 2,3 2,3 2,3 2,3
Weightage 10 2.5 2.5 2.5 2.5
ALM & Tutorial Max Marks 160 Continuous Evaluation 40 40 40 40
Weightage 5 Lab experiment 5
continuous
evaluation will be for
25 marks for each
experiment and the
Formative
average of all
Evaluation
experiments is scaled
Total = 20%
to 5. Initial rubrics for
evaluation are:
[ Record(5) +
Lab Continuous Experimentation (10)
Evaluation Max Marks 25 Continuous Evaluation + Viva-voce(10)] 25
Weightage 5
Attendance Max Marks 5 Continuous Evaluation (Equal weightage to all sessions)
Weightage 12 6 6
Test-1 Max Marks 30 Test 1 Dates 1.5 hrs 15 15
Weightage 12 6 6
Test-2 Max Marks 30 Test 2 Dates 1.5 hrs 15 15
In-Semester
Summative Lab exam will be
Evaluation conducted for 25
Total = 30% Weightage 6 marks and scaled to 6
Lab Internal Tests 6. Initial rubrics for
evaluation are:[Write
up (10) +
Experimentation (10)
Max Marks 25 Lab Internal Dates 1.5 hrs + Vivavoce(5)] 25
Lab exam will be
conducted for 50
marks and scaled to
End 10. Initial rubrics for
Semester evaluation are:
Summative [Record (10) + Write
Evaluation up (10) +
Total = 50% Weightage 10 Experimentation (20) 10
SE LAB EXAM Max Marks 50 Lab External Dates 1.5 hrs + Vivavoce(10)] 50
Weightage 40 10 10 10 10
Sem End Exam
Semester End Exam Max Marks 60 Dates 3 hrs 15 15 15 15
Course Team members, Chamber Consultation Hours and Chamber Venue details:
Chamber
Chamber Consultation Chamber Consultation Signature of
S.No. Name of Faculty Consultation
Day(s) Timings for each day Course faculty
Room No:
1
Ketan Anand All working days 12:40 to 1:30PM R-202