April / May 2012
PRINCIPLES OF COMPILER DESIGN
Anna University
1 question papers available. Select an examination session to view its question paper.
PRINCIPLES OF COMPILER DESIGN
Based on available extracted papers. Question groups and frequency are provisional, not official syllabus weightage or examination predictions.
Write regular definition for the language that has all strings of letters that contain the five vowels in order.
1 eligible source papersWrite the syntax directed translation scheme for the input expression (4 +7.5*3)/ 2 and construct annotated parse tree
0 eligible source papersWrite type expressions for the C -function fun that has two character arguments and returns a-pointer to a character. Generate short circuit code for: if ( not (a or b) and c) stmts; 5 Generate the 3 - address code for the statement in the above question: In quadruple and indirect triplet.
0 eligible source papersWhat are address descriptors and register descriptors
1 eligible source papersGenerate target code for the instruction: *p+r = *q (assume enough registers are . available)
1 eligible source papersWhat is code hoisting? Give its usage.
1 eligible source papersHow unreachable code is identified 7
0 eligible source papersi. Explain in detail the different parameter passing modes. (8) ii. Tabulate the comparison of storage allocation Strategies used at run time. (6)
0 eligible source papers(a) i. Find the non recursive predictive parsing table, for the following grammar, 25 2 (ட) | Po tisis ட (8)
0 eligible source papers(a) ii. Write the non recursive predictive parsing algorithm and parse for the input string (a;a) (8)
0 eligible source papers(b):i. Construct the SLR Parsing table and parse the string “((())” forthe . grammar Y ->(){CY) (10) _ 12. (b) ii. Explain the front end of a compiler with a suitable. arithmetic expression: and mention the need for grouping the phases in a compiler. _ (6)
0 eligible source papers(a) For the given program fragment ALi, jJ=>BLi,C[j], C[k] +k] do the following: i. Write the syntax directed translation scheme to convert to 3-address code (4) ii. Draw the annotated parse tree with the translation scheme (4) iii. Write the 3-address code (4) iv. Determine the address of A[4, 5] where, all are integer arrays with size of A as10 x10, 8 as 10x10x10 and C as 10 and the start index-position of all arrays is at 7. (Assume the base addresses) (4)
0 eligible source papers(b) Consider the following program fragment: begin while a > bdo ் begin X=y+z a=a-b end X=y-z end i. Determine a syntax directed translation scheme to convert to 3-address code using backpatching. (8) ii. Draw the annotated parse tree with the generated translation scheme (6) iti. Write the 3-address code assuming a base address .. (4)
0 eligible source papers(a) i. Mention the issues related to the generation of code and explain any four in detail. » 8)
0 eligible source papers(a) ii. Write the algorithm to generate code with shortest instruction sequence to evaluate stateménts in a basic block and apply the same to the following statements ina _ basic block: . tl=a"b t2=c+d t3 =e-t2 t4=t1-t3 | இ — .
0 eligible source papers(b) i. Generate optimal code using Dynamic Programming technique for the ‘assignment statement: x = (a/b +c) / (d — ஓ. Assume the instructions and their associated cost as mentioned in Table 1. (9. Table1. Instruction and its cost Instruction | Cost | Instruction | Cost! Instruction | Cost. Ri=RiopRj| 1 | Ri=Mj | 2 |Mi=MiopMj| 4 லார | 2 | Mi=Rj_ 1 2 - Ri=Rj 1
0 eligible source papersHistorical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.