+ All Categories
Home > Documents > GUJARAT TECHNOLOGICAL UNIVERSITYDescribe the output of Lexical analysis. 5 Difference between...

GUJARAT TECHNOLOGICAL UNIVERSITYDescribe the output of Lexical analysis. 5 Difference between...

Date post: 12-Mar-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
10
1 Seat No.: ________ Enrolment No.___________ GUJARAT TECHNOLOGICAL UNIVERSITY BE SEMESTER (SYLLABUS) EXAMINATION- WINTER 2017 Subject Code: 2150708 Date: 13/11/2017 Subject Name: System Programing Time: 10.30AM to 01.00PM Total Marks: 70 Instructions: 1. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. MARKS Q.1* (a) Explain different kinds of system software. 03 (b) Define the following terms: 1)Backpatching 2)Simple phrase grammar 3)Left recursion 4)Top- down parsing 04 (c) Which activity reduce specification gap? Explain with suitable example. Who will reduce execution gap? 07 Q.2 (a) Draw a flowchart of maintaining Table of Incomplete Instruction (TII) in assembler. 03 (b) Construct a deterministic finite automata for (0|1)*011 04 (c) Write algorithm for practical approach of top down parsing. 07 OR (c) Construct predictive parsing table for following grammar: E->BA A-> &BA|€ B->true|false 07 Q.3 (a) Explain the data structure of single pass assembler. 03 (b) Explain the use of intermediate code with example in assembler and also mention field of it. 04 (c) Construct an operator precedence matrix for the operators of a grammar for expressions containing arithmetic, relational and Boolean operator. 07 OR Q.3 (a) Explain the difference between literal and constant in assembler with its syntax. Why POOLTAB is requiring? 03 (b) Which data structure is used for automatic dynamic allocation and memory access? Explain with suitable example. 04 (c) Give suitable example for nested macro call with its data structure. 07 Q.4 (a) Explain use of value number in local optimization. 03 (b) Give suitable example for macro by using conditional expansion or expansion time loops. 04 (c) Explain Self relocating program and overlay structure program. 07 OR Q.4 (a) Explain pure and impure interpreter. 03 (b) Explain the front end of toy compiler with suitable example. 04 (c) Draw the expression tree for the string f+(x+y)*((a+b)/(c-d)) by their evaluation order and mention register required label in each node. 07
Transcript

1

Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY BE – SEMESTER (SYLLABUS) EXAMINATION- WINTER 2017

Subject Code: 2150708 Date: 13/11/2017

Subject Name: System Programing

Time: 10.30AM to 01.00PM Total Marks: 70 Instructions:

1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.

MARKS

Q.1* (a) Explain different kinds of system software. 03

(b) Define the following terms:

1)Backpatching 2)Simple phrase grammar 3)Left recursion 4)Top-

down parsing

04

(c) Which activity reduce specification gap? Explain with suitable example.

Who will reduce execution gap? 07

Q.2 (a) Draw a flowchart of maintaining Table of Incomplete Instruction (TII) in

assembler. 03

(b) Construct a deterministic finite automata for (0|1)*011 04

(c) Write algorithm for practical approach of top down parsing. 07

OR

(c) Construct predictive parsing table for following grammar:

E->BA

A-> &BA|€

B->true|false

07

Q.3 (a) Explain the data structure of single pass assembler. 03

(b) Explain the use of intermediate code with example in assembler and

also mention field of it. 04

(c) Construct an operator precedence matrix for the operators of a grammar

for expressions containing arithmetic, relational and Boolean operator. 07

OR

Q.3 (a) Explain the difference between literal and constant in assembler with its

syntax. Why POOLTAB is requiring? 03

(b) Which data structure is used for automatic dynamic allocation and

memory access? Explain with suitable example. 04

(c) Give suitable example for nested macro call with its data structure. 07

Q.4 (a) Explain use of value number in local optimization. 03

(b) Give suitable example for macro by using conditional expansion or

expansion time loops. 04

(c) Explain Self relocating program and overlay structure program. 07 OR

Q.4 (a) Explain pure and impure interpreter. 03

(b) Explain the front end of toy compiler with suitable example. 04

(c)

Draw the expression tree for the string f+(x+y)*((a+b)/(c-d)) by their

evaluation order and mention register required label in each node.

07

2

Q.5 (a) Explain working of triple, quadruples and indirect triples with example. 03

(b) Explain attributes of formal parameter and expansion time variable in

macro. 04

(c) Define the following terms

1) Translation time address: 2) Linked time address 3) Load time

address: 4) Translated origin: 5) Linked origin: 6) Load origin: 7)

Interpreter

07

OR

Q.5 (a) Explain operand descriptor and register descriptor for a*b. 03

(b) Explain absolute loader in detail. 04

(c) Explain Naïve Bottom up parsing algorithm with example and also

mention which problem occurs during parsing.

