Roll No. :... Invigilator's Signature :. CS/B.Tech(CSE)/SEM-7/CS-701/ LANGUAGE PROCESSOR. Time Allotted : 3 Hours Full Marks : 70

Similar documents
VALLIAMMAI ENGINEERING COLLEGE

Compiler Design Aug 1996

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

GUJARAT TECHNOLOGICAL UNIVERSITY

QUESTIONS RELATED TO UNIT I, II And III

Question Bank. 10CS63:Compiler Design

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

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

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

2068 (I) Attempt all questions.

QUESTION BANK CHAPTER 1 : OVERVIEW OF SYSTEM SOFTWARE. CHAPTER 2: Overview of Language Processors. CHAPTER 3: Assemblers

1. Explain the input buffer scheme for scanning the source program. How the use of sentinels can improve its performance? Describe in detail.

SYLLABUS UNIT - I UNIT - II UNIT - III UNIT - IV CHAPTER - 1 : INTRODUCTION CHAPTER - 4 : SYNTAX AX-DIRECTED TRANSLATION TION CHAPTER - 7 : STORA

General Overview of Compiler

DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING UNIT -1-INTRODUCTION TO COMPILERS 2 MARK QUESTIONS

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Context-free grammars

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

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

Compiler Construction: Parsing

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

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

INSTITUTE OF AERONAUTICAL ENGINEERING

4. Lexical and Syntax Analysis

VIVA QUESTIONS WITH ANSWERS

4. Lexical and Syntax Analysis

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


The analysis part breaks up the source program into constituent pieces and creates an intermediate representation of the source program.

The Parsing Problem (cont d) Recursive-Descent Parsing. Recursive-Descent Parsing (cont d) ICOM 4036 Programming Languages. The Complexity of Parsing

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

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING COURSE PLAN

Concepts Introduced in Chapter 4

Let us construct the LR(1) items for the grammar given below to construct the LALR parsing table.

Formal Languages and Compilers Lecture VII Part 3: Syntactic A

CMSC 330 Practice Problem 4 Solutions

BSCS Fall Mid Term Examination December 2012

Chapter 4. Lexical and Syntax Analysis

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

G.PULLAIH COLLEGE OF ENGINEERING & TECHNOLOGY

Dixita Kagathara Page 1

VALLIAMMAI ENGINEERING COLLEGE

Chapter 4: Syntax Analyzer

CS308 Compiler Principles Lexical Analyzer Li Jiang

CS606- compiler instruction Solved MCQS From Midterm Papers

UNIT-III BOTTOM-UP PARSING

SLR parsers. LR(0) items

List of Figures. About the Authors. Acknowledgments

Parsing Wrapup. Roadmap (Where are we?) Last lecture Shift-reduce parser LR(1) parsing. This lecture LR(1) parsing

Syntax Analysis Part I

CMSC 330, Fall 2009, Practice Problem 3 Solutions

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

JavaCC Parser. The Compilation Task. Automated? JavaCC Parser

CSE 130 Programming Language Principles & Paradigms Lecture # 5. Chapter 4 Lexical and Syntax Analysis

Lexical and Syntax Analysis. Bottom-Up Parsing

Syntax Analysis. Chapter 4

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

Trustworthy Compilers

INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS)

HW 3: Bottom-Up Parsing Techniques

Downloaded from Page 1. LR Parsing

CST-402(T): Language Processors

DEPARTMENT OF INFORMATION TECHNOLOGY AUTOMATA AND COMPILER DESIGN. B.Tech-IT, III Year -I Sem

LR Parsers. Aditi Raste, CCOEW

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

UNIT III & IV. Bottom up parsing

Chapter 4. Lexical and Syntax Analysis. Topics. Compilation. Language Implementation. Issues in Lexical and Syntax Analysis.

LECTURE NOTES ON COMPILER DESIGN P a g e 2

UNIT I INTRODUCTION TO COMPILING

3. Syntax Analysis. Andrea Polini. Formal Languages and Compilers Master in Computer Science University of Camerino

PSD3A Principles of Compiler Design Unit : I-V. PSD3A- Principles of Compiler Design

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

Time : 1 Hour Max Marks : 30

VETRI VINAYAHA COLLEGE OF ENGINEERING AND TECHNOLOGY

Bottom up parsing. The sentential forms happen to be a right most derivation in the reverse order. S a A B e a A d e. a A d e a A B e S.

Torben./Egidius Mogensen. Introduction. to Compiler Design. ^ Springer

KALASALINGAM UNIVERSITY ANAND NAGAR, KRISHNAN KOIL DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ODD SEMESTER COURSE PLAN

CS502: Compilers & Programming Systems

Principles of Compiler Design Presented by, R.Venkadeshan,M.Tech-IT, Lecturer /CSE Dept, Chettinad College of Engineering &Technology

Lecture 7: Deterministic Bottom-Up Parsing

Final Term Papers 2013

Bottom-Up Parsing. Lecture 11-12

LR Parsing - The Items

Wednesday, September 9, 15. Parsers

Parsers. What is a parser. Languages. Agenda. Terminology. Languages. A parser has two jobs:

Lecture 14: Parser Conflicts, Using Ambiguity, Error Recovery. Last modified: Mon Feb 23 10:05: CS164: Lecture #14 1

4. An interpreter is a program that

Question Marks 1 /11 2 /4 3 /13 4 /5 5 /11 6 /14 7 /32 8 /6 9 /11 10 /10 Total /117

