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

Size: px
Start display at page:

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

Transcription

1 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 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.

3 (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)

4 (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= ) 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.

5 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= x=z+2 16 h=x*y+d :..

6 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.

GUJARAT TECHNOLOGICAL UNIVERSITY

GUJARAT TECHNOLOGICAL UNIVERSITY Type of course: System Programming GUJARAT TECHNOLOGICAL UNIVERSITY SYSTEM PROGRAMMING SUBJECT CODE: 21508 B.E. 5 th SEMESTER Prerequisite: Data Structures and Operating Systems Rationale: NA Teaching

More information

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

Gujarat Technological University Sankalchand Patel College of Engineering, Visnagar B.E. Semester VII (CE) July-Nov Compiler Design (170701) Gujarat Technological University Sankalchand Patel College of Engineering, Visnagar B.E. Semester VII (CE) July-Nov 2014 Compiler Design (170701) Question Bank / Assignment Unit 1: INTRODUCTION TO COMPILING

More information

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

LANGUAGE PROCESSORS. Presented By: Prof. S.J. Soni, SPCE Visnagar. LANGUAGE PROCESSORS Presented By: Prof. S.J. Soni, SPCE Visnagar. Introduction Language Processing activities arise due to the differences between the manner in which a software designer describes the

More information

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

SYED AMMAL ENGINEERING COLLEGE (An ISO 9001:2008 Certified Institution) Dr. E.M. Abdullah Campus, Ramanathapuram CS6660 COMPILER DESIGN Question Bank UNIT I-INTRODUCTION TO COMPILERS 1. Define compiler. 2. Differentiate compiler and interpreter. 3. What is a language processing system? 4. List four software tools

More information

Question Bank. 10CS63:Compiler Design

Question Bank. 10CS63:Compiler Design Question Bank 10CS63:Compiler Design 1.Determine whether the following regular expressions define the same language? (ab)* and a*b* 2.List the properties of an operator grammar 3. Is macro processing a

More information

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

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY ADITYA SILVER OAK INSTITUTE OF TECHNOLOGY BE - SEMESTER V MID SEMESTER-I EXAMINATION WINTER 2018 SUBJECT: MICROPROCESS & INTERFACING (2150707) (CE) DATE: 10-08-2018 TIME: 02:00pm to 03:30 pm TOTAL MARKS: 40 Q.1 (a) Write an ALP to add two 16 bit

More information

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

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Subject Name: CS2352 Principles of Compiler Design Year/Sem : III/VI DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Subject Name: CS2352 Principles of Compiler Design Year/Sem : III/VI UNIT I - LEXICAL ANALYSIS 1. What is the role of Lexical Analyzer? [NOV 2014] 2. Write

More information

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

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

More information

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY BE - SEMESTER V MID SEMESTER-I EXAMINATION WINTER 2018 Enroll. No. SUBJECT: ANALYSIS AND DESIGN OF ALGITHMS (2150703) (CE\IT) DATE: 08/08/2018 TIME: 2:00

More information

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

Chapter 3: Describing Syntax and Semantics. Introduction Formal methods of describing syntax (BNF) Chapter 3: Describing Syntax and Semantics Introduction Formal methods of describing syntax (BNF) We can analyze syntax of a computer program on two levels: 1. Lexical level 2. Syntactic level Lexical

More information

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY Enroll. No. SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY SUBJECT: SYSTEM PROGRAMMING (2150708) (CE/IT) DATE: 08-08-2017 TIME:2:00 pm to 3:30 pm TOTAL MARKS:40 Instructions: 1. All the questions are compulsory.

More information

PSD1C SYSTEM SOFTWAE UNIT: I - V PSD1C SYSTEM SOFTWARE

PSD1C SYSTEM SOFTWAE UNIT: I - V PSD1C SYSTEM SOFTWARE PSD1C SYSTEM SOFTWAE UNIT: I - V 1 Syllabus Unit-I Language Processors Types of Language Processors Language Processing Activities Fundamentals of Language Processing Language Specification Data Structures

More information

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

