Search results for compiler

38.4k
views
10 answers
75 votes
In a bottom-up evaluation of a syntax directed definition, inherited attributes canalways be evaluatedbe evaluated only if the definition is L-attributedbe evaluated only if the definition has synthesized attributesnever be evaluated
36.3k
views
4 answers
68 votes
Consider the basic block given below. a = b + c c = a + d d = b + c e = d - b a = e + b The minimum number of nodes and edges present in the DAG ... $ and $6$8$ and $10$9$ and $12$4$ and $4$
30.3k
views
3 answers
5 votes
S -> (L) | aL -> L . S | SQuestion: Make necessary changes to make it suitable for LL(1) parsing and Construct FIRST and FOLLOW sets.
36.9k
views
9 answers
102 votes
For a C program accessing $\mathbf{X[i] [j] [k]}$, the following intermediate code is generated by a compiler. Assume that the size of an integer is $32$ bits and the size ... .$\mathbf{X}$ is declared as "char $\mathbf{X[32] [16] [2]}$ .
28.2k
views
12 answers
69 votes
Consider the following code segment.x = u - t; y = x * v; x = y + w; y = t - z; y = x * y;The minimum number of total variables required to convert the above code segment to static single assignment form is __________.
45.1k
views
1 answers
5 votes
For the SDD(SYNTAX-DIRECTED DEFINITIONS ) of Fig. $5.1$, give annotated parse trees for the following expressions:$(3+4)\ast(5+6)n.$1\ast2\ast3\ast(4+5)n.$(9+8\ast(7+6)+5)\ast 4n.$
29.1k
views
5 answers
36 votes
The following code segment is executed on a processor which allows only register operands in its instructions. Each instruction can have atmost two source operands and ... is the minimum number of spills to memory in the compiled code?0123
16.1k
views
4 answers
25 votes
Consider the following statements regarding the front-end and back-end of a compiler.S1: The front-end includes phases that are independent of the target hardware.S2: The back-end ... TRUE.Only $\mathbf{S 1}$ and $\mathbf{S 3}$ are TRUE.
22.4k
views
9 answers
81 votes
Consider line number $3$ of the following C-program.int main() { /*Line 1 */ int I, N; /*Line 2 */ fro (I=0, I<N ... creating the object-module:No compilation errorOnly a lexical errorOnly syntactic errorsBoth lexical and syntactic errors
36.5k
views
8 answers
75 votes
Consider the following two statements:P: Every regular grammar is LL(1)Q: Every regular set has a LR(1) grammarWhich of the following is TRUE?Both P and Q are trueP is true and Q is falseP is false and Q is trueBoth P and Q are false
20.9k
views
11 answers
57 votes
Consider the following grammar:stmt $\rightarrow$ if expr then expr else expr; stmt | $Ò$expr $\rightarrow$ term relop term | termterm $\rightarrow$ id | numberid ... $2$ control flow paths. $e_1 \rightarrow e_2$ and $e_1 \rightarrow e_3$.
31.9k
views
2 answers
2 votes
Write Quadruples,Triples, and indirect Triples for the expression : (a+b) * (c+d) - (a+b+c)
97.2k
views
2 answers
4 votes
Pankaj and Mythili were both asked to write the code to evaluate the following expression: $a - b + c/(a-b) + (a-b)^2 $Pankaj writes the following code ... memory and is faster than Code B Code A uses more memory and is slower than Code B
19.6k
views
3 answers
56 votes
Consider the expression $(a-1) * (((b+c)/3)+d)$. Let $X$ be the minimum number of registers required by an optimal code generation (without any register ... only register or immediate operands. The value of $X$ is _____________ .
26.7k
views
7 answers
41 votes
Consider the intermediate code given below.(1) i=1 (2) j=1 (3) t1 = 5 * i (4) t2 = t1 + j (5) t3 = 4 * t2 (6) t4 = t3 (7) a[t4] = -1 (8) j ... $ and $7$6$ and $7$5$ and $5$7$ and $8$
20.4k
views
2 answers
47 votes
Generation of intermediate code based on an abstract machine model is useful in compilers becauseit makes implementation of lexical analysis and syntax analysis ... generate code for real machines directly from high level language programs
29.8k
views
7 answers
80 votes
The least number of temporary variables required to create a three-address code in static single assignment form for the expression $q + r / 3 + s - t * 5 + u * v/w$ is__________________.
35.8k
views
13 answers
83 votes
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and unit-production (i.e., of type $A \rightarrow \epsilon$ ... $) to parse a string with $n$ tokens?$n/2$n-1$2n-1$2^{n}$
29.2k
views
4 answers
64 votes
Consider the following statements about the context free grammar ... statements about $G$?I onlyI and III onlyII and III onlyI, II and III
12.9k
views
4 answers
12 votes
Consider the control flow graph shown.Which one of the following choices correctly lists the set of live variables at the exit point of each basic block? ...