×
Expect problems and eat them for breakfast.
--Your friends at LectureNotes
Close

Solution to Previous Year Exam Questions for Compiler Design - CD of HITECH by VijayaKumar Thangavel

  • Compiler Design - CD
  • 2013
  • PYQ Solution
  • ANNA UNIVERISTY - HITECH
  • Computer Science Engineering
  • B.Tech
  • 5119 Views
  • 63 Offline Downloads
  • Uploaded 1 year ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-2

Dr.N.G.P. Institute of Technology,Coimbatore CS6660/Compiler Design TEXTBOOK: 1. Alfred V Aho, Monica S. Lam, Ravi Sethi and Jeffrey D Ullman, “Compilers – Principles, Techniques and Tools”, 2nd Edition, Pearson Education, 2007. REFERENCES: 1. Randy Allen, Ken Kennedy, “Optimizing Compilers for Modern Architectures: A Dependence-based Approach”, Morgan Kaufmann Publishers, 2002. 2. Steven S. Muchnick, “Advanced Compiler Design and Implementation, “Morgan Kaufmann Publishers - Elsevier Science, India, Indian Reprint 2003. 3. Keith D Cooper and Linda Torczon, “Engineering a Compiler”, Morgan Kaufmann Publishers Elsevier Science, 2004. 4. Charles N. Fischer, Richard. J. LeBlanc, “Crafting a Compiler with C”, Pearson Education, 2008. Question Bank- Two Marks With Answer Prepared by T.VijayaKumar,AP/ IT

Text from page-3

Dr.N.G.P. Institute of Technology,Coimbatore CS6660/Compiler Design UNIT I INTRODUCTION TO COMPILERS Translators-Compilation and Interpretation-Language processors -The Phases of CompilerErrors Encountered in Different Phases-The Grouping of Phases-Compiler Construction Tools Programming Language basics. 1. Define compiler. (Nov/Dec 2011, 2009) A compiler is a program that reads a program written in one language (source language) and translates it into an equivalent program in another language(target language) and the compiler reports to its user the presence of errors in the source program. Source Program Target Program COMPILER Error Messages 2. What are the classifications of compiler? The classifications of compiler are:     Single pass compiler Multi pass compiler Load-and-go compiler Debugging or optimizing compiler 3. What are the two parts of a compilation? (or) State the two main parts of compilation and its function. (or) Recall the basic two parts of a compilation process. (May/June 2016,April/May 2017 & 2018,Nov/Dec 2018) The two parts of a compilation are Analysis and Synthesis. The analysis part breaks up the source program into constituent pieces and creates an intermediate representation on the source program. It also termed as front end of compiler The synthesis part constructs the desired target program from the intermediate representation. It is also termed as back end of compiler. 4. What are the phases of compiler? (Dec 2008) The phases of compiler are:  Lexical analyzer  Syntax analyzer  Semantic analyzer  Intermediate code generation  Code generation  Code optimization  Symbol table manager. Question Bank- Two Marks With Answer Prepared by T.VijayaKumar,AP/ IT

Text from page-4

Dr.N.G.P. Institute of Technology,Coimbatore CS6660/Compiler Design 5. Illustrate diagrammatically how a language is processed. (May/June 2016) 6. Define preprocessor & what are the functions of preprocessor? Preprocessor produce input to the compilers (i.e.) the program will be divided in to the modules. They may perform the following functions.     Macro processing File inclusion Rational preprocessor Language extension 7. Name few tools that could be used for the various phases of the compiler.(Nov 2012) Tools that could be used for the various phases of the compiler:  Parse generator  Scanner generators  Syntax-directed translation engines  Automatic code generator  Data flow engines 8. What are the tools available in analysis phase? The tools available in analysis phase are:     Structure editors Pretty printer Static checkers Interpreters. Question Bank- Two Marks With Answer Prepared by T.VijayaKumar,AP/ IT

Text from page-5

Dr.N.G.P. Institute of Technology,Coimbatore CS6660/Compiler Design 9. Define pretty printers. A pretty printer analyzes a program and prints it in such a way that the structure of the program becomes clearly visible. For the comments may appear with an amount of indentation proportional to the depth of their nesting in the hierarchical organization of the statements. 10. List the cousins of compiler.(April/ May 2017 ,May/June 2012, Nov/Dec 2013) The following are the cousins of compilers  Preprocessors  Macro processing  File inclusion  Language Extensions  Rational Preprocessors  Assemblers  Loaders  Link editors. 11. Define assembler and its types. It is defined by the low level language is assembly language and high level language is machine language is called assembler.   One pass assembler Two pass assembler 12. Give the types of a language processing system. The types of a language processing system are:     Preprocessors Compilers Assembler Loaders and link editors 13. What are the functions performed in analysis and synthesis phase? Analysis Phase:  Lexical analysis or Linear analysis  Syntax analysis or hierarchical analysis  Semantic analysis Synthesis phase:    Intermediate code generation Code generation Code optimization Question Bank- Two Marks With Answer Prepared by T.VijayaKumar,AP/ IT

Lecture Notes