About the Authors... iii Introduction... xvii. Chapter 1: System Software... 1 Table of Contents About the Authors... iii Introduction... xvii Chapter 1: System Software... 1 1.1 Concept of System Software... 2 Types of Software Programs... 2 Software Programs and the Computing Machine...

More information

QUESTIONS RELATED TO UNIT I, II And III

QUESTIONS RELATED TO UNIT I, II And III QUESTIONS RELATED TO UNIT I, II And III UNIT I 1. Define the role of input buffer in lexical analysis 2. Write regular expression to generate identifiers give examples. 3. Define the elements of production.

More information

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

1. Explain the input buffer scheme for scanning the source program. How the use of sentinels can improve its performance? Describe in detail. Code No: R05320502 Set No. 1 1. Explain the input buffer scheme for scanning the source program. How the use of sentinels can improve its performance? Describe in detail. 2. Construct predictive parsing

More information

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

DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING UNIT -1-INTRODUCTION TO COMPILERS 2 MARK QUESTIONS BHARATHIDASAN ENGINEERING COLLEGE DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING Year & Semester : III & VI Degree & Branch : B.E (CSE) /B.Tech (Information Technology) Subject

More information

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : III & VI Section : CSE 1 & 2 Subject Code : CS6660 Subject Name : COMPILER

More information

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

ASSEMBLERS. Prof. S.J. Soni, SPCE, Visnagar ASSEMBLERS Prof. S.J. Soni, SPCE, Visnagar Design Specifications Identify the information necessary to perform a task Design a suitable data structure to record the information Determine the processing

More information

2068 (I) Attempt all questions.

2068 (I) Attempt all questions. 2068 (I) 1. What do you mean by compiler? How source program analyzed? Explain in brief. 2. Discuss the role of symbol table in compiler design. 3. Convert the regular expression 0 + (1 + 0)* 00 first

More information

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

1. The output of lexical analyser is a) A set of RE b) Syntax Tree c) Set of Tokens d) String Character 1. The output of lexical analyser is a) A set of RE b) Syntax Tree c) Set of Tokens d) String Character 2. The symbol table implementation is based on the property of locality of reference is a) Linear

More information

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

UNIT I. Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK-4. 1 Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK-4. 1 UNIT I Introduction: Components of System Software: Text editors, Loaders, Assemblers, Macro processors, Compilers, Debuggers. Machine Structure,

More information

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

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / EVEN SEMESTER KINGS COLLEGE OF ENGINEERING PUNALKULAM DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR 2010-2011 / EVEN SEMESTER SUBJECT CODE\SUBJECT NAME: CS1352 \ PRINCIPLES OF COMPILER DESIGN QUESTION BANK

More information

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

2) Save the Macro definition:- The processor must store the macro instruction definitions which it will need for expanding macro calls. Subject Code: 17517 Model Answer Page: 1/ 21 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model

More information

LECTURE NOTES ON COMPILER DESIGN P a g e 2

LECTURE NOTES ON COMPILER DESIGN P a g e 2 LECTURE NOTES ON COMPILER DESIGN P a g e 1 (PCCS4305) COMPILER DESIGN KISHORE KUMAR SAHU SR. LECTURER, DEPARTMENT OF INFORMATION TECHNOLOGY ROLAND INSTITUTE OF TECHNOLOGY, BERHAMPUR LECTURE NOTES ON COMPILER

More information

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

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design i About the Tutorial A compiler translates the codes written in one language to some other language without changing the meaning of the program. It is also expected that a compiler should make the target

More information

COMPILER DESIGN. For COMPUTER SCIENCE

COMPILER DESIGN. For COMPUTER SCIENCE COMPILER DESIGN For COMPUTER SCIENCE . COMPILER DESIGN SYLLABUS Lexical analysis, parsing, syntax-directed translation. Runtime environments. Intermediate code generation. ANALYSIS OF GATE PAPERS Exam

More information

VIVA QUESTIONS WITH ANSWERS

VIVA QUESTIONS WITH ANSWERS VIVA QUESTIONS WITH ANSWERS 1. What is a compiler? A compiler is a program that reads a program written in one language the source language and translates it into an equivalent program in another language-the

More information

