Code No: 07A51201

R07

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. (a) Describe in English the sets denoted by the following regular expressions: i. [00 + 11 + (01 + 10)(00 + 11)∗ (01 + 10)∗ ] ii. 10+(0+11)0*1 (b) Prove following identities for regular expressions r, s & t. Here r=s means L(r)=L(s) i. (r*s*)*=(r+s)* ii. (r+s)+t=r+(s+t) 2. (a) Explain recursive descent parsing in detail. (b) Remove ambiguity from following grammar: R→ ’|’R/RR/R*/(R)/a/b.

[8+8]

3. (a) Explain error recovery inYACC. (b) What are the disadvantages of recursive descent parsing?

[8+8]

4. Write short notes on following terms: (a) dominators. (b) natural loops. (c) inner loops. (d) preheaders.

[16]

5. (a) Consider following expression grammar: S→E E → E + E/E ∗ E/(E)/I I → Idigit/digit Digit → 0/1/2/..../9 Write semantic rules to evaluate expression on decimal numbers that it derives. Use ‘val’ attribute for storing the values & constant parse tree for 2*(21+1)+10. Find S.val. (b) What is the significance of syntax- directed definition. 6. (a) Consider following code: begin boolean b=true proc p; print (b) end 1

[8+8]

Code No: 07A51201

R07

Set No. 2

boolean b=false b end What is the output if static & dynamic scoping rules are applied. (b) Discuss the merits and demerits of static allocation strategy.

[8+8]

7. (a) Discuss various object code forms. (b) Write a short note on code generating algorithms.

[8+8]

8. (a) What is type expression? Write type expressions for the following types: i. An array of pointers to reals, where the array index ranges from 1 to 100. ii. A two dimensional array of integers whose rows are indexed from 0 to 9 and whose columns are indexed from -10 to 10. iii. Functions whose domains are functions from integers to pointers to integers and whose ranges are records consisting of an integer and a character. (b) What is meant by structural equivalence? Assume the following definitions: type link = ↑ cell; var next:link; last:link; p: ↑ cell; q,r: ↑ cell; Which among the following expression are structurally equivalent? Which are name equivalent? i. ii. iii. iv.

link. pointer(cell). pointer(link). pointer(record(info∗integer)∗(next∗pointer(cell))). ?????

2

[8+8]

Code No: 07A51201

R07

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. (a) Discuss various object code forms. (b) Write a short note on code generating algorithms.

[8+8]

2. (a) Explain recursive descent parsing in detail. (b) Remove ambiguity from following grammar: R→ ’|’R/RR/R*/(R)/a/b.

[8+8]

3. (a) Consider following code: begin boolean b=true proc p; print (b) end boolean b=false b end What is the output if static & dynamic scoping rules are applied. (b) Discuss the merits and demerits of static allocation strategy.

[8+8]

4. Write short notes on following terms: (a) dominators. (b) natural loops. (c) inner loops. (d) preheaders.

[16]

5. (a) What is type expression? Write type expressions for the following types: i. An array of pointers to reals, where the array index ranges from 1 to 100. ii. A two dimensional array of integers whose rows are indexed from 0 to 9 and whose columns are indexed from -10 to 10. iii. Functions whose domains are functions from integers to pointers to integers and whose ranges are records consisting of an integer and a character. (b) What is meant by structural equivalence? Assume the following definitions: type link = ↑ cell; var next:link; last:link; p: ↑ cell; q,r: ↑ cell; Which among the following expression are structurally equivalent? Which are name equivalent? 3

Code No: 07A51201 i. ii. iii. iv.

R07

Set No. 4

link. pointer(cell). pointer(link). pointer(record(info∗integer)∗(next∗pointer(cell))).

[8+8]

6. (a) Describe in English the sets denoted by the following regular expressions: i. [00 + 11 + (01 + 10)(00 + 11)∗ (01 + 10)∗ ] ii. 10+(0+11)0*1 (b) Prove following identities for regular expressions r, s & t. Here r=s means L(r)=L(s) i. (r*s*)*=(r+s)* ii. (r+s)+t=r+(s+t) 7. (a) Consider following expression grammar: S→E E → E + E/E ∗ E/(E)/I I → Idigit/digit Digit → 0/1/2/..../9 Write semantic rules to evaluate expression on decimal numbers that it derives. Use ‘val’ attribute for storing the values & constant parse tree for 2*(21+1)+10. Find S.val. (b) What is the significance of syntax- directed definition.

[8+8]

8. (a) Explain error recovery inYACC. (b) What are the disadvantages of recursive descent parsing? ?????

4

[8+8]

Code No: 07A51201

R07

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) Explain recursive descent parsing in detail. (b) Remove ambiguity from following grammar: R→ ’|’R/RR/R*/(R)/a/b.

