Академический Документы
Профессиональный Документы
Культура Документы
ASSIGNMENT No. 1
All questions carry equal marks.
Q. 1 What is compiler? Why do we need compilers? How the compiler analyse a source
program in general.
(20)
Q. 2 Define and explain the following terms:
(a) Syntax-directed translation
(b) Parsing
(c) Lexical analysis
(20)
(20)
Q. 4 (a)
(b)
Q. 5 (a)
(b)
ASSIGNMENT No. 2
Total Marks: 100
Pass Marks: 40
All questions carry equal marks.
Q. 1 (a)
(b)
Q. 2 Convert the following regular expression into NFA using Thompsons construction.
(20)
a(a|b)*c+(a|b)*b
Q. 3 Convert the following LR grammar to right recursive grammar:
Q. 4 (a)
(b)
(20)
Q. 5 What are semantic actions and semantic rules? Construct semantic rules and
semantic actions for the rules given below and also construct a parse tree.
(20)
Course Outlines:
Unit1 Introduction to Compiling
Compliers, analysis of the source program, The phases of a Complier, Cousins of
the compiler, The grouping of phases, Complier-construction tools
Unit2 A Simple One-pass Compiler
Overview, Syntax definition, Syntax-directed translation, parsing, A translator for
simple expressions, Lexical analysis, Incorporating a symbol table, Abstract stack
machines, Putting the techniques together
Boolean