07

*************

1

1

Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER–V (NEW) - EXAMINATION – SUMMER 2017

Subject Code: 2150708 Date: 03/05/2017 Subject Name: System Programming Time: 02:30 PM to 05:00 PM Total Marks: 70 Instructions:

1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.

MARKS

Q.1 Short Questions 14

1 Define : Language Processor.

2 _________ phase performs type checking task.

[ a] Lexical Analysis [b] Syntax Analysis [c] Semantic Analysis

3 Define : Parse tree.

4 State True/False : Code optimization phase is optional phase of compiler.

5 Which phase of compiler will generate error if semicolon is missing in a c

program?

6 Define : intermediate code.

7 Define : Pattern.

8 State True/False : Top Down parsers can never work with left recursive

grammar.

9 Define: symbol Table.

10 Define: Semantic Gap.

11 Define : Backpatching.

12 State True/False : “Single pass assemblers cannot handle forward

references.”

13 Define : Macro Assembler.

14 State True/False : Symbol table is used to store mnemonics and opcodes.

Q.2 (a) Eliminate left recursion from following grammar.

S A

A Ad | Ae | aB | aC

B bBC | f

C g

03

(b) Construct LL(1) parsing table for following grammar.

S iCtSeS | iCtS | a

C b

04

(c) Construct an optimized DFA :

0*1*(0/1)#

07

OR

2

2

(c) Show that following regular expressions are equivalent by constructing

optimized DFA.

(0/1)*

(0*/1*)*

07

Q.3 (a) What is Peephole optimization? Explain any two optimization

transformations in detail. 03

(b) Define and explain different intermediate code representations. 04

(c) What is main task of semantic analysis phase? Explain inherited and

synthesized attributes in detail with example. 07

OR

Q.3 (a) Define: L-Attributed definition in detail. 03

(b) State different storage allocation strategies. Explain static allocation and

stack allocation in detail. 04

(c) Generate Quadruple, Triple, Indirect Triple for following expression:

ans=a+b*c/2.0

07

Q.4 (a) What is program relocation? How relocation is performed by linker? 03

(b) Write and explain the algorithm for macro expansion. 04

(c) Explain in brief design of a Two Pass Assembler. 07

OR

Q.4 (a) What is overlay? Explain the execution of an overlay structure program. 03

(b) Explain in brief self relocating programs. 04

(c) Explain in detail any two advanced assembler directives. 07

Q.5 (a) Explain Types of grammar in detail. 03

(b) Compare and Contrast macro preprocessor and macro assembler. 04

(c) Explain in brief design the linker. 07

OR

Q.5 (a) Define: Ambiguous grammar. Also state example of same. 03 (b) Explain and compare two variants of intermediate code. 04 (c) Explain in brief the design of a macro assembler. 07

*************

1

Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER–V(New) • EXAMINATION – WINTER 2016

Subject Code:2150708 Date:22/11/2016

Subject Name:System Programming

Time: 10:30 AM to 01:00 PM Total Marks: 70 Instructions:

1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.

MARKS

Q.1 Short Questions 14

1 A __________ is a language processor which bridges an execution gap but

is not a language translator

e

ee

e ree

exx ex execution

2 Justify (True/False): A language migrator provides portability of program.

3 Difference between Procedure oriented language and Problem oriented

language.

4 Describe the output of Lexical analysis.

5 Difference between Literal and Constant.

6 Describe the syntax of keyword parameter and the use of it.

7 What is the use of backpatching?

8 Which of system software always reside in main memory? What kind of

input this system software takes?

9 Define Handle, Grammar

10 How to avoid backtracking in top down parsing?

11 Justify (True/False): A positional parameter can have a default value.

12 Give name of data structures used in compiler

13 What is the use of POOLTAB in assembler?

14 What is JIT?

Q.2 (a) What are the basic tasks that must be performed by macro preprocessor? 03

(b) List out different forms of editor and explain each of them. 04

(c) Explain Left recursion, Left factoring and backtracking in top down parsing. 07

OR

(c) Develop an LL(1) parser table for the following grammer and

Parse the string using the parsing table : (id*id) + (id*id)

E->TA A->+TA| € T->VB B->*VB|€ V->id|(E)

07

Q.3 (a) Explain Absolute loader. 03

(b) Develop regular expression and DFAs for the following kind of strings:

1. a real number with optional integer and fraction part

2. a comment string in the C++ language.

04

(c) Write operator precedence table for arithmetic operators “+”, “*”, “-”, “/” ”(“,

“)”. Parse following expression using the table. id * (id + id )/ (id *id) 07

OR

Q.3 (a) How compiler implements scope rules? 03

(b) An assembly program contains the statement

X EQU Y + 25

Indicate how the EQU statement can processed if

(1) Y is a back reference

(2) Y is a forward reference

04

2

(c) Write the data structure, intermediate code of following assembly

