Monday, 9 January 2017

bca5041 smu bca fall 2016 (jan/feb 2017 exam) Vth sem assignment

Get fully solved assignment. Buy online from website
online store
or
plz drop a mail with your sub code
we will revert you within 2-3 hour or immediate
Charges rs 125/subject
if urgent then call us on 08791490301, 08273413412

DRIVE
FALL 2016
PROGRAM
BACHELOR OF COMPUTER APPLICATION
SEMESTER
5
SUBJECT CODE & NAME
BCA 5041 - COMPILER DESIGN

1 Explain various tasks performed by a compiler.

Answer: Compilers are an essential part of a computer programmer's toolkit. A compiler turns a plain text file containing code into a program that can be run.

A common misconception is that computers understand code. This is not true. Computers only


2 What is finite automata? What is deterministic and nondeterministic finite automata?

Answer: A finite automaton (FA) is a simple idealized machine used to recognize patterns within input taken from some character set (or alphabet) C. The job of an FA is to accept or reject an input depending on whether the pattern defined by the FA occurs in the input. A finite automaton consists of: a finite

3 What do you mean by context free grammar? Explain with an example.

Answer: A context-free grammar basically consists of a finite set of grammar rules. In order to define grammar rules, we assume that we have two kinds of symbols: the terminals, which are thesymbols of the alphabet underlying the languages under consideration, and the nonterminals, which behave like variables ranging over strings of terminals. A rule is of the form A → α, where A is a single nonterminal, and the


4 Explain Storage Allocation Strategies based on the division of run time storage with their limitations.

Answer: Different ways to allocate objects
Static allocation – allocates storage at compile time
Stack allocation - manages run time storage as stack
Heap

5 Explain how Direct Acyclic Graph (DAG) is represented for Basic Blocks with example.

Answer: Acyclic graph is defined as a graph with no path and starts and ends at the same vertex. An acyclic undirected graphic is like a tree. Directed Acyclic graph (DAG) is a directed graph with no path that startsand



6Explain the following optimization techniques
a) Loop invariant code motion
b) Partial redundancy elimination

Answer: a) Loop invariant code motion
Loop-Invariant code motion is one interesting form of partial redundancyelimination (PRE) whose purpose it is to find code in a loop body that producesthe same value in every iteration of the loop. An expression is loopinvariant if its value does not change while running the loop. This code canbe moved out of the loop so that it is not computed over and over again,which would be a waste of

Get fully solved assignment. Buy online from website
online store
or
plz drop a mail with your sub code
we will revert you within 2-3 hour or immediate
Charges rs 125/subject
if urgent then call us on 08791490301, 08273413412
s


No comments:

Post a Comment