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 Engineering
- 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.
- Each question carries 20 marks.
Questions
SECTION-A
- QQ1. (a) What are the different phases of Compiler? Explain the functions of each phase. Illustrate the output of each phase of compilation for the input with suitable example (b) What is the relationship with lexical analyzer, regular expressions and transition diagram? Give an example. [20 marks]
- QQ2. (a) Illustrate the algorithm to convert NFA to DFA with suitable example (b) Show that whether the following is ambiguous. If the answer is 'Yes', then disambiguate it Stat -> if cond then stat | if cond then stat else stat | other stat (c) Discuss why some grammars are known as Non-Context Free Grammars. Explain with appropriate examples [20 marks]
- QQ3. (a) Illustrate with example, the working of a general bottom up parser using shift and reduce actions (b) Illustrate with an example the working of a backtracking parser? List out its advantages and disadvantages [20 marks]
- QQ4. (a) Explain with suitable example how the Predicted Parser can be constructed with the help of First( ) and Follow( ) in detail. (b) Describe the working principal of canonical LR parser [20 marks]
SECTION-B
- QQ5. (a) What do you mean by Intermediate code phase of the compiler? Describe its various kinds. (b) Construct the following grammar: G: E->E+T|T T->T*F|F F->(E)|id Associate semantic rules with the productions for the construction of syntax tree for the expression. Using the translation scheme construct the syntax tree for the expression : a+b*c. [20 marks]
- QQ6. (a) Discuss various data structure for symbol table. (b) Explain static allocation and heap allocation strategies (c) Describe error detection and recovery mechanism during the compilation process with suitable examples [20 marks]
- QQ7. (a) Discuss different types of optimizations that can be performed in a loop with suitable example of a basic block, explain the code-improving transformations of a basic block. (b) Explain the role of Use - Definition Chaining with suitable example [20 marks]
- QQ8. Write the code generation algorithm. Using this algorithm generate code sequence for the expression $x = (a - b) + (a + c)$. Discuss various problems in code generation phase of the compiler. [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