This document outlines the examination details for the Compiler Design course at Dr. Babasaheb Ambedkar Technological University, including instructions, question formats, and topics covered. Students are required to solve questions based on various aspects of compiler design, such as lexical analysis, code optimization, parsing techniques, and code generation. The exam is scheduled for June 13, 2024, with a maximum score of 60 marks.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
11 views2 pages
VHHDD
This document outlines the examination details for the Compiler Design course at Dr. Babasaheb Ambedkar Technological University, including instructions, question formats, and topics covered. Students are required to solve questions based on various aspects of compiler design, such as lexical analysis, code optimization, parsing techniques, and code generation. The exam is scheduled for June 13, 2024, with a maximum score of 60 marks.
Regular & Supplementary Semester Examination - Summer 2024 Course: B. Tech. Branch: Computer Engineering Semester: VI Subject Code & Name: BTCOC601_Y23, Compiler Design Max Marks: 60 Date: 13 / 06 / 2024 Duration: 3 Hrs. Instructions to the Students: 1. All the questions are compulsory. 2. The level of question/expected answer as per OBE or the Course Outcome (CO) on which the question is based is mentioned in ( ) in front of the question. 3. Use of non-programmable scientific calculators is allowed. 4. Assume suitable data wherever necessary and mention it clearly. (Level/CO) Marks Q. 1 Solve Any Two of the following. A) Explain the stages involved in analyzing a source program. What are the key Understand 6 activities performed during the lexical, syntactic, and semantic analysis Remember stages? B) What is code optimization? Describe its role in the compilation process and Remember 6 provide examples of common optimization techniques. Understand C) Describe the middle-end of a compiler. What is its function, and why is it Application 6 important to separate optimization from other phases? Remember
Q.2 Solve Any Two of the following.
A) Explain how regular expressions are used to specify tokens. Give an Remember 6 examples of regular expressions for different types of tokens, including Understand keywords, identifiers, numbers, and string literals B) Describe the typical structure of a lexical specification using a language like Remember 6 Lex. What are the main sections of such a specification? Understand C) Explain the workflow of a lexical analyzer generator from input specification Understand to the generation of the lexical analyzer code. Provide a step-by-step Apply description of the process.
Q. 3 Solve Any Two of the following.
A) Write a context-free grammar for simple arithmetic expressions involving Understand 6 addition, subtraction, multiplication, and division. Ensure your grammar is Apply unambiguous. B) What is bottom-up parsing? Describe the main techniques used in bottom-up Knowledge 6 parsing, including shift-reduce parsing. Understand C) Construct an operator-precedence table for a given set of operators and their Knowledge 6 precedence rules. Demonstrate how this table is used to parse an arithmetic Apply expression.
Q.4 Solve Any Two of the following.
A) Explain how SDT can be used to generate intermediate code for a simple Understand 6 programming language. Application B) Explain the concept of top-down parsing. How does it differ from bottom-up Remember 6 parsing? Understand C) Given the following grammar for arithmetic expressions: Knowledge 6 E → E + T, E → T, T → T * F, T → F, F → ( E ), F → id Apply Write a syntax-directed translation scheme that generates three-address code for this grammar. Explain how the translation scheme works for each production rule.
Q. 5 Solve Any Two of the following.
A) Explain the problem of instruction selection in code generation. How does Analyze 6 the choice of target machine instructions impact the performance of the Understand generated code? B) What is a basic block in the context of a compiler? Describe the process of Remember 6 constructing basic blocks from a given intermediate code Understand C) Describe the algorithm for calculating next-use information for a sequence Understand 6 of intermediate code. Apply *** End ***