Course Material

Compiler Design and Construction

Faculty
CSIT
Semester
Sixth
Subject Code
CSC376
Total Chapters
4+

Compiler Design and Construction Learning Resources

All study materials, past questions and viva prep in one place.

Course Syllabus

Compiler Design and Construction — Official Curriculum

Compiler Design and Construction

Course Title: Compiler Design and Construction

Course No: CSC376

Nature of the Course: Theory + Lab

Semester: Sixth

Full Marks: 60 + 20 + 20

Pass Marks: 24 + 8 + 8

Credit Hrs: 3

 

Course Description:

This course is designed to develop acquaintance with fundamental concepts of compiler design. The course starts with the basic concepts and also includes different phases of compilers like lexical analysis, syntax analysis, syntax-directed translation, type checking etc. in detail.

 

Course Objectives:

The main objective of this course is to develop knowledge in compiler design, develop lexical analyzers, parsers, and small compilers using different tools, and develop lexical analyzers, parsers, and small compilers by using general purpose programming languages.

 

Course Contents:

 

Unit 1: Introduction to Compilers (3 Hrs.)

Compiler Structure: Analysis and Synthesis Model of Compilation, different sub-phases within analysis and synthesis phases; Basic concepts related to Compiler such as interpreter, simple One-Pass Compiler, preprocessor, macros, symbol table and error handler.

 

Unit 2: Lexical, Syntax and Semantic Analysis (22 Hrs.)

Lexical Analysis: Its role, Specification and Recognition of tokens, Input Buffer, Finite Automata relevant to compiler construction syntactic specification of languages, Optimization of DFA based pattern matchers; Syntax Analysis: Its role, Basic parsing techniques: Problem of Left Recursion, Left Factoring, Ambiguous Grammar, Top-down parsing, Bottom-up parsing, LR parsing; Semantic Analysis: Static & Dynamic Checks, Typical Semantic errors, Scoping, Type Checking; Syntax directed definitions (SDD) & Translation (SDT), Attribute Types: Synthesized & Inherited, Annotated Parse Tree, S-attributed and L-attributed grammar, Applications of syntax directed translation, Type Systems, Type Checking and Conversion

 

Unit 3: Symbol Table and Run-time Environment (4 Hrs.)

Symbol Table Design: Function of Symbol Table, Information provided by Symbol Table, Attributes and Data Structures for symbol table; Run–time storage management

 

Unit 4: Code Generation and Optimization (16 Hrs.)

Intermediate Code Generator: High-level and Low-level Intermediate representation, Syntax tree & DAG representations, Three-address code, Quadruples, Triples, SDT for intermediate code, Intermediate code generation for Declarations, Assignments, Control Flow, Boolean Expressions and Procedure Calls; Back patching; Code Generator: Factors affecting a code generator, Target Language, Basic blocks and flow graphs, Dynamic programming code-generation algorithm; Code Optimization: Need and criteria of Code Optimization, Basic optimization techniques; Case Studies of some compilers like C compiler, C++ complier

 

Laboratory Works:

The laboratory work develops practical knowledge on different concepts of compiler design. Students should: Create a project by using lexical analyzer generator or any high level language; Create a parser by using parser generator or any high level language; Write programs for intermediate code generation and machine code generation; Create front end of a compiler and using general purpose programming languages

 

Text Books:

  1. Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman, Compilers Principles, Techniques, and Tools, Pearson Education

 

Reference Books:

  1. Johne E. Hopcroft, Rajeev Motwani, Jeffrey D. Ulman, Introduction to Automata Theory, Languages, and Computation, Pearson Education
  2. Steven Muchnick, Advanced Compiler Design and Implementation, Morgan Kaufman Publication

No videos added yet.

Text Book

Official reference book for Compiler Design and Construction

No textbook uploaded yet.

No past questions added yet.

Viva Questions

Click any question to reveal the answer.

No viva questions added yet.

No Lab Activities added yet.

Question
Answer