Escolar Documentos
Profissional Documentos
Cultura Documentos
QUESTION NUMBER 1. 2. 3. 4. 5.
QUESTION
What is compiler? Why do we need compiler? What is Interpreter? .Explain the role of lexical analyzer, syntax analyzer and semantic analyzer in detail. Write a CFG, which generate string of balanced parenthesis. Consider the CFG SXX X XXX/ bX/ Xb/a Find the parse tree for the string bbaaaab What do you understand by Parse Tree? What is left most derivation? What is right most derivation? 1. Finding leading and trailing for the following grammer. EE+T | E TT*F | T F(E) | id Design operator precedence parser for the above grammar. What is syntax directed translator? Find the postfix notation for the following: 1) a + b*(c+d)e/f*(g/h)-i 2) -(a+b)*cd+e/(a+b+cd)-g+h/i Construct syntax tree for the following: 1)a + b*(c+d)e/f*(g/h) -i 2)-(a+b)*cd+e/(a+b+cd) -g+h/i Write three address code for a + b*(c+d)e/f*(g/h) -i Quadruple Tripple Indirect Tripple
UNIT 1 1 1 2 2
6. 7.
2 3
8. 9. 10. 11.
i) ii)
3 3 4 4 4
12.
1. Construct DAG for the following a+b*(c+d)e/f(g/h)-i What is DAG? Write an algorithm to find basic building block.
5 5 5
GROUP B(0502CS091008-0502CS091016)
QUESTION NUMBER 1. 2. 3. 4. 5.
QUESTION
What is assembler? Explain the phases of compiler. Explain the difference between compiler and interpreter. Write a CFG, which generate string of balanced parenthesis. Consider the CFG SaAS/a ASbA/SS/ba Show that Saabbaa What do you understand by Parse Tree? 1. Annotate the following grammer to count how many reduction are to be performed for the string id+id*id: EE+T | E TT*F | T F(E) | id What is dynamic storage allocation? Discuss the following storage allocation strategies: Stack allocation Heap allocation What is Peep Hole Optimization? Translate the given expression, by three address code and also give quaruple.a:= -b * (c+d) Write the intermediate code for While(A<C) and B>D { If(A=1) Then C=C+1 Else While(A<=D) { A=A+B }} What is brute force parsing technique? What is recursive descent parser. What are the major issues for code generation? What is the register allocation?
UNIT 1 1 1 2 2
6. 7.
2 3
3 3 4 4 4
5 5 5
UNIT 1 1 1 2
5.
6. 7.
2 3
8.
9. 10.
3 4
11.
12.
Consider the following switch statement: Switch ( i+j) { Case 1: x=y+z Default: p=q+r Case 2: u=v+w } And write the translation scheme to translate the above program fragment into three address code. What is Loop optimization? When dangling references What do you mean by dead code ?
5 5 5