MidTerm Papers Solved MCQS with Reference (1 to 22 lectures)

Similar documents
CS606- compiler instruction Solved MCQS From Midterm Papers

CS Lecture 2. The Front End. Lecture 2 Lexical Analysis

Front End. Hwansoo Han

Lexical Scanning COMP360

2068 (I) Attempt all questions.

SYED AMMAL ENGINEERING COLLEGE (An ISO 9001:2008 Certified Institution) Dr. E.M. Abdullah Campus, Ramanathapuram

BSCS Fall Mid Term Examination December 2012

Compilers and Interpreters

Compiling Regular Expressions COMP360

COMPILER DESIGN. For COMPUTER SCIENCE

Theory and Compiling COMP360

CS 314 Principles of Programming Languages

Formal Languages and Compilers Lecture VI: Lexical Analysis

Zhizheng Zhang. Southeast University

About the Authors... iii Introduction... xvii. Chapter 1: System Software... 1

General Overview of Compiler

1. (a) What are the closure properties of Regular sets? Explain. (b) Briefly explain the logical phases of a compiler model. [8+8]

Syntax Analysis Part I

1. The output of lexical analyser is a) A set of RE b) Syntax Tree c) Set of Tokens d) String Character

LECTURE NOTES ON COMPILER DESIGN P a g e 2

CS 314 Principles of Programming Languages. Lecture 3

CS 4120 Introduction to Compilers

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

ECE 468/573 Midterm 1 September 30, 2015

ECE 468/573 Midterm 1 October 1, 2014

CS415 Compilers. Lexical Analysis

Outline. Lecture 17: Putting it all together. Example (input program) How to make the computer understand? Example (Output assembly code) Fall 2002

Examples of attributes: values of evaluated subtrees, type information, source file coordinates,

Compiler Design. Computer Science & Information Technology (CS) Rank under AIR 100

LR Parsing - The Items

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

A simple syntax-directed


The Structure of a Syntax-Directed Compiler

Section A. A grammar that produces more than one parse tree for some sentences is said to be ambiguous.

Parsing III. CS434 Lecture 8 Spring 2005 Department of Computer Science University of Alabama Joel Jones

ECE251 Midterm practice questions, Fall 2010

Interpreter. Scanner. Parser. Tree Walker. read. request token. send token. send AST I/O. Console

CS143 Handout 20 Summer 2011 July 15 th, 2011 CS143 Practice Midterm and Solution

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

Lecture 8: Deterministic Bottom-Up Parsing

Compiler Construction

CS 2210 Sample Midterm. 1. Determine if each of the following claims is true (T) or false (F).

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Subject Name: CS2352 Principles of Compiler Design Year/Sem : III/VI

Question Bank. 10CS63:Compiler Design

UNIVERSITY OF CALIFORNIA

CS 403 Compiler Construction Lecture 3 Lexical Analysis [Based on Chapter 1, 2, 3 of Aho2]

VIVA QUESTIONS WITH ANSWERS

CS 406/534 Compiler Construction Putting It All Together

Review main idea syntax-directed evaluation and translation. Recall syntax-directed interpretation in recursive descent parsers

CS 4201 Compilers 2014/2015 Handout: Lab 1

Context-Free Grammar. Concepts Introduced in Chapter 2. Parse Trees. Example Grammar and Derivation

An Overview to Compiler Design. 2008/2/14 \course\cpeg421-08s\topic-1a.ppt 1

CS412/413. Introduction to Compilers Tim Teitelbaum. Lecture 2: Lexical Analysis 23 Jan 08

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design

Lecture 7: Deterministic Bottom-Up Parsing

Compiling Techniques

Compiler Construction

List of Figures. About the Authors. Acknowledgments

Gujarat Technological University Sankalchand Patel College of Engineering, Visnagar B.E. Semester VII (CE) July-Nov Compiler Design (170701)

Structure of a compiler. More detailed overview of compiler front end. Today we ll take a quick look at typical parts of a compiler.

CSE P 501 Compilers. LR Parsing Hal Perkins Spring UW CSE P 501 Spring 2018 D-1

Final Term Papers 2013

Compiler phases. Non-tokens

Question Marks 1 /12 2 /6 3 /14 4 /8 5 /5 6 /16 7 /34 8 /25 Total /120

Bottom-Up Parsing. Lecture 11-12

RYERSON POLYTECHNIC UNIVERSITY DEPARTMENT OF MATH, PHYSICS, AND COMPUTER SCIENCE CPS 710 FINAL EXAM FALL 96 INSTRUCTIONS

CD Assignment I. 1. Explain the various phases of the compiler with a simple example.

CSE 3302 Programming Languages Lecture 2: Syntax

Compiler Design (40-414)

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square)

EDAN65: Compilers, Lecture 06 A LR parsing. Görel Hedin Revised:

CMSC 350: COMPILER DESIGN

CS453 : Shift Reduce Parsing Unambiguous Grammars LR(0) and SLR Parse Tables by Wim Bohm and Michelle Strout. CS453 Shift-reduce Parsing 1

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / EVEN SEMESTER

Figure 2.1: Role of Lexical Analyzer

CSE 401 Compilers. LR Parsing Hal Perkins Autumn /10/ Hal Perkins & UW CSE D-1

Front End: Lexical Analysis. The Structure of a Compiler

LL(k) Parsing. Predictive Parsers. LL(k) Parser Structure. Sample Parse Table. LL(1) Parsing Algorithm. Push RHS in Reverse Order 10/17/2012

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science and Engineering

4. An interpreter is a program that

Overview of Compiler. A. Introduction

Compiler Design Overview. Compiler Design 1

CS 415 Midterm Exam Spring SOLUTION

