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: Computer 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.
- All questions carry equal marks.
Questions
Section A
- Q1. (a) Discuss various phases of compilation. [10] (b) Discuss the different input Buffering Scheme for scanning the character of a source program. [10] [20 marks]
- Q2. (a) What do you mean by single pass and multi-compiler? Also discuss various phases of compilation. [10] (b) 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 \rightarrow E+E \mid E-E \mid E*E \mid E/E \mid (E) \mid -E \mid id$ [10] [20 marks]
- Q3. (a) Why some grammars are known as Non-Context Free Grammars ? Explain with appropriate examples. [10] (b) Discuss the technique behind the shift reduce parsing and how it is implemented using stack ? Explain with suitable example. [10] [20 marks]
- Q4. (a) Explain the algorithm to eliminate Left-Recursion from a grammar with no cycle with suitable example. [10] (b) Discuss SLR and LALR parsing. [10] [20 marks]
Section B
- Q5. (a) What are the Intermediate code representation used by the compiler to produce object ? Discuss the types of three address statements. Translate the expression $-(a+b)*(c+d)+(a+b+c)$ into different intermediate code representation. [10] (b) Discuss the symbol table organization. Also give the differences between binary tree and hashing organization of symbol table. [10] [20 marks]
- Q6. (a) What role does basic block play in loop optimization ? Discuss the useful data structures for automatically analyzing basic blocks in detail with suitable example. [10] (b) Explain methods to detect and recover the errors which occur during the different phases of compiler. [10] [20 marks]
- Q7. (a) Describe what you understand by quadruple, triplets and indirect triplets. Write the quadruple, triplets and indirect triplets for the expression : $(x+y)*(y+z)-(x+y+z)$ [10] (b) Discuss common code optimization techniques used in compiler. Also illustrate the DAG Construction Algorithm and give the application of DAG. [10] [20 marks]
- Q8. (a) Discuss the global data flow analysis. What is its use on code optimization ? [10] (b) Explain the code generation algorithm. Also discuss the various problems in code generation algorithm. [10] [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