CPS 506 Comparative Programming Languages. Syntax Specification

CPS 506 Comparative Programming Languages. Syntax Specification CPS 506 Comparative Programming Languages Syntax Specification Compiling Process Steps Program Lexical Analysis Convert characters into a stream of tokens Lexical Analysis Syntactic Analysis Send tokens

More information

GUJARAT TECHNOLOGICAL UNIVERSITY

GUJARAT TECHNOLOGICAL UNIVERSITY Type of course: Core GUJARAT TECHNOLOGICAL UNIVERSITY SUBJECT NAME: Compiler Design SUBJECT CODE: 21701 B.E. 7 th SEMESTER Prerequisite: Data Structures and Algorithms, Theory of Computation, Rationale:

More information

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

III) EXAMINATION, 2015 CS 331 : SYSTEM PROGRAMMING AND OPERATING SYSTEM I Total No. of Questions 4] [Total No. of Printed Pages 4 Seat No. [4718]-31 T.Y. B.Sc. (Computer Science) (Semester III) EXAMINATION, 2015 CS 331 : SYSTEM PROGRAMMING AND OPERATING SYSTEM I Paper I (2008

More information

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

Compiler Design. Computer Science & Information Technology (CS) Rank under AIR 100 GATE- 2016-17 Postal Correspondence 1 Compiler Design Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts,

More information

Compiler Design Aug 1996

Compiler Design Aug 1996 Aug 1996 Part A 1 a) What are the different phases of a compiler? Explain briefly with the help of a neat diagram. b) For the following Pascal keywords write the state diagram and also write program segments

More information

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

1. (a) What are the closure properties of Regular sets? Explain. (b) Briefly explain the logical phases of a compiler model. [8+8] Code No: R05311201 Set No. 1 1. (a) What are the closure properties of Regular sets? Explain. (b) Briefly explain the logical phases of a compiler model. [8+8] 2. Compute the FIRST and FOLLOW sets of each

More information

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

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER-15 EXAMINATION Model Answer Paper Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in themodel answer scheme. 2) The model answer and the answer written by candidate may

More information

CSE 401 Midterm Exam 11/5/10

CSE 401 Midterm Exam 11/5/10 Name There are 5 questions worth a total of 100 points. Please budget your time so you get to all of the questions. Keep your answers brief and to the point. The exam is closed books, closed notes, closed

More information

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

Sardar Vallabhbhai Patel Institute of Technology (SVIT), Vasad M.C.A. Department COSMOS LECTURE SERIES ( ) (ODD) Code Optimization Sardar Vallabhbhai Patel Institute of Technology (SVIT), Vasad M.C.A. Department COSMOS LECTURE SERIES (2018-19) (ODD) Code Optimization Prof. Jonita Roman Date: 30/06/2018 Time: 9:45 to 10:45 Venue: MCA

More information

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

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING COURSE PLAN SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING COURSE PLAN Course Code : CS1014 Semester: VI Course Title : System Software and Compiler Design Course Time:

More information

INSTITUTE OF AERONAUTICAL ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad - 00 043 INFORMATION TECHNOLOGY TUTORIAL QUESTION BANK Name AUTOMATA AND COMPILER DESIGN Code A03 Class III B. Tech I Semester Branch

More information

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

The analysis part breaks up the source program into constituent pieces and creates an intermediate representation of the source program. COMPILER DESIGN 1. What is a compiler? A compiler is a program that reads a program written in one language the source language and translates it into an equivalent program in another language-the target

More information

UNIT -1 1.1 OVERVIEW OF LANGUAGE PROCESSING SYSTEM 1.2 Preprocessor A preprocessor produce input to compilers. They may perform the following functions. 1. Macro processing: A preprocessor may allow a

More information

Lexical Scanning COMP360

Lexical Scanning COMP360 Lexical Scanning COMP360 Captain, we re being scanned. Spock Reading Read sections 2.1 3.2 in the textbook Regular Expression and FSA Assignment A new assignment has been posted on Blackboard It is due

More information

CS 4201 Compilers 2014/2015 Handout: Lab 1

