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

Similar documents
GUJARAT TECHNOLOGICAL UNIVERSITY

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

LANGUAGE PROCESSORS. Presented By: Prof. S.J. Soni, SPCE Visnagar.

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

Question Bank. 10CS63:Compiler Design

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY ADITYA SILVER OAK INSTITUTE OF TECHNOLOGY

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

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

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY

Chapter 3: Describing Syntax and Semantics. Introduction Formal methods of describing syntax (BNF)

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY

PSD1C SYSTEM SOFTWAE UNIT: I - V PSD1C SYSTEM SOFTWARE

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

QUESTIONS RELATED TO UNIT I, II And III

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

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

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

ASSEMBLERS. Prof. S.J. Soni, SPCE, Visnagar

2068 (I) Attempt all questions.

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

UNIT I. Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK-4. 1

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

2) Save the Macro definition:- The processor must store the macro instruction definitions which it will need for expanding macro calls.

LECTURE NOTES ON COMPILER DESIGN P a g e 2

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

COMPILER DESIGN. For COMPUTER SCIENCE

VIVA QUESTIONS WITH ANSWERS

CPS 506 Comparative Programming Languages. Syntax Specification

GUJARAT TECHNOLOGICAL UNIVERSITY

III) EXAMINATION, 2015 CS 331 : SYSTEM PROGRAMMING AND OPERATING SYSTEM I

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

Compiler Design Aug 1996

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

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER-15 EXAMINATION Model Answer Paper

CSE 401 Midterm Exam 11/5/10

Sardar Vallabhbhai Patel Institute of Technology (SVIT), Vasad M.C.A. Department COSMOS LECTURE SERIES ( ) (ODD) Code Optimization

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

INSTITUTE OF AERONAUTICAL ENGINEERING

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


Lexical Scanning COMP360

CS 4201 Compilers 2014/2015 Handout: Lab 1

BSCS Fall Mid Term Examination December 2012

VALLIAMMAI ENGINEERING COLLEGE

A Simple Syntax-Directed Translator

COMP455: COMPILER AND LANGUAGE DESIGN. Dr. Alaa Aljanaby University of Nizwa Spring 2013

Intermediate Code Generation

Time : 1 Hour Max Marks : 30

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

COMPILER DESIGN LECTURE NOTES

Compiling Regular Expressions COMP360

ECE251 Midterm practice questions, Fall 2010

AC59/AT59 OPERATING SYSTEMS & SYSTEMS SOFTWARE DECEMBER 2012

CMSC 330: Organization of Programming Languages

Dixita Kagathara Page 1

A simple syntax-directed

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

Principles of Programming Languages COMP251: Syntax and Grammars

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY

Architecture of Compilers, Interpreters. CMSC 330: Organization of Programming Languages. Front End Scanner and Parser. Implementing the Front End

4. An interpreter is a program that

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

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

CS 315 Programming Languages Syntax. Parser. (Alternatively hand-built) (Alternatively hand-built)

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

10/5/17. Lexical and Syntactic Analysis. Lexical and Syntax Analysis. Tokenizing Source. Scanner. Reasons to Separate Lexical and Syntax Analysis


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

PRINCIPLES OF COMPILER DESIGN

Compiler Design Concepts. Syntax Analysis

Life Cycle of Source Program - Compiler Design

Formal Languages and Compilers Lecture I: Introduction to Compilers

Syntax Analysis. Chapter 4

COMPILERS BASIC COMPILER FUNCTIONS

INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS)

General Overview of Compiler

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

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

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

Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology

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

AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30]

Theory and Compiling COMP360

CMSC 330: Organization of Programming Languages. Architecture of Compilers, Interpreters

2.2 Syntax Definition

Intermediate Code Generation

10/4/18. Lexical and Syntactic Analysis. Lexical and Syntax Analysis. Tokenizing Source. Scanner. Reasons to Separate Lexical and Syntactic Analysis

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

Compiler, Assembler, and Linker

Programming Language

Compiling and Interpreting Programming. Overview of Compilers and Interpreters


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

Compiler Theory. (Semantic Analysis and Run-Time Environments)

SYSTEMS PROGRAMMING. Srimanta Pal. Associate Professor Indian Statistical Institute Kolkata OXFORD UNIVERSITY PRESS

1. Consider the following program in a PCAT-like language.

