GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER-V (NEW) EXAMINATION - WINTER 2018
--- Content provided by FirstRanker.com ---
Subject Code:2150708 Date:20/11/2018Subject Name:System Programming
Time: 10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
--- Content provided by FirstRanker.com ---
2. Make suitable assumptions wherever necessary.3. Figures to the right indicate full marks.
MARKS
Q.1 (a) Remove left recursion from following grammar 03
A — Ac|Aad|bd|e
--- Content provided by FirstRanker.com ---
(b) Consider a grammar S — aa|aSa, How a top down backtracking 04
parser can generate six occurrences of a?
(c) Construct an LL(1) parsing table for the following grammar. 07
S — aBDh
B—cC
--- Content provided by FirstRanker.com ---
C—bC|eD — EF
E—gle
F—-fle
Q.2 (a) If the string a9b had been identified as identifier, but if in the 03
--- Content provided by FirstRanker.com ---
further use 9ab is written, which phase of compiler wouldidentify as an error? How?
(b) How a lexical analyzer recognizes unsigned numbers such as 04
12,12.3,12.3E4?
(c) Consider the assembly program-fragment 07
--- Content provided by FirstRanker.com ---
START 200READ A
LOOP MOVER AREG,A
SUB/AREG,=’1"
BC\GT,LOOP
--- Content provided by FirstRanker.com ---
STOPADS1
What will be the intermediate code for the above program
fragment? What does START directive do? What will be the
difference if ORIGIN directive is used in place of START?
--- Content provided by FirstRanker.com ---
OR
(c) Consider the assembly program fragment, 07
MOVER CREG, B
ADD CREG, ="1I”
BC ANY,NEXT
--- Content provided by FirstRanker.com ---
LTORG=5
=1
SUB AREG,=’1"
END
--- Content provided by FirstRanker.com ---
=7(i) Explain LTORG directive.
(ii) Explain AREG, CREG, OpCodes in above code fragment.
(iii) How table of literals will be manipulated?
Q.3 (a) Which type of gap makes the software buggy or unreliable? 03
--- Content provided by FirstRanker.com ---
Which methods can be used to overcome this situation?(b) How the use of programming language can help in making the 04
software reliable?
(c) Write Macro definition with following and explain. 07
(1) Macro using expansion time loop
--- Content provided by FirstRanker.com ---
(1) Macro with REPT statmentOR
Q.3 (a) Write Macro definition for adding two numbers that uses 03
positional and keyword parameters.
(b) Write a macro definition for adding two numbers 10 times. Use 04
--- Content provided by FirstRanker.com ---
nested macro call to increment numbers by 1 every time in 10iterations.
(c) Consider the following grammar for expressions 07
E—>EAE|(E)|-E|id
A — +|-|*|/| " where " represents exponent. Generate operator
--- Content provided by FirstRanker.com ---
precedence relation matrix and show how id * id ~ id will beparsed?
Q.4 (a) Justify “Postfix string is a popular intermediate code in non 03
optimizing compilers”
(b) Which are the methods used for identifying free memory area? 04
--- Content provided by FirstRanker.com ---
(c) Define program relocation. How address is corrected in address 07
sensitive instructions in case of program relocation.
OR
Q.4 (a) A program computes i*5 for 10 times.,-What type of optimization 03
can be applied?
--- Content provided by FirstRanker.com ---
(b) What is the structure of LEX program? 04
(c) Explain common sub expression elimination using value 07
numbers.
Q.5 (a) What is ambiguity in grammatic specification? 03
(b) Describe the facilities-for dynamic debugging. 04
--- Content provided by FirstRanker.com ---
(c) Write a code fragment to find out whether number is odd or even. 07
Draw control flow graph. Perform control flow analysis.
OR
Q.5 (a) Describe three components of the interpreter. 03
(b) Define linking. How external reference is resolved in linking? 04
--- Content provided by FirstRanker.com ---
(c) What is memory binding? Explain dynamic memory allocation 07
using extended stack model.
--- Content provided by FirstRanker.com ---
This download link is referred from the post: GTU BE/B.Tech 2018 Winter Question Papers || Gujarat Technological University