// Anna University, Chennai / 2022
Anna University — Compiler Design (CS8602), April/May 2022
Compiler Design · CS8602 · R2017 · B.E. Computer Science and Engineering · Semester 6
Files open in a new tab. Use your browser's download or save option to keep a copy.
Work through the questions
16 questions
No verified answers are available for this paper.
Programmer A has written a program which needs to be modified very frequently. Which of the two languages Visual Basic (or) C++ can he use for his programming? Justify in two sentences. (Neglect other technical and environmental considerations).
No verified answer or solution is available for this question.
List out the phases included in the analysis phase of compiler.
No verified answer or solution is available for this question.
Write down the CFG for the set of odd length strings in {a, b}* whose first, middle and last Symbols are same.
No verified answer or solution is available for this question.
List out the steps for performing LR parsing.
No verified answer or solution is available for this question.
What do you mean by Syntax directed translation?
No verified answer or solution is available for this question.
Convert the following statement into three address codes x = a + (b * −c) + (d * −e) Represent the three address codes by Triples.
No verified answer or solution is available for this question.
When do you call a variable to be syntactically live at a point?
No verified answer or solution is available for this question.
When does dangling references mean?
No verified answer or solution is available for this question.
Define constant folding.
No verified answer or solution is available for this question.
Identify and write down the optimizations that could be performed on a Peephole.
No verified answer or solution is available for this question.
(a) Elaborate on the different phases of compiler with a neat sketch. Show the output of each phase of the compiler when the following statement is parsed. SI = (p *n*r)/100 Where. n should only be an integer p and r could be floating point numbers (OR) (b) Convert the following NFA to DFA.

The NFA for part (b). No verified answer or solution is available for this question.
(a) Check whether the following grammar can be implemented using Predictive parser. Check whether the string "abfg" is accepted or not using predictive parsing. A → A A → aB | Ad B → bBC | f C → g (OR) (b) Check whether the following grammar can be implemented using Predictive parser. Check whether the string "(a,a)" is accepted or not using predictive parsing. S → (L) | a L → L,S | S
No verified answer or solution is available for this question.
(a) Write the syntax directed translation for the following code: E → E₁ or E₂ E → E₁ and E₂ E → not E₁ E → (E₁) E → id₁ relop id₂ E → true E → false (OR) (b) Write the syntax directed translation for the following piece of code. while a < b do if c < d then x : = y+z else x :=y−z
No verified answer or solution is available for this question.
(a) Elaborate the issues in developing a code generator. (OR) (b) Construct the basic blocks and flowgraph for the following piece of code. for i from 1 to 10 do for j from 1 to 10 do a[i, j] = 0.0; for i from 1 to 10 do a[i,i]=1.0;
No verified answer or solution is available for this question.
(a) Describe the parameter passing techniques with an example. (OR) (b) Explain the storage allocation techniques with an example.
No verified answer or solution is available for this question.
(a) Consider the following basic block, in which all variables are integers and ** denotes exponentiation a := x ** 2 b := 3 c := x d := c * c e := b * 2 f := a + d g := e * f Apply the following optimization techniques to this basic block, in order. Compute the result of each transformation. (i) Algebraic Simplification (3) (ii) Copy Propagation (3) (iii) Constant Folding (3) (iv) Dead Code Elimination (3) (v) Common Sub-expression Elimination (3) (OR) (b) Construct LR(l) items for the following grammar and draw the transition diagram representing the transitions among CLR items. S → CC C → cC C → d Show whether the string "cdcd" is accepted by this grammar or not.
No verified answer or solution is available for this question.