search
Log In

Recent questions tagged compiler-design

0 votes
1 answer
1
0 votes
4 answers
2
Consider the following statements related to compiler construction: Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. Syntax Analysis is specified by regular expressions and implemented by finite-state machine. Which of the above statement(s) is/are correct? Only I Only II Both I and II Neither I nor II
asked Mar 24 in Compiler Design jothee 174 views
0 votes
3 answers
3
Which of the following statement(s) regarding a linker software is/are true ? A function of a linker is to combine several object modules into a single load module. A function of a linker is to replace absolute references in an object module by symbolic references to locations in other modules. Only I Only II Both I and II Neither I nor II
asked Mar 24 in Compiler Design jothee 66 views
10 votes
4 answers
4
Consider the following statements. Symbol table is accessed only during lexical analysis and syntax analysis. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment. Errors violating the condition any variable must be ... of the above statements is/are TRUE? I only I and III only Ⅱ only None of Ⅰ, Ⅱ and Ⅲ
asked Feb 12 in Compiler Design Arjun 2k views
7 votes
3 answers
5
Consider the following grammar. $S \rightarrow aSB \mid d$ $B \rightarrow b$ The number of reduction steps taken by a bottom-up parser while accepting the string $aaadbbb$ is___________.
asked Feb 12 in Compiler Design Arjun 1.8k views
4 votes
3 answers
6
Consider the productions $A \rightarrow PQ$ and $A \rightarrow XY$. Each of the five non-terminals $A, P, Q, X$, and $Y$ has two attributes: $s$ is a synthesized attribute, and $i$ is an inherited attribute. Consider the following rules. Rule $1$ ... $1$ is $L$-attributed. Only Rule $2$ is $L$-attributed. Neither Rule $1$ nor Rule $2$ is $L$-attributed.
asked Feb 12 in Compiler Design Arjun 1.2k views
2 votes
3 answers
7
Which one indicates a technique of building cross compilers? Beta cross Canadian cross Mexican cross X-cross
asked Jan 13 in Compiler Design Satbir 437 views
1 vote
3 answers
8
A given grammar is called ambiguous if two or more productions have the same non-terminal on the left hand side a derivation tree has more than one associated sentence there is a sentence with more than one derivation tree corresponding to it brackets are not present in the grammar
asked Jan 13 in Compiler Design Satbir 811 views
2 votes
1 answer
9
Which of the following is a type of a out-of-order execution, with the reordering done by a compiler loop unrolling dead code elimination strength reduction software pipelining
asked Jan 13 in Compiler Design Satbir 419 views
2 votes
4 answers
10
In a two-pass assembler, resolution of subroutine calls and inclusion of labels in the symbol table is done during second pass first pass and second pass respectively second pass and first pass respectively first pass
asked Jan 13 in Compiler Design Satbir 477 views
1 vote
1 answer
11
The number of tokens in the following C code segment is switch(inputvalue) { case 1 : b =c*d; break; default : b =b++; break; } $27$ $29$ $26$ $24$
asked Jan 13 in Compiler Design Satbir 344 views
2 votes
2 answers
12
Given the grammar $s \rightarrow T ^{\ast} S\ \mid T$ $T \rightarrow U+T\ \mid U$ $U \rightarrow a \mid b$ Which of the following statements is wrong? Grammar is not ambiguous Priority of $+$ over $^{\ast}$ is ensured Right to left evaluation of $^{\ast}$ and $+$ happens None of these
asked Jan 13 in Compiler Design Satbir 315 views
1 vote
2 answers
13
A grammar is defined as $A \rightarrow BC$ $B \rightarrow x \mid Bx$ $C \rightarrow B \mid D$ $D \rightarrow y \mid Ey$ $E \rightarrow z$ The non terminal alphabet of the grammar is $\{A,B,C,D,E\}$ $\{B,C,D,E\}$ $\{A,B,C,D,E,x,y,z\}$ $\{x,y,z\}$
asked Jan 13 in Compiler Design Satbir 284 views
1 vote
0 answers
14
As in Ada, suppose that each expression must have a unique type, but that from a subexpression, by itself, all we can deduce is a set of possible types. That is, the application of function $E_{1}$ to argument $E_{2}$ ... and, once the unique type of the overall expression is determined, proceeds top-down to determine attribute $unique$ for the type of each subexpression.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 204 views
0 votes
0 answers
15
Assuming that function $widen$ in Fig. $6.26$ can handle any of the types in the hierarchy of Fig. $6.25(a)$, translate the expressions below. Assume that c and d are characters, $s$ and $t$ are short integers, $i$ and $j$ are integers, and $x$ is a float. $x=s+c$ $i=s+c$ $x=(s+c)\ast(t+d)$
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 100 views
0 votes
0 answers
16
$A$ real array $A[i, j, k]$ has index $i$ ranging from $1$ to $4$, index $j$ ranging from $0$ to $4$, and index $k$ ranging from $5$ to $10$. Reals take $8$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[3,4,5]$ $A[1,2,7]$ $A[4,3,9]$ if $A$ is stored in column-major order.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 96 views
0 votes
1 answer
17
$A$ real array $A[i, j, k]$ has index $i$ ranging from $1$ to $4$, index $j$ ranging from $0$ to $4$, and index $k$ ranging from $5$ to $10$. Reals take $8$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[3,4,5]$ $A[1,2,7]$ $A[4,3,9]$
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 102 views
0 votes
0 answers
18
An integer array $A[i, j]$ has index $i$ ranging from $1$ to $10$ and index $j$ ranging from $1$ to $20$. Integers take $4$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[4,5]$ $A[10,8]$ $A[3,17]$ if A is stored in column-major order.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 362 views
0 votes
0 answers
19
An integer array $A[i, j]$ has index $i$ ranging from $1$ to $10$ and index $j$ ranging from $1$ to $20$. Integers take $4$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[4,5]$ $A[10,8]$ $A[3,17]$
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 101 views
0 votes
0 answers
20
Generalize formula $(6.7)$ to multidimensional arrays, and indicate what values can be stored in the symbol table and used to compute offsets. Consider the following cases: An array $A$ of two dimensions, in row-major form. The first dimension has indexes running from $l_{1}$ ... has indexes running from $l_{j}$ to $h_{j}$.The same as $(c)$ but with the array stored in column-major form.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 45 views
0 votes
0 answers
25
Extend the handling of field names in Fig. $6.18$ to classes and single-inheritance class hierarchies. Give an implementation of class $Enu$ that allows linked symbol tables, so that a subclass can either redefine a field name or refer directly to a ... in a class, including inherited fields. Inherited fields must maintain the relative addresses they were assigned in the layout for the superclass.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 40 views
0 votes
0 answers
26
1 vote
1 answer
28
0 votes
0 answers
30
...