Compiler Code Generation COMP360

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING

Language Processors Chapter 1. By: Bhargavi H Goswami Assistant Professor Sunshine Group of Institutes Rajkot, Gujarat, India

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

Transcription:

QUESTION BANK CHAPTER 1 : OVERVIEW OF SYSTEM SOFTWARE 1) Explain Analysis-synthesis model/fron end backend model of compiler 2) Explain various phases of compiler and symbol table. Consider the statement a=b+c*10.where a, b, c are of type float. Show the translation of the given statement by different phases of compiler to produce assembly language statement 3) Explain in brief syntax analysis phase Compare user-centric view and system-centric view of system software. 4) Perform lexical, syntax and semantic analysis on below C statement a=b+c*d*100+e/f Where data type of b, c & e are integers and remaining all variables are float. 5) Define following terms: (i) Assembler (ii) Macro (iii) Parsing CHAPTER 2: Overview of Language Processors 1) Define Following terms: 1. System Software 2. Semantic Gap 3. Specification Gap 4. Execution Gap 5. Language Migrator 2) Compare Problem oriented and Procedure oriented languages. 3) Explain the various stages of the life cycle of a source program with a neat diagram 4) Explain language processing activities A bridges an execution gap to the machine language of a computer system. 1) Detranslator, (2) Preprocessor, (3) Language translator (ii) A bridges the specification gap between two programming languages. (1) Interpreter (2) Language Migrator (3) Compiler (iii) is designed to hold the value of formal parameters during expansion of macro call. 1) Actual Parameter Table (2) Macro Name Table (3) Expansion time variable table (iv) Syntax analysis processes the string of tokens built by to determine the statement class. (1) Semantic Analysis (2) Lexical Analysis (3) Itself CHAPTER 3: Assemblers 1) Explain and compare two variants of the intermediate code generated from multi pass assembler.

2) List out the tasks performed by the analysis and synthesis phase of a Simple Assembly Language 3) Differentiate one pass and two pass assembler. Explain how forward references are handled in two pass assembler. 4) Explain in brief design of a Single Pass Assembler. 5) Explain various data structures (tables) needed in PASS I of the assembler with their fields. Also explain various data structures used for symbol table. 6) Explain and show usage by giving examples of advanced assembler Directives 7) Define following terms : 1) Handle 2) Program Relocation 3) literals 4) Forward Reference 5) pass 6) Frequency reduction 7) triples 8) Define forward references. How it can be solved using back-patching? Explain with example 9) Given the source program: START 200 X DS 4 L1 MOVER AREG,Y SUB AREG,Z MOVEM AREG,W W EQU X+2 L2 PRINT W ORIGIN X-5 Z DC 9 ORIGIN L2+1 STOP Y DC 7 END 1) Show the contents of symbol table at the end of pass I. 2) Explain the significance of EQU and ORIGIN statements in the program and explain how they are processed by the assembler. 3) Show the intermediate code generated from the program in variant 1 and variant 2 form. 10) Given the source program: START 100 A DS 3 L1 MOVER AREG, B ADD AREG, C MOVEM AREG, D D EQU A+1 L2 PRINT D ORIGIN A-1 C DC 5 ORIGIN L2+1 STOP B DC 19 END L1 (a) Show the contents of the symbol table at the end of Pass I.

(b) Explain the significance of EQU and ORIGIN statement in the program and explain how they are processed by the assembler. (c) Show the intermediate code generated for the program 11) Explain the role of Mnemonic Opcode Table, Symbol Table, Literal Table and POOL Table in assembling process of assembly language program 12) Consider following assembly language program: Show (i) Contents of Symbol Table (ii) Intermediate codes using Variant I representation. START 101 READ N MOVER BREG, ONE MOVEM BREG, TERM AGAIN MULT BREG, TERM MOVER CREG, TERM ADD CREG, ONE MOVEM CREG, TERM COMP CREG, N BC LE, AGAIN MOVEM BREG, AGAIN PRINT RESULT STOP N DS 1 RESULT DS 1 ONE DC 1 TERM DS 1 END CHAPTER 4: Macro and Macro Processors 1) Explain following terms with suitable example. (1) Expansion time variable (3) Semantic expansion (2) Positional parameter (4) Macro Pre-processor 2) Illustrate nested calls for any two macros of your choice with its corresponding expansion.. 3) Compare and Contrast the following (i) macro call and function call (ii) macro preprocessor and macro assembler. 4) Explain macro expansion process with example.. 5) Define Lexical and Semantic Expansion. Write a macro which takes A, B, C and D as parameters and calculates A*B+C*D in AREG. 6) Explain various data structures of Macro definition processing with example 7) Explain with example expansion time sequencing symbols and expansion time variable. 8) Explain advanced macro facilities using appropriate example. 9) Explain in brief the design of a macro preprocessor. 10) Do as directed (i) A macro is a unit of specification for through expansion. (Fill in the blank)

