Code No: R05311201
R05
Set No. 2
III B.Tech I Semester Examinations,December 2011 AUTOMATA AND COMPILER DESIGN Common to Information Technology, Computer Science And Systems Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. Construct an LL(1) parse table for the following grammar: E → TE0 E0 → +E |∈ T → FT0 T0 → T |∈ F → PF0 F0 → ∗F0 |∈ P → (E) |a| b.
[16]
2. Construct Quadruples, Triples and Indirect Triples of the following expression: I = - J * (K + W). [16] 3. (a) Explain Briefly about the Global Optimization? (b) Distinguish machine dependent and machine independent optimization.[8+8] 4. Write differences between single pass and two pass translation?
[16]
5. Consider the following grammar: A0 → A A → (A) |a (a) Construct the LR(0) parser. (b) Find the SLR(1) parse table. (c) Find the moves made by the LR(0) parser on the input string: ( ( a ) ). [5+5+6] 6. Explain the following: (a) Static and Dynamic Checking of types (b) Over loading of Operators & Functions. 7. Consider the following pascal code and draw the Activation Record. Program param(input , output); Procedure b(function h(n: integer): integer ); Var m : integer Begin m := 3; writein(h(2)) End {b}; 1
[8+8]
Code No: R05311201
R05
Set No. 2
Procedure c: Var m : integer; Function f(n: integer) : integer ; Begin f := m + n End { f } Procedure r; Var m : integer; Begin m := 7; B(f) End { r } Begin m := 0; r end { c }; Begin C End.
[16]
8. (a) Let L be the set of all binary strings whose last two symbols are same. Design the NFA and find equivalent DFA. (b) Obtain the Regular Expression represented by the following Regular Set: {0, 1, 00, 01, 000, 001, 0000, 0001, ...}. [12+4] ?????
2
Code No: R05311201
R05
Set No. 4
III B.Tech I Semester Examinations,December 2011 AUTOMATA AND COMPILER DESIGN Common to Information Technology, Computer Science And Systems Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. Construct an LL(1) parse table for the following grammar: E → TE0 E0 → +E |∈ T → FT0 T0 → T |∈ F → PF0 F0 → ∗F0 |∈ P → (E) |a| b.
[16]
2. (a) Let L be the set of all binary strings whose last two symbols are same. Design the NFA and find equivalent DFA. (b) Obtain the Regular Expression represented by the following Regular Set: {0, 1, 00, 01, 000, 001, 0000, 0001, ...}. [12+4] 3. Write differences between single pass and two pass translation?
[16]
4. Construct Quadruples, Triples and Indirect Triples of the following expression: I = - J * (K + W). [16] 5. Explain the following: (a) Static and Dynamic Checking of types (b) Over loading of Operators & Functions. 6. Consider the following pascal code and draw the Activation Record. Program param(input , output); Procedure b(function h(n: integer): integer ); Var m : integer Begin m := 3; writein(h(2)) End {b}; Procedure c: Var m : integer; Function f(n: integer) : integer ; Begin f := m + n End { f } Procedure r; Var m : integer; 3
[8+8]
Code No: R05311201
R05
Begin m := 7; B(f) End { r } Begin m := 0; r end { c }; Begin C End.
Set No. 4
[16]
7. Consider the following grammar: A0 → A A → (A) |a (a) Construct the LR(0) parser. (b) Find the SLR(1) parse table. (c) Find the moves made by the LR(0) parser on the input string: ( ( a ) ). [5+5+6] 8. (a) Explain Briefly about the Global Optimization? (b) Distinguish machine dependent and machine independent optimization.[8+8] ?????
4
Code No: R05311201
R05
Set No. 1
III B.Tech I Semester Examinations,December 2011 AUTOMATA AND COMPILER DESIGN Common to Information Technology, Computer Science And Systems Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Let L be the set of all binary strings whose last two symbols are same. Design the NFA and find equivalent DFA. (b) Obtain the Regular Expression represented by the following Regular Set: {0, 1, 00, 01, 000, 001, 0000, 0001, ...}. [12+4] 2. Write differences between single pass and two pass translation?
[16]
3. Consider the following grammar: A0 → A A → (A) |a (a) Construct the LR(0) parser. (b) Find the SLR(1) parse table. (c) Find the moves made by the LR(0) parser on the input string: ( ( a ) ). [5+5+6] 4. Construct an LL(1) parse table for the following grammar: E → TE0 E0 → +E |∈ T → FT0 T0 → T |∈ F → PF0 F0 → ∗F0 |∈ P → (E) |a| b.
[16]
5. Explain the following: (a) Static and Dynamic Checking of types (b) Over loading of Operators & Functions.
[8+8]
6. (a) Explain Briefly about the Global Optimization? (b) Distinguish machine dependent and machine independent optimization.[8+8] 7. Consider the following pascal code and draw the Activation Record. Program param(input , output); Procedure b(function h(n: integer): integer ); Var m : integer 5
Code No: R05311201
R05
Set No. 1
Begin m := 3; writein(h(2)) End {b}; Procedure c: Var m : integer; Function f(n: integer) : integer ; Begin f := m + n End { f } Procedure r; Var m : integer; Begin m := 7; B(f) End { r } Begin m := 0; r end { c }; Begin C End.
[16]
8. Construct Quadruples, Triples and Indirect Triples of the following expression: I = - J * (K + W). [16] ?????
6
Code No: R05311201
R05
Set No. 3
III B.Tech I Semester Examinations,December 2011 AUTOMATA AND COMPILER DESIGN Common to Information Technology, Computer Science And Systems Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. Construct an LL(1) parse table for the following grammar: E → TE0 E0 → +E |∈ T → FT0 T0 → T |∈ F → PF0 F0 → ∗F0 |∈ P → (E) |a| b.
[16]
2. Consider the following pascal code and draw the Activation Record. Program param(input , output); Procedure b(function h(n: integer): integer ); Var m : integer Begin m := 3; writein(h(2)) End {b}; Procedure c: Var m : integer; Function f(n: integer) : integer ; Begin f := m + n End { f } Procedure r; Var m : integer; Begin m := 7; B(f) End { r } Begin m := 0; r end { c }; Begin C End.
[16]
3. (a) Explain Briefly about the Global Optimization? (b) Distinguish machine dependent and machine independent optimization.[8+8] 4. Construct Quadruples, Triples and Indirect Triples of the following expression: I = - J * (K + W). [16]
7
Code No: R05311201
R05
Set No. 3
5. (a) Let L be the set of all binary strings whose last two symbols are same. Design the NFA and find equivalent DFA. (b) Obtain the Regular Expression represented by the following Regular Set: {0, 1, 00, 01, 000, 001, 0000, 0001, ...}. [12+4] 6. Consider the following grammar: A0 → A A → (A) |a (a) Construct the LR(0) parser. (b) Find the SLR(1) parse table. (c) Find the moves made by the LR(0) parser on the input string: ( ( a ) ). [5+5+6] 7. Explain the following: (a) Static and Dynamic Checking of types (b) Over loading of Operators & Functions. 8. Write differences between single pass and two pass translation? ?????
8
[8+8] [16]