Professional Documents
Culture Documents
TECHNOLOGY
1,KnowledgePark-II,GreaterNoida,U.P.
Assignment Sheet-1
1. What is a Cross Compiler? How a Boot Strapping of a compiler done to a second machine? Suppose,
you have a Pascal to C translator written in C and a working C compiler. Use T diagram to describe
the steps you would take to create a working Pascal compiler.
3. Discuss the action taken by every phase of the Compiler on the string:-
A=B*C+D/E
4. Describe the Algorithm for subset construction and computation of є-closure.
5. What do mean by Left Factoring and Left Recursion?
6. What are lexical phase errors, syntactic phase errors and semantic phase errors? Explain with
suitable example.
7. What do you mean by ambiguous grammar? Show that the following grammar is ambiguous.
S->aSbS/bSaS/∈
GALGOTIAS COLLEGE OF ENGINEERING AND
TECHNOLOGY
1,KnowledgePark-II,GreaterNoida,U.P.
Assignment Sheet-2
2. Show that the following grammar is LR (1) but not LALR (1).
G: S→Aa\bAc\Bc\bBa
A→d
B→d
3.) Describe the representation of scope information in the symbol table .Consider the following
program structure and gives its symbol table organization:-
Program main
Var x,y: integer
Procedure P
Variable X,a : Boolean
Procedure Q
Var x,y,z : real
1) What is DAG? Explain DAG representation. Give the algorithm for construction of DAG.
Also explain how it helps in elimination of common sub expression.
2) Discuss the principal sources of code optimization with the help of suitable examples. What is
the need of code optimization, illustrate.
3) Explain the global data flow analysis. What is its use in code optimization?
6) Write an algorithm to partition a sequence of three address statements into basic blocks.
8) How to subdivide a run-time memory into code and data areas. Explain.
9)