CS F363 Compiler Construction L1
CS F363 Compiler Construction L1
Gain an understanding of how compilers translate source code to machine executable code.
Utilize tools to automate compiler construction.
Comprehend how to perform parsing (top down and bottom up).
Be familiar with techniques for simple code optimizations.
Have the knowledge to design, implement, and test a compiler for a simple language, to include:
o Implementing efficient mechanisms for lexical analysis.
o Creating a parse table from a Context Free Grammar.
o Implementing an efficient symbol table during the parsing phase.
o Perform elementary semantic analysis checks on an abstract syntax tree.
o Generating code for a target assembly language
Textbooks:
T1. Aho, Sethi and Ullman.Compilers Principles, Techniques, and Tools. Pearson Education. Low Price
Edition. Second Edition, 2007.
Reference books:
R1. Andrew Appel, Modern Compiler Implementation in Java.Cambridge University Press. (Foundation Books,
New Delhi.) Rev. Ed. 2000.
R2. VINU V. DAS, Compiler Design Using FLEX and YACC,Prentice-Hall India
Course Plan:
Chapter in
Lecture
Learning objectives Topics to be covered the Text
No.
Book
Introduction to Course.
1 To understand the context and use of a compiler. Structure and Components of T1 Ch1(1.2)
a compiler.
To identify tokens and lexemesand also to implement a Tokens, Lexer functionality,
lexer given a context-free grammar and its implementation
T1 Ch. 3
2
To list and identify various data structures that can be Data Structures for Symbol T1 Ch 2
used in the implementation of the symbol table Table Organization 2.7
To be able to compare and identify the proper use of Parsing, Parser Generator
T1 Ch. 4
the parsers based on the grammar. functionality
To be able to identify the appropriate parser given a Grammar Transformations for
context-free grammar different types of parsers
Notes
Top Down Parser / Recursive
3-13 descent parser, LL(1) parser
T1 Ch4
LL(1) Grammar
LL(1) Parse algorithm (4.4)
Computing first and follow sets
Bottom Up parsers -LR(0), T1 Ch4
CLR(1), SLR,LALR (4.5)
14-16 To be able to formulate their semantic grammar based Inherited and Synthesized
T1 Ch. 5
on the task. Attributes
17-20 To apply the knowledge of semantic grammar to 3AC, Syntax Trees, Translation
generate 3AC for various programming language of Expressions, Type Checking, T1 Ch. 6
constructs like if statements, loops, functions, etc. Control Flow
21-23 To be able to perform optimization given a high-level T1 Ch.
language program. Basic blocks, Flow graphs
8.4,8.5.1
To be able to apply appropriateoptimization under Directed Acyclic Graphs
different conditions. (DAG)
T1 Ch. 8.5
Loop optimizations
Mid-Semester grading: Minimum 40% weightage will be considered for the mid-sem grading.
Make-up Policy:
Make-upwill be granted only to genuine cases with prior permission.
Academic Honesty and Integrity Policy: Academic honesty and integrity are to be maintained by all the students
throughout the semester, and no academic dishonesty is acceptable.
INSTRUCTOR-IN-CHARGE
CS F363