BCS652BCS652H

Compiler Design Lab

L-T-P0-0-2 Credits1 Session2024-25 TypeLab / Practical
Appears in 2 semesters · 2 branches

B.Tech Computer Science & Engineering · Sem 6 (Lab, code BCS652) · B.Tech Computer Science (Hindi) · Sem 6 (Lab, code BCS652H)

List of Experiments / Activities

  1. 1Design and implement a lexical analyzer for given language using C and the lexical analyzer should ignore redundant spaces, tabs and new lines.
  2. 2Implementation of Lexical Analyzer using Lex Tool
  3. 3Generate 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 and YACC d) Convert the BNF rules into YACC form and write code to generate abstract syntax tree
  4. 4Write program to find ε – closure of all states of any given NFA with ε transition.
  5. 5Write program to convert NFA with ε transition to NFA without ε transition.
  6. 6Write program to convert NFA to DFA
  7. 7Write program to minimize any given DFA.
  8. 8Develop an operator precedence parser for a given language.
  9. 9Write program to find Simulate First and Follow of any given grammar.
  10. 10Construct a recursive descent parser for an expression.
  11. 11Construct a Shift Reduce Parser for a given language.
  12. 12Write a program to perform loop unrolling.
  13. 13Write a program to perform constant propagation.
  14. 14Implement Intermediate code generation for simple expressions.
  15. 15Implement 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 an 8086 assembler. The target assembly instructions can be simple move, add, sub, jump etc.
  16. Note: The Instructor may add/delete/modify/tune experiments, wherever he/she feels in a justified manner It is also suggested that open source tools should be preferred to conduct the lab (R , Python etc. )
Course Outcomes (COs)5 outcomes

After completion of the course student will be able to:

  1. CO1Identify patterns, tokens & regular expressions for lexical analysis.K2, K4
  2. CO2Design Lexical analyser for given language using C and LEX /YACC toolsK3, K5
  3. CO3Design and analyze top down and bottom up parsers.K4, K5
  4. CO4Generate the intermediate codeK4, K5
  5. CO5Generate machine code from the intermediate code formsK3, K4

Official AKTU syllabus

This subject is on page 33 of the original AKTU PDF.

Official AKTU syllabus PDF ↗