Syntax Analysis: Context-free Grammars, Pushdown Automata and Parsing Part - 4. Y.N. Srikant

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

PRINCIPLES OF COMPILER DESIGN

University of Technology Department of Computer Sciences. Final Examination st Term. Subject:Compilers Design

Zhizheng Zhang. Southeast University

Parsing. Rupesh Nasre. CS3300 Compiler Design IIT Madras July 2018

Recursive Descent Parsers

UNIT IV INTERMEDIATE CODE GENERATION

Compiler Design Overview. Compiler Design 1

Compiler Design 1. Bottom-UP Parsing. Goutam Biswas. Lect 6

Roll No. :... Invigilator's Signature :.. CS/B.TECH(CSE/IT)/SEM-5/CS-501/ OPERATING SYSTEM. Time Allotted : 3 Hours Full Marks : 70

Compiler Construction

Transcription:

Name : Roll No. :... Invigilator's Signature :. CS/B.Tech(CSE)/SEM-7/CS-701/2011-12 2011 LANGUAGE PROCESSOR Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers in their own words as far as practicable GROUP A ( Multiple Choice Type Questions ) 1. Choose the correct alternati es for the following : 10 1 = 10 i) Firstpos of a.(dot node with leaves c1 and c2 is a) firstpos(c1) U firstpos(c2) b) firstpos(c1) I firstpos(c2) c) if (nullable(c1)) firstpos(c1) U firstpos(c2) else firstpos(c1) d) if (nullable(c2)) firstpos(c1) U firstpos(c2) else firstpos(c1). 7101 [ Turn over

ii) Parse tree is generated in the phase of a) Syntax Analysis b) Semantic Analysis c) Code Optimization iii) iv) d) Intermediate Code Generation. FIRST ( αβ ) is a) FIRST ( α ) b) FIRST ( α ) U FIRST ( β ) c) FIRST ( α ) U FIRST ( β ) if FIRST ( α ) contains else FIRST ( α ) d) none of these A given grammer is not LL(1) if the parsing table of a grammer may contain a) any blank field b) any e-entry c) duplicate entry of same production d) more than one production rule. v) White spaces and tabs are removed in a) Lexical analysis b) Syntax analysis c) Semantic analysis d) all of these. 7101 2

vi) Left factoring guarantees a) not occurring of backtracking b) cycle free parse tree c) error free target code d) correct LL(1) parsing table. vii) A parse tree showing the values of attributes at each node is called in particular a) Syntax tree b) Annotated parse tree c) Syntax Direc parse tree d) Direct Acyclic graph. viii) Which of the following is not true for Dynamic Type Checking? a) It increases the cost of execution b) Type checking is done during the execution c) All the type errors are detected d) None of these. 7101 3 [ Turn over

ix) Which of the following is not a loop optimization? a) Induction variable elimination b) Loop jamming c) Loop unrolling d) Loop heading. x) YACC builds up a) SLR parsing table b) LALR parsing table c) canonical LR parsing table d) none of these. GROUP B ( Short Answer Type Questions ) Answer any three of the following. 3 5 = 15 2. Describe analys s phase of a compiler in respect of the following example. Position = initial + rate 60. 1 + 4 3. Describe with diagram the working process of Lexical Analyzer. 4. What is error handling? Describe the Panic Mode and Phrase level error recovery technique with example. 1 + 4 7101 4

5. What do you understand by L-attributed definitions? Illustrate with an example. 2 + 3 6. What is recursive descent parsing? Describe the drawbacks of recursive descent parsing for generating the string 'abc' from the grammar : S abc B bc b 1 + 4 GROUP C ( Long Answer Type Questions ) Answer any three of the following. 3 15 = 45 7. Describe with a block diagram the parsing technique of LL(1) parser. Parse the string 'abba' using LL(1) parser where the parsing table is given below : S a b $ S aba B B ε B bb Check whether the following grammer is LL(1) or not. S i C t SE a E e S ε C b. 4 + 4 + 7 7101 5 [ Turn over

8. Describe LR parsing with block diagram. What are the main advantages of LR parsing? Construct SLR parsing table for the grammer given below : S Cb C bc / d. 4 + 3 + 8 9. Construct DFA directly from [ Not by generating NFA ] the regular expression L = ( a b ) ab What are the main contributions of Syntax Directed Translation in Compiler? Design a Dependency Graph and Direct Acyclic Graph for the string : a + a ( b c ) + ( b c ) d. 7 + 3 + 5 10. a) Translate the expression a = ( a + b ) ( c + d + ( a + b + c ) into i) Quadruple ii) iii) iv) Triple Indirect Triple 3-address code. b) Draw the flow graph for the following code : i) location = 1 ii) i = 0 iii) i < 100 goto 5 iv) goto 13 v) t 1 = 4i 7101 6

vi) t 2 = A [ t 1 ] vii) if t 2 = x goto 9 CS/B.Tech(CSE)/SEM-7/CS-701/2011-12 viii) goto 10 ix) location = i x) t 3 = i + 1 xi) i = t 3 xii) goto 3 xiii)... c) What do you understand by terminal table and literal table? 8 + 5 + 2 11. Write short notes on any three of the following : 3 5 a) LEX and YAAC b) Activation Record c) Symbol Table d) Pe phole optimization e) Input Buffering. 7101 7 [ Turn over