CS 4201 Compilers 2014/2015 Handout: Lab 1 CS 4201 Compilers 2014/2015 Handout: Lab 1 Lab Content: - What is compiler? - What is compilation? - Features of compiler - Compiler structure - Phases of compiler - Programs related to compilers - Some

More information

BSCS Fall Mid Term Examination December 2012

BSCS Fall Mid Term Examination December 2012 PUNJAB UNIVERSITY COLLEGE OF INFORMATION TECHNOLOGY University of the Punjab Sheet No.: Invigilator Sign: BSCS Fall 2009 Date: 14-12-2012 Mid Term Examination December 2012 Student ID: Section: Morning

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 60 20 DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK VI SEMESTER CS6660 COMPILER DESIGN Regulation 20 Academic Year 207 8 Prepared by Ms. S.

More information

A Simple Syntax-Directed Translator

A Simple Syntax-Directed Translator Chapter 2 A Simple Syntax-Directed Translator 1-1 Introduction The analysis phase of a compiler breaks up a source program into constituent pieces and produces an internal representation for it, called

More information

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

COMP455: COMPILER AND LANGUAGE DESIGN. Dr. Alaa Aljanaby University of Nizwa Spring 2013 COMP455: COMPILER AND LANGUAGE DESIGN Dr. Alaa Aljanaby University of Nizwa Spring 2013 Chapter 1: Introduction Compilers draw together all of the theory and techniques that you ve learned about in most

More information

Intermediate Code Generation

Intermediate Code Generation Intermediate Code Generation Translating source program into an intermediate language. Simple CPU Indepent, yet, close in spirit to machine language. Three Address Code (quadruples) Two Address Code, etc.

More information

Time : 1 Hour Max Marks : 30

Time : 1 Hour Max Marks : 30 Total No. of Questions : 6 P4890 B.E/ Insem.- 74 B.E ( Computer Engg) PRINCIPLES OF MODERN COMPILER DESIGN (2012 Pattern) (Semester I) Time : 1 Hour Max Marks : 30 Q.1 a) Explain need of symbol table with

More information

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

