Compiler Design 2018 Question Paper — Government College of Engineeri…
The 2018 Compiler Design previous year question paper (Government College of Engineering and Technology, Jammu), with every question and its marks.
- University: Government College of Engineering and Technology, Jammu
- Subject: Compiler Design
- Course: COMPILER DESIGN
- Branch: Comp. Engg.
- Year: 2018
- Paper: end-term
- Duration: 180 minutes
- Total marks: 100
Instructions
- Attempt five questions in all, selecting at least two questions from each section.
Questions
Section A
- Q1. (a) Explain the different phases of compiler with suitable example. Also elaborate on the need of grouping the phases. (b) Discuss the Input Buffering Scheme for scanning the character of a source program and role of transition diagram. [20 marks]
- Q2. Given the regular expression $(a \mid b)^* abb$ over the alphabet $\Sigma = \{a, b\}$ : (i) Construct a NFA with $\epsilon$-transition using Thompson Construction Algorithm. (ii) Discuss and use the algorithm to convert NFA into DFA with minimised state. [20 marks]
- Q3. (a) Define Ambiguity related to grammars, also discuss the rules to disambiguate. Check whether the following grammar is ambiguous. If so, then remove the ambiguity $E \to E+E \mid E-E \mid E*E \mid E/E \mid (E) \mid -E \mid id$. (b) Describe the method of the shift reduce parsing and how it is implemented using stack ? Explain with suitable example. [20 marks]
- Q4. (a) Discuss the difference between the basic types of parsing. Also define the role of operator precedence grammar. Explain the algorithm for computation of leading() and trailing(). (b) Elaborate on the algorithm to eliminate Left Recursion from grammar with no-cycles or $\epsilon$-production. (c) Discuss the procedure of LALR parser with suitable example. [20 marks]
Section B
- Q5. (a) Explain syntax directed definition. Differentiate between Synthesized and Inherited attributes with suitable examples. (b) Write how system directed translation scheme is used to generate quadruples for a Boolean expression with the help of three functions : MAKELIST (), MERGE () & BACKPATCH () [20 marks]
- Q6. (a) What is a symbol table ? What type of information is stored in it ? Discuss on the use of data structure : (i) arrays (ii) linked lists (iii) Binary search trees for implementing a symbol table. (b) What are the various types of errors that may appear in compilation process ? Explain the function of Error Handling phase of the compiler. [20 marks]
- Q7. (a) What is DAG ? What are its advantages in context of optimization ? How does it help in elimination of common subexpression ? Show the DAG for the statement : $Z=X-Y+Y*U-V/W+X+V$ (b) Describe the role by Use-Definition Chaining. [20 marks]
- Q8. (a) Describe how peephole optimization is a technique for improving the target code with suitable example. (b) How a function getreg() is used to find the location required to perform the computation specified by each of the three - address code statement ? (c) Discuss major issues of code generation algorithm. [20 marks]
Related pages
Other years
- Compiler Design 2022 question paper — end-term
- Compiler Design 2018 question paper — end-term
- Compiler Design 2018 question paper — end-term
- Compiler Design 2018 question paper — end-term
- Compiler Design 2018 question paper — end-term