program. Write the assembly program output if value of N = 5.

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, RESULT PRINT RESULT

STOP N DS 1

RESULT DS 1 ONE DC ‘1’

TERM DS 1 END

07

Q.4 (a) Explain attributes of formal parameters in macro with syntax. 03

(b) Explain Object Module of a Program Unit P in Linker. 04

(c) Describe the use of stacks in Expansion of Nested macro calls with example. 07 OR

Q.4 (a) Explain Boostrap loader. 03

(b) What is Overlay? Explain the execution of an overlay structured program. 04

(c) Explain in detail how the following input gets processed in toy compiler.

int a;

real b,c;

c= a + b * 0.6;

07

Q.5 (a) Describe the level of System Software. 03

(b) Describe the use of REPT and IRP statement. 04

(c) Explain types of intermediate code representation of expression during

compilation in detail.

07

OR

Q.5 (a) What is pure and impure interpreter? 03

(b) Explain design of an editor. 04

(c) What is the use of static pointer and dynamic pointer in compiler? Explain

working of Display with suitable example. 07

*************

1

Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER–V (NEW) - EXAMINATION – SUMMER 2016

Subject Code:2150708 Date:11/05/2016 Subject Name:System Programming Time:02:30 PM to 05:00 PM Total Marks: 70 Instructions:

1. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks.

Q.1 (a) Compare user-centric view and system-centric view of system software. 07

(b) What is Symbol table? Explain how one can organize Symbol table using

Linear Data Structure?

07

Q.2 (a) What are the Advanced Assembler Directives? Explain any two with example. 07

(b) List various phases of Language Processor. Explain any one phase in detail. 07

OR

(b) 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.

07

Q.3 (a) Explain use and field of following tables of macro.

KPDTAB, MDT, EVTAB, SSTAB

07

(b) Explain following facilities for expansion time loop with example.

(1) REPT statement (2) IRP statement

07

OR

Q.3 (a) Explain following terms with suitable example.

(1) Expansion time variable (3) Semantic expansion

(2) Positional parameter (4) Macro Pre-processor

07

(b) Draw a flowchart and explain simple one pass macro processor. 07

Q.4 (a) With example explain how relocation is performed by linker? 07

2

(b) Explain Absolute loader with example. 07

OR

Q.4 (a) What is overlay? Explain linking of overlay structured program. 07

(b) In brief explain relocating loader. 07

Q.5 (a) (1) Explain types of grammar. 03

(2) Explain lexical analysis of language processor. 04

(b) 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.

07

OR

Q.5 (a) Explain recursive descendent parsing algorithm. 07

(b) What is interpreter? Explain pure & impure interpreters. 07

*************

1

Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY BE – SEMESTER – V (NEW) EXAMINATION – WINTER 2015

Subject Code: 2150708 Date:10/12/ 2015

Subject Name: System Programming

Time: 10:30am to 1:00pm Total Marks: 70 Instructions:

1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.

Q.1 (a) (i) Compare Problem oriented and Procedure oriented languages.

(ii) Define Following terms:

1. System Software

2. Semantic Gap

3. Specification Gap

4. Execution Gap

07

(b) (i) Explain types of grammars.

(ii) Write a regular expression for a language containing a binary string which

does not contain two consecutive 0s or two consecutive 1s anywhere.

07

Q.2 (a) Explain the various stages of the life cycle of a source program with a neat

diagram.

07

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

Instruction opcode: STOP – 00, ADD – 01, MULT – 03, MOVER – 04,

MOVEM – 05, COMP – 06, BC – 07, READ – 09, PRINT – 10, LE – 02

Assembler directives: START – 01, END – 02

Declaration statements: DC – 01, DS – 02

Register code: BREG – 02, CREG – 03

07

OR

(b) Explain language processing activities. 07

2

Q.3 (a) Construct NFA and DFA for following regular expression:

(0 | 1)*001#

07

(b) What is program relocation? How relocation is performed by linker? Explain

with example.

07

OR

Q.3 (a) Explain recursive descent parsing algorithm. 07

(b) List various phases of a language processor. Explain roles of phases of

Language Processor. Also explain symbol table.

07

Q.4 (a) Define forward references. How it can be solved using back-patching? Explain

with example.

07

(b) Explain Absolute Loader with example. 07

OR

Q.4 (a) Explain advanced assembler directives with suitable example. 07

(b) What is macro preprocessor? Explain steps of macro preprocessor design. 07

Q.5 (a) List out and explain various optimizing transformations of a compiler by giving

suitable examples.

07

(b) What is interpreter? Explain benefits of interpreter. Compare interpreter and

compiler.

07

OR

Q.5 (a) Define two macros of your choice to illustrate nested calls to these macros. Also

show their corresponding expansion.

07

(b) What are advanced macro programming facilities? Explain with example. 07

*************


Recommended