A programming language requires two major definitions A simple one pass compiler A programming language requires two major definitions A simple one pass compiler [Syntax: what the language looks like A context-free grammar written in BNF (Backus-Naur Form) usually suffices. [Semantics:

More information

COMPILER DESIGN LECTURE NOTES

COMPILER DESIGN LECTURE NOTES COMPILER DESIGN LECTURE NOTES UNIT -1 1.1 OVERVIEW OF LANGUAGE PROCESSING SYSTEM 1.2 Preprocessor A preprocessor produce input to compilers. They may perform the following functions. 1. Macro processing:

More information

Compiling Regular Expressions COMP360

Compiling Regular Expressions COMP360 Compiling Regular Expressions COMP360 Logic is the beginning of wisdom, not the end. Leonard Nimoy Compiler s Purpose The compiler converts the program source code into a form that can be executed by the

More information

ECE251 Midterm practice questions, Fall 2010

ECE251 Midterm practice questions, Fall 2010 ECE251 Midterm practice questions, Fall 2010 Patrick Lam October 20, 2010 Bootstrapping In particular, say you have a compiler from C to Pascal which runs on x86, and you want to write a self-hosting Java

More information

AC59/AT59 OPERATING SYSTEMS & SYSTEMS SOFTWARE DECEMBER 2012

AC59/AT59 OPERATING SYSTEMS & SYSTEMS SOFTWARE DECEMBER 2012 Q2a. What are the various actions an operating system performs when a new process is created? Explain four fundamental states for a process using a state transition diagram. Ans 2a. As a process executes,

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Context Free Grammars and Parsing 1 Recall: Architecture of Compilers, Interpreters Source Parser Static Analyzer Intermediate Representation Front End Back

More information

Dixita Kagathara Page 1

Dixita Kagathara Page 1 2014 Sem - VII Introduction 1) Explain Phases of compiler or Analysis synthesis model of compilation. The compiler is designed into two parts. The first phase is the analysis phase while the second phase

More information

A simple syntax-directed

A simple syntax-directed Syntax-directed is a grammaroriented compiling technique Programming languages: Syntax: what its programs look like? Semantic: what its programs mean? 1 A simple syntax-directed Lexical Syntax Character

More information

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS Objective PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS Explain what is meant by compiler. Explain how the compiler works. Describe various analysis of the source program. Describe the

More information

Principles of Programming Languages COMP251: Syntax and Grammars

Principles of Programming Languages COMP251: Syntax and Grammars Principles of Programming Languages COMP251: Syntax and Grammars Prof. Dekai Wu Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong, China Fall 2007

More information

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING DEPARTMENT OF CSE COURSE PLAN Course Code : CS0301 Course Title : Compiler Design Semester : V Course Time

More information

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

Architecture of Compilers, Interpreters. CMSC 330: Organization of Programming Languages. Front End Scanner and Parser. Implementing the Front End Architecture of Compilers, Interpreters : Organization of Programming Languages ource Analyzer Optimizer Code Generator Context Free Grammars Intermediate Representation Front End Back End Compiler / Interpreter

More information

4. An interpreter is a program that

4. An interpreter is a program that 1. In an aboslute loading scheme, which loader function is accomplished by programmer? A. Allocation B. LInking C. Reallocation D. both (A) and (B) 2. A compiler program written in a high level language

More information

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

Chapter 4. Lexical and Syntax Analysis. Topics. Compilation. Language Implementation. Issues in Lexical and Syntax Analysis. Topics Chapter 4 Lexical and Syntax Analysis Introduction Lexical Analysis Syntax Analysis Recursive -Descent Parsing Bottom-Up parsing 2 Language Implementation Compilation There are three possible approaches

More information

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

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF CSE COURSE PLAN Course Code : CS0301 Course Title : Compiler Design Semester : V Course Time : July Dec 2011 DAY SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF CSE COURSE PLAN SECTION

More information

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

CS 315 Programming Languages Syntax. Parser. (Alternatively hand-built) (Alternatively hand-built) Programming languages must be precise Remember instructions This is unlike natural languages CS 315 Programming Languages Syntax Precision is required for syntax think of this as the format of the language

More information

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

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science and Engineering TEST 1 Date : 24 02 2015 Marks : 50 Subject & Code : Compiler Design ( 10CS63) Class : VI CSE A & B Name of faculty : Mrs. Shanthala P.T/ Mrs. Swati Gambhire Time : 8:30 10:00 AM SOLUTION MANUAL 1. a.

More information

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

10/5/17. Lexical and Syntactic Analysis. Lexical and Syntax Analysis. Tokenizing Source. Scanner. Reasons to Separate Lexical and Syntax Analysis Lexical and Syntactic Analysis Lexical and Syntax Analysis In Text: Chapter 4 Two steps to discover the syntactic structure of a program Lexical analysis (Scanner): to read the input characters and output

More information

UNIT I INTRODUCTION TO COMPILER 1. What is a Complier? A Complier is a program that reads a program written in one language-the source language-and translates it in to an equivalent program in another

More information

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

University of Technology Department of Computer Sciences. Final Examination st Term. Subject:Compilers Design Subject:Compilers Design Division: All Branches Examiner:Dr. Abeer Tariq University of Technology Department of Computer Sciences 2102 Final Examination 2011-2012 1 st Term Year:Third Time: 3 Hours Date:

More information

PRINCIPLES OF COMPILER DESIGN

PRINCIPLES OF COMPILER DESIGN PRINCIPLES OF COMPILER DESIGN 2 MARK QUESTIONS WITH ANSWERS UNIT I 1. What is a Complier? A Complier is a program that reads a program written in one language-the source language-and translates it in to

More information

Compiler Design Concepts. Syntax Analysis

Compiler Design Concepts. Syntax Analysis Compiler Design Concepts Syntax Analysis Introduction First task is to break up the text into meaningful words called tokens. newval=oldval+12 id = id + num Token Stream Lexical Analysis Source Code (High

More information

Life Cycle of Source Program - Compiler Design

Life Cycle of Source Program - Compiler Design Life Cycle of Source Program - Compiler Design Vishal Trivedi * Gandhinagar Institute of Technology, Gandhinagar, Gujarat, India E-mail: raja.vishaltrivedi@gmail.com Abstract: This Research paper gives

More information

Formal Languages and Compilers Lecture I: Introduction to Compilers

Formal Languages and Compilers Lecture I: Introduction to Compilers Formal Languages and Compilers Lecture I: Introduction to Compilers Free University of Bozen-Bolzano Faculty of Computer Science POS Building, Room: 2.03 artale@inf.unibz.it http://www.inf.unibz.it/ artale/

More information

Syntax Analysis. Chapter 4

Syntax Analysis. Chapter 4 Syntax Analysis Chapter 4 Check (Important) http://www.engineersgarage.com/contributio n/difference-between-compiler-andinterpreter Introduction covers the major parsing methods that are typically used

More information

COMPILERS BASIC COMPILER FUNCTIONS

COMPILERS BASIC COMPILER FUNCTIONS COMPILERS BASIC COMPILER FUNCTIONS A compiler accepts a program written in a high level language as input and produces its machine language equivalent as output. For the purpose of compiler construction,

More information

INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS)

INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS) Name Code Class Branch INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS) Dundigal, Hyderabad - 500 043 Year 0-0 INFORMATION TECHNOLOGY ASSIGNMENT QUESTIONS AUTOMATA AND COMPILER DESIGN A50513 III B. Tech