COLLEGE OF ENGINEERING, NASHIK. LANGUAGE TRANSLATOR

Lexical analysis. Syntactical analysis. Semantical analysis. Intermediate code generation. Optimization. Code generation. Target specific optimization

Bottom-Up Parsing. Lecture 11-12

Programming Language Syntax and Analysis

The Structure of a Syntax-Directed Compiler

CSCI Compiler Design

Lexical Analyzer Scanner

Reading Assignment. Scanner. Read Chapter 3 of Crafting a Compiler.

Midterm I (Solutions) CS164, Spring 2002

Lexical Analyzer Scanner

A programming language requires two major definitions A simple one pass compiler

Academic Formalities. CS Language Translators. Compilers A Sangam. What, When and Why of Compilers

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF CSE COURSE PLAN

PART 3 - SYNTAX ANALYSIS. F. Wotawa TU Graz) Compiler Construction Summer term / 309

Formal Languages and Compilers Lecture VII Part 3: Syntactic A

Concepts Introduced in Chapter 3. Lexical Analysis. Lexical Analysis Terms. Attributes for Tokens

Transcription:

CS606- Compiler Construction MidTerm Papers Solved MCQS with Reference (1 to 22 lectures) by Arslan Arshad (Zain) FEB 21,2016 0300-2462284 http://lmshelp.blogspot.com/ Arslan.arshad01@gmail.com AKMP01 MidTerm Papers Solved MCQS with Reference (1 to 22 lectures) 1. Typical compilation means programs written in high-level languages to low-level. o Object code PG # 06 o Byted code o Unicode o Object Code and byte code 2. In compilation process, Hierarchical analysis is also called. o Parsing o Syntax o Parsing and Syntax analysis

3. IR (Intermediate Representation) stores the value of its operand in. o Registers PG # 10 o Memory o Hard disk o None Of given 4. A lexeme is a sequence of characters in the source program that is matched by the pattern for a. o Linker o Token Click Here for More Detail o Control flow 5. Parsers take as Input from lexical analyzer. o Linker o Token o Instructions 6. What kind of abstract machine can recognize strings in a regular set? o DFA o NFA o PDA

7. In multi pass compiler, during the first pass it gathers information about. o Declaration o Bindings o Static information 8. In DFA minimization, we construct one for each group of states from the initial DFA. o State PG # 30 o NFA o PDA 9. (Lexical Analyzer generator), is written in Java o Flex o Jlex Click here for More Detail PG # 31 o Complex JLex is a lexical analyzer generator, written for Java, in Java. 10. In Flex specification file, different sections are separated by. o %% PG # 31 o && o ##

11. Recursive parsing is done for LL(I) grammar. o Decent o Ascent o Forward 12. Alternative of the backtrack in parser is Look ahead symbol in. o Input o Output o Input and Output 13. Parser takes tokens from scanner and tries to generate. o Binary Search tree o Parse tree o Binary Search tree and Parse tree 14. In predictive parsing table, the rows represents. o Terminals o Both non-terminal and terminals o Non-terminals PG # 62

15. In LL(I) parsing algorithm, contains a sequence of grammar symbols. o Stack PG # 62 o Link List o Array 16. Consider the grammar A B C D B h B C C g g C h i D AB First of A is. o h, g, i o g o h 17. Consider the grammar A B C D B h B C C g g C h i D AB First of C is. o g, i o g o h, i

18. Bottom-up parsing uses only kinds of actions. o Two PG # 71 o Three o Four o Five Bottom-up parsing uses only two kinds of actions: 1. Shift, 2. Reduce Shift: Move one place to the right Shifts a terminal to the left string Reduce : Apply an inverse production at the right end of the left string 19. The shift action a terminal on the stack. o Pushes PG # 73 o Pops o Both push and pops 20. Reduce action zero or more symbols from the stack o Pushes o Pops PG # 73 o Both push and pops 21. In compilers, linear analysis is also called. o Lexical analysis o Scanning o Lexical analysis and scanning

22. Back End of two-pass compiler uses algorithm. o O(n) o O(n log n) o NP Complete o None of the Given 23. The Back End of a compiler consist of. o Instruction selection o Register allocation o Instruction scheduling o All of the given 24. In Back End module of compiler, optimal register allocation uses. o O(log n) o O(n log n) o NP-Complete 25. is a regular expression for the set of all strings over the alphabet {a} that has an even number of a' s. o (aa)* o (aa)*a o aa*a o a*(aa)

26. algorithm is used in DFA minimization. o James's o Robert s o Hopcroft s PG # 25 27. is an important component of semantic analysis. o Code checking o Type checking PG # 39 o Flush checking 28. Consider the grammar A B C D B h B C C g g C h i First of B is. o h, i o h, o g

29. Consider the grammar A B C D B h B C C g g C h i D A B First of D is. o h, g o h o h, g, i, 30. Parsers never shifts into an error state. o LS o LT o LR o LP 31. In, certain checks are performed to ensure that components of a program fit together meaningfully o Linear analysis o Hierarchical analysis o Semantic analysis

32. read the input character and produce sequence of tokens as output. o Lexical analyzer o Parser o Symbol table 33. The regular expression denotes, the set of all strings of a's and b s of length two. o a* o (a* b*)* o (a*b*)* o (a b)(a b) 34. of a two-pass compiler is consists of Instruction selection, Register allocation and Instruction scheduling. o Backend PG # 9 o Frontend o Start o None of the Given 35. is evaluated to yield a value. o Command o Expression o Declaration

36. Bottom-up parsers handle a class of grammar. o Large Click Here for More Detail PG # 49 o Small o Medium Note: Give me a feedback and your Suggestion also If you find any mistake in mcqz plz inform at above mentioned email address. And tell me your answer with references.