National Institute of Technology Rourkela

राष्ट्रीय प्रौद्योगिकी संस्थान राउरकेला

ଜାତୀୟ ପ୍ରଯୁକ୍ତି ପ୍ରତିଷ୍ଠାନ ରାଉରକେଲା

An Institute of National Importance

Syllabus

Course Details

Subject {L-T-P / C} : CS3075 : Compiler Design Laboratory { 0-0-3 / 2}

Subject Nature : Practical

Coordinator : Prof. Ramesh Kumar Mohapatra

Syllabus

Lab assignments includes:
1. A C Program to Design Lexical Analyzer
2. Understanding the LEX/FLEX tool. Implementation of Lexical Analyzer using LEX/FLEX Tool.
3. Develop a lexical analyzer to recognize a few patterns in C. (Ex. identifiers, constants, comments, operators etc.)
3. Implementation of Predictive Parser in C language.
4. Understanding the YACC tool.
5. Generate YACC specification for a few syntactic categories.
a. Program to recognize a valid arithmetic expression that uses operator +, – , * and /.
b. Program to recognize a valid variable which starts with a letter followed by any number of letters or digits.
c. Implementation of Calculator using LEX/FLEX and YACC
6. Convert the BNF rules into YACC form and write code to generate Abstract Syntax Tree.
7. Implement type checking.
8. Implement control flow analysis and Data flow Analysis.
9. Implement any one storage allocation strategies (Heap, Stack, Static)
10. Construction of DAG
11. Implement the back end of the compiler which takes the three address code and produces the 8086 assembly language instructions that can be assembled and run using a 8086 assembler. The target assembly instructions can be simple move, add, sub, jump. Also simple addressing modes are used.
12. A Program to Generate Machine Code.
13. Implementation of Simple Code Optimization Techniques.
14. Design of a mini compiler for simple programs.

Course Objectives

  • To familiar with various tools and modules used in the design of a compiler.
  • To study the concepts of Assembler, Macro Processor, Loader, Linker and various phases of compiler and syntax analysis.
  • To learn the various parsing techniques, the semantic analysis, translation of statements.
  • To learn about Generating and Optimizing codes.

Course Outcomes

To provide an understanding of the language translation peculiarities by designing complete translator for small user defined language. To provide an understanding of the design aspect of operating system.

Essential Reading

  • Alfred Aho, Jeffrey Ullman, Monica S. Lam, and Ravi Sethi, Compilers: Principles, Techniques, and Tools, Pearson , 2014
  • Ronald Mak, Writing Compilers and Interpreters: A Software Engineering Approach, Wiley , 2011

Supplementary Reading

  • Anrew W. Appel, Modern Compiler Implementation in JAVA, Cambridge University Press , 2003
  • Kenneth C. Louden, Compiler Construction, Principles and Practice, Thomson Books , 2007