More information

General Overview of Compiler

General Overview of Compiler General Overview of Compiler Compiler: - It is a complex program by which we convert any high level programming language (source code) into machine readable code. Interpreter: - It performs the same task

More information

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

PSD3A Principles of Compiler Design Unit : I-V. PSD3A- Principles of Compiler Design PSD3A Principles of Compiler Design Unit : I-V 1 UNIT I - SYLLABUS Compiler Assembler Language Processing System Phases of Compiler Lexical Analyser Finite Automata NFA DFA Compiler Tools 2 Compiler -

More information

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou Administrative! Any questions about the syllabus?! Course Material available at www.cs.unic.ac.cy/ioanna! Next time reading assignment [ALSU07]

More information

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

Lexical analysis. Syntactical analysis. Semantical analysis. Intermediate code generation. Optimization. Code generation. Target specific optimization Second round: the scanner Lexical analysis Syntactical analysis Semantical analysis Intermediate code generation Optimization Code generation Target specific optimization Lexical analysis (Chapter 3) Why

More information

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

Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology exam Compiler Construction in4303 April 9, 2010 14.00-15.30 This exam (6 pages) consists of 52 True/False

More information

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

SYLLABUS UNIT - I UNIT - II UNIT - III UNIT - IV CHAPTER - 1 : INTRODUCTION CHAPTER - 4 : SYNTAX AX-DIRECTED TRANSLATION TION CHAPTER - 7 : STORA Contents i SYLLABUS UNIT - I CHAPTER - 1 : INTRODUCTION Programs Related to Compilers. Translation Process, Major Data Structures, Other Issues in Compiler Structure, Boot Strapping and Porting. CHAPTER

More information

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

AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30] AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30] Note: Question Number 1 is compulsory. Marks : 10X1

More information

Theory and Compiling COMP360

Theory and Compiling COMP360 Theory and Compiling COMP360 It has been said that man is a rational animal. All my life I have been searching for evidence which could support this. Bertrand Russell Reading Read sections 2.1 3.2 in the

More information

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

CMSC 330: Organization of Programming Languages. Architecture of Compilers, Interpreters : Organization of Programming Languages Context Free Grammars 1 Architecture of Compilers, Interpreters Source Scanner Parser Static Analyzer Intermediate Representation Front End Back End Compiler / Interpreter

More information

2.2 Syntax Definition

2.2 Syntax Definition 42 CHAPTER 2. A SIMPLE SYNTAX-DIRECTED TRANSLATOR sequence of "three-address" instructions; a more complete example appears in Fig. 2.2. This form of intermediate code takes its name from instructions

More information

Intermediate Code Generation

Intermediate Code Generation Intermediate Code Generation In the analysis-synthesis model of a compiler, the front end analyzes a source program and creates an intermediate representation, from which the back end generates target

