Compiler Design Lab (B.Tech)

Building lexical analysers and parsers using LEX and YACC.

6 MonthsDuration 6Chapters21Topics

Syllabus · पाठ्यक्रम

Download PDF
01Lexical Analysis in C 3 topics
  1. Lexical analyser for a subset of C
  2. Identifying keywords, identifiers, constants and operators
  3. Removing comments and white space
02LEX Programs 4 topics
  1. LEX program structure
  2. Counting characters, words and lines
  3. Recognising identifiers and numbers
  4. Counting vowels and consonants
03YACC Programs 3 topics
  1. YACC program structure
  2. Calculator with operator precedence
  3. Validating arithmetic expressions and variable names
04Parsing Algorithms 5 topics
  1. Elimination of left recursion and left factoring
  2. FIRST and FOLLOW computation
  3. Predictive parsing table
  4. Shift-reduce parsing
  5. Recursive descent parser
05Intermediate Code Generation 3 topics
  1. Infix to postfix conversion
  2. Three-address code generation
  3. Quadruples and triples
06Code Optimisation 3 topics
  1. Constant folding
  2. Common sub-expression elimination
  3. Simple code generator for assembly-like target

About

You will be able to

  • Write a lexical analyser in C that identifies keywords, identifiers, operators and constants
  • Write LEX programs for token recognition and counting
  • Write YACC programs for expression evaluation and syntax checking
  • Implement FIRST / FOLLOW, left recursion removal and predictive / shift-reduce parsing
  • Generate three-address code, quadruples and triples for expressions
  • Implement simple code optimisation techniques

Who it is for

  • B.Tech Computer Science & Engineering students of Semester 6 (AKTU)
  • Students of other universities studying the same subject who want unit-wise coaching

What you need

  • Compiler Design theory of the same semester
  • C programming on Linux with flex and bison / yacc installed

Questions

Which syllabus does the Compiler Design Lab course follow?

It follows the AKTU (Dr. A.P.J. Abdul Kalam Technical University, Lucknow) B.Tech syllabus for Compiler Design Lab. If your own university's syllabus differs, the centre follows your university syllabus.

Will this help in the university examination?

Yes. Teaching is unit-wise as per the AKTU scheme, with previous-year question practice, MCQ tests and doubt sessions before the semester exam.

Can LEX and YACC be run on Windows?

Yes, with WinFlexBison or WSL, but Ubuntu Linux with flex and bison is recommended, as in most AKTU labs.

Download the syllabus (PDF)

Tell us who you are — your copy is made with your name, and our counsellor can help you choose the right course and centre.

Want to join right away? Enquire now — our centre will call you.