[8+8]

2. (a) Discuss various object code forms. (b) Write a short note on code generating algorithms.

[8+8]

3. (a) Consider following code: begin boolean b=true proc p; print (b) end boolean b=false b end What is the output if static & dynamic scoping rules are applied. (b) Discuss the merits and demerits of static allocation strategy.

[8+8]

4. (a) Describe in English the sets denoted by the following regular expressions: i. [00 + 11 + (01 + 10)(00 + 11)∗ (01 + 10)∗ ] ii. 10+(0+11)0*1 (b) Prove following identities for regular expressions r, s & t. Here r=s means L(r)=L(s) i. (r*s*)*=(r+s)* ii. (r+s)+t=r+(s+t) 5. (a) Consider following expression grammar: S→E E → E + E/E ∗ E/(E)/I I → Idigit/digit Digit → 0/1/2/..../9 Write semantic rules to evaluate expression on decimal numbers that it derives. Use ‘val’ attribute for storing the values & constant parse tree for 2*(21+1)+10. Find S.val. (b) What is the significance of syntax- directed definition.

[8+8]

6. (a) What is type expression? Write type expressions for the following types: 5

Code No: 07A51201

R07

Set No. 1

i. An array of pointers to reals, where the array index ranges from 1 to 100. ii. A two dimensional array of integers whose rows are indexed from 0 to 9 and whose columns are indexed from -10 to 10. iii. Functions whose domains are functions from integers to pointers to integers and whose ranges are records consisting of an integer and a character. (b) What is meant by structural equivalence? Assume the following definitions: type link = ↑ cell; var next:link; last:link; p: ↑ cell; q,r: ↑ cell; Which among the following expression are structurally equivalent? Which are name equivalent? i. ii. iii. iv.

link. pointer(cell). pointer(link). pointer(record(info∗integer)∗(next∗pointer(cell))).

[8+8]

7. Write short notes on following terms: (a) dominators. (b) natural loops. (c) inner loops. (d) preheaders.

[16]

8. (a) Explain error recovery inYACC. (b) What are the disadvantages of recursive descent parsing? ?????

6

[8+8]

Code No: 07A51201

R07

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. (a) Explain error recovery inYACC. (b) What are the disadvantages of recursive descent parsing?

[8+8]

2. (a) Describe in English the sets denoted by the following regular expressions: i. [00 + 11 + (01 + 10)(00 + 11)∗ (01 + 10)∗ ] ii. 10+(0+11)0*1 (b) Prove following identities for regular expressions r, s & t. Here r=s means L(r)=L(s) i. (r*s*)*=(r+s)* ii. (r+s)+t=r+(s+t) 3. (a) Consider following expression grammar: S→E E → E + E/E ∗ E/(E)/I I → Idigit/digit Digit → 0/1/2/..../9 Write semantic rules to evaluate expression on decimal numbers that it derives. Use ‘val’ attribute for storing the values & constant parse tree for 2*(21+1)+10. Find S.val. (b) What is the significance of syntax- directed definition.

[8+8]

4. (a) Discuss various object code forms. (b) Write a short note on code generating algorithms.

[8+8]

5. (a) Explain recursive descent parsing in detail. (b) Remove ambiguity from following grammar: R→ ’|’R/RR/R*/(R)/a/b.

[8+8]

6. (a) What is type expression? Write type expressions for the following types: i. An array of pointers to reals, where the array index ranges from 1 to 100. ii. A two dimensional array of integers whose rows are indexed from 0 to 9 and whose columns are indexed from -10 to 10. iii. Functions whose domains are functions from integers to pointers to integers and whose ranges are records consisting of an integer and a character.

7

Code No: 07A51201

R07

Set No. 3

(b) What is meant by structural equivalence? Assume the following definitions: type link = ↑ cell; var next:link; last:link; p: ↑ cell; q,r: ↑ cell; Which among the following expression are structurally equivalent? Which are name equivalent? i. ii. iii. iv.

link. pointer(cell). pointer(link). pointer(record(info∗integer)∗(next∗pointer(cell))).

[8+8]

7. (a) Consider following code: begin boolean b=true proc p; print (b) end boolean b=false b end What is the output if static & dynamic scoping rules are applied. (b) Discuss the merits and demerits of static allocation strategy.

[8+8]

8. Write short notes on following terms: (a) dominators. (b) natural loops. (c) inner loops. (d) preheaders.

[16] ?????

8

R07 III B.Tech I Semester Examinations,December 2011 AUTOMATA ...

There was a problem previewing this document. Retrying... Download. Connect more apps... R07 III B.Tec ... gineering.pdf. R07 III B.Tech ... ngineering.pdf.

50KB Sizes 1 Downloads 168 Views

Recommend Documents

No documents