More information

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

10/4/18. Lexical and Syntactic Analysis. Lexical and Syntax Analysis. Tokenizing Source. Scanner. Reasons to Separate Lexical and Syntactic Analysis Lexical and Syntactic Analysis Lexical and Syntax Analysis In Text: Chapter 4 Two steps to discover the syntactic structure of a program Lexical analysis (Scanner): to read the input characters and output

More information

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

CD Assignment I. 1. Explain the various phases of the compiler with a simple example. CD Assignment I 1. Explain the various phases of the compiler with a simple example. The compilation process is a sequence of various phases. Each phase takes input from the previous, and passes the output

More information

Compiler, Assembler, and Linker

Compiler, Assembler, and Linker Compiler, Assembler, and Linker Minsoo Ryu Department of Computer Science and Engineering Hanyang University msryu@hanyang.ac.kr What is a Compilation? Preprocessor Compiler Assembler Linker Loader Contents

More information

Programming Language

Programming Language Programming Language In computer programming, a programming Language serves as a means of communication between the person with a problem and the computer used to help solve it. An effective programming

More information

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

Compiling and Interpreting Programming. Overview of Compilers and Interpreters Copyright R.A. van Engelen, FSU Department of Computer Science, 2000 Overview of Compilers and Interpreters Common compiler and interpreter configurations Virtual machines Integrated programming environments

More information

SYNTAX ANALYSIS 1. Define parser. Hierarchical analysis is one in which the tokens are grouped hierarchically into nested collections with collective meaning. Also termed as Parsing. 2. Mention the basic

More information

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

CS 2210 Sample Midterm. 1. Determine if each of the following claims is true (T) or false (F). CS 2210 Sample Midterm 1. Determine if each of the following claims is true (T) or false (F). F A language consists of a set of strings, its grammar structure, and a set of operations. (Note: a language

More information

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

Compiler Theory. (Semantic Analysis and Run-Time Environments) Compiler Theory (Semantic Analysis and Run-Time Environments) 005 Semantic Actions A compiler must do more than recognise whether a sentence belongs to the language of a grammar it must do something useful

More information

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

SYSTEMS PROGRAMMING. Srimanta Pal. Associate Professor Indian Statistical Institute Kolkata OXFORD UNIVERSITY PRESS SYSTEMS PROGRAMMING Srimanta Pal Associate Professor Indian Statistical Institute Kolkata OXFORD UNIVERSITY PRESS Contents Preface v 1. Scope of Systems Programming 1 1.1 Introduction 7 1.2 Computers and

More information

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

1. Consider the following program in a PCAT-like language. CS4XX INTRODUCTION TO COMPILER THEORY MIDTERM EXAM QUESTIONS (Each question carries 20 Points) Total points: 100 1. Consider the following program in a PCAT-like language. PROCEDURE main; TYPE t = FLOAT;

More information

Compiler Code Generation COMP360

Compiler Code Generation COMP360 Compiler Code Generation COMP360 Students who acquire large debts putting themselves through school are unlikely to think about changing society. When you trap people in a system of debt, they can t afford

More information

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING PRINCIPLES OF COMPILER DESIGN 2 MARKS UNIT I INTRODUCTION TO COMPILING 1. Define compiler? A compiler is a program that reads a program written in one language (source language) and translates it into

More information

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

Language Processors Chapter 1. By: Bhargavi H Goswami Assistant Professor Sunshine Group of Institutes Rajkot, Gujarat, India Language Processors Chapter 1. By: Bhargavi H Goswami Assistant Professor Sunshine Group of Institutes Rajkot, Gujarat, India Is it ok if Analysis of Source Statement is followed by synthesis of equivalent

More information

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

Torben./Egidius Mogensen. Introduction. to Compiler Design. ^ Springer Torben./Egidius Mogensen Introduction to Compiler Design ^ Springer Contents 1 Lexical Analysis 1 1.1 Regular Expressions 2 1.1.1 Shorthands 4 1.1.2 Examples 5 1.2 Nondeterministic Finite Automata 6 1.3

More information