(ii) Macro definition is enclosed between a statement and a statement. (Fill in the blank) (iii) A is designed to hold the names of all macro defined in a program. (Fill in the blank) (iv) An counter is maintained to count the number of nested macro calls. (Fill in the blank) (v) A lexical expansion is typically employed to replace occurrence of formal parameters by corresponding actual parameters. (State True/False) (vi) Default specification of parameters is useful in situations where a parameter has the different value in most calls. (State True/False) (vii) Macro definition table is maintained to hold value of sequencing symbols. (State True/False) 11) Explain attributes of formal parameters, default specifications of parameter and semantic expansion for macro by giving examples. 12) Write general purpose macro to move the contents of one area of memory into another area of memory. Assume that destination area is larger in size, remaining part of it should be padded with zeroes at the end of the area CHAPTER 6 : Scanning and Parsing 1) Explain types of grammer. 2) Write a regular expression for a language containing a binary string which does not contain two consecutive 0s or two consecutive 1s anywhere 3) Construct operator precedence parser for following grammar : E E+E E*E (E) E^E id. 4) Given the grammer, perform the top-down parsing for the string +*35*45 E = +TE E T = *VT V V= 0 1 2 3 9 5) Construct LL(1) parsing table for following grammar. E TE E +TE Є T FT T *FT Є F (E) id 6) Write regular expressions of a given language. The language consists of all strings of a s and b s which ends with a and does not contain bb. 7) Draw Optimized DFA for following regular expression. (1*)*0(0/1)*# 8) Define the following with example: (i) Left recursive grammar (ii) Symbol Table 9) Explain Left recursion and Left factoring by stating its general production rules & suitable grammar examples.

10) Write unambiguous production rules to produce arithmetic expression consisting of +, -, *, / and ^ (exponent). Construct parse tree and abstract syntax tree for : id * id + id ^ id - id / id 11) Construct DFA for following regular expression: (a b)* abb (a b)* # 12) Given a grammar, E TX X +TX ε T FY Y *FY ε F id (E) Develop LL(1) parsing table and parse a string (id + id) * id 13) Explain working of operator precedence parser by giving suitable example. 14) Explain recursive descent parsing algorithm with example. 15) Perform left-fectoring on the following grammar S = i E t S e S i E t S a E = b 16) Define Handle. Using Handle and Simple Phrase trace the bottom up parsing algorithm(shift reduce parser). Grammar is : E T+ E T E T T T *V T / V V V a b c d String is : a - b * c + d 17) When Left- factoring on a grammar is applied? Apply left- factoring on the below given grammar and perform Predictive Parsing. Grammar is S i E t S i E t S e S a E b String is : i b t a e i b t a CHAPTER 7: Compilers 1) What is need and importance of intermediate code? Create quadruple and Triple for following statement. a= (a+b)*(c-d) 2) Explain various optimizing transformations of a compiler using appropriate examples. 3) Discuss parameters for activation records. 1) Explain Memory allocation models 2) Explain methods for accessing non local variables. 4) Show quadruple table for local optimization using value numbers Stmt. No. Stmt 14 g=25.2 15 x=z+2 16 h=x*y+d :..

34 w=x*y 5) Explain different code optimization techniques. 6) Given following expression: x = -a * b + -a * b (1) Write three address codes for the expression. (2) Optimize the three address code if it is possible to do so. (3) Give triple implementation for the three address code of the expression 7) Given following expression = - (a+b) *(c+d) + (a+b+c) 1. Draw a Syntax tree for the expression 2. Write a three-address code for the expression 3. Give triple representation for the three address code of the expression 8) Define static pointer. Find Register Requirement (RR) for the below given expression f + ( x + y ) * ( ( a + b) / (c - d) ) 9) Explain memory allocation in block structured language.