Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1. Discuss syntax directed translation (SDT)?

2. Construct syntax tree for the expression x =(a +*b-* c) / (a +b * c).


3. Explain inherited and synthesized attributes. 2Marks CO3 3 2 1.D. Discuss
dead code.
4. List the characteristics of peephole optimization.
5. Compare local optimization with global optimization.
6. Construct SDD (Syntax Directed Definition) for x*y5+z.
7. Generate a Three Address Code for the following for ( i = 0; i < 5; i++) { a=
b+c; }
8. Construct DAG for the following expression: T1 = a + b T2 = T1 + c T3 =
T1 x T2
9. Discuss the design issues of Code Generator
10.Give Three-Address Code and it's quadruple representation for the
assignment: a = b * - c + b * c
11.Convert the following infix expression into post fix expression by using
stack implementation. ((A + B) – C * (D / E)) + F.
12.. Show annotated parse tree for the expression (2+3)*(4+5). Apply the S-
attributed definition and constructs syntax trees for a simple expression
grammar involving only the binary operators + and -. As usual, these
operators are at the same precedence level and are jointly left associative. All
nonterminal have one synthesized attribute node, which represents a node of
the syntax tree. Production :L->E$ E→E1+T,E →T, T>T1*F,T→ ( E),T→
digit.
13.Explain about the following in detail (i) compile Time evaluation
(ii)Common sub expression Elimination.
14.List the DAG applications and Construct DAG on the following expressions.
T1 = a + b T2 = T1 + c T3 = T1 x T2
15.Explain about basic block.
16.Explain about code motion and apply it on the following code. while(i<100)
{ a = Sin(x)/Cos(x) + i; i++; }

17.Explain Global common sub expression.

18.Translate the expression –(a+b)*(c+d)+(a+b+c) in to quadruple, triple and indirect triple.

19.Give the S-attributed SDD of a simple desk calculator and show annotated parse tree
for the expression (3+4)*(5+6).

20.Explain the Numerical Representation of Boolean Expressions with an example of each.


21.Explain Abstract syntax tree? Develop SDD for the given expression?
Apply AST for the expression x*y-5+z.

22.Construct the DAG and three address code for the expression a+a*(b-c)+(b-c)*d.

23.Differentiate dead code elimination and code motion.

24.Discuss about Function preserving optimization techniques.

25.Explain in brief about peephole optimization techniques.

26.Explain the following machine independent optimization techniques. a) Common sub expr
elimination b) Copy propagation, constant folding.

27.Identify difference between machine independent optimization and machine dependent


optimization? Explain the loop optimizations with suitable examples?
Identify the Time complexity and Space complexity.

28. Explain Global common sub expression.

29.Construct Syntax Directed Definition and


Construct Syntax Tree for the expression a-4+c.

30.Explain how to generate three address codes with syntax directed definitions
with an example.

31.Describe the following and show an example for each.


i). Three-address code iii). Triples ii). Quadruples iv). Indirect triples.

32.Explain the Numerical Representation of Boolean Expressions with an example of each.

33.Construct the DAG and three address code for the expression a+a*(b-c)+(b-c)*d.

34.Explain the rules to construct a flow graph.

35.Generate target code from sequence of three address statements


using simple code generator algorithm.

36.Explain in brief about peephole optimization techniques.

37.Explain the following machine independent optimization techniques.


a) Code motion and dead code elimination b) Copy propagation, strength reduction.

38.Construct basic blocks, data flow graph and identify loop invariant statements
for the following: for (i=1 to n) { j=1; while (j<=n) { A=B*C/D; j=j+1; } }

You might also like