Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Compiler Design:
Recent questions tagged compiler-design
0
votes
1
answer
1861
Unification Algorithm
Sir, Can you provide an example of Unification Algorithm . ?
Sir, Can you provide an example of Unification Algorithm . ?
spriti1991
1.4k
views
spriti1991
asked
Apr 1, 2015
Compiler Design
compiler-design
unification-algorithm
non-gate
+
–
0
votes
1
answer
1862
Who create entries in Symbol Tables ?
Who create entries in Symbol Table ? 1. Lexical 2 . Synatx 3 both 4 Either 1 or 2
Who create entries in Symbol Table ?1. Lexical2 . Synatx3 both4 Either 1 or 2
spriti1991
1.2k
views
spriti1991
asked
Mar 24, 2015
Compiler Design
compiler-design
lexical-analysis
+
–
1
votes
3
answers
1863
Consider the SDT , where S ->TR, R-> +TR|empty {print ("+")} , And T-> num {print(num)} And if the input is given "9+5+2" What is output ?
Consider the SDT , where S ->TR, R- +TR|empty {print ("+")} , And T- num {print(num)} And if the input is given "9+5+2" What is output ?
spriti1991
2.4k
views
spriti1991
asked
Mar 18, 2015
Compiler Design
compiler-design
syntax-directed-translation
+
–
45
votes
5
answers
1864
GATE CSE 2015 Set 3 | Question: 31
Consider the following grammar G $S \rightarrow F \mid H$ $F \rightarrow p \mid c$ $H \rightarrow d \mid c$ Where $S$, $F$, and $H$ are non-terminal symbols, $p, d$, and $c$ are terminal symbols. Which of the following statement(s) ... grammar G S2: LR(1) can parse all strings that are generated using grammar G Only S1 Only S2 Both S1 and S2 Neither S1 and S2
Consider the following grammar G$S \rightarrow F \mid H$$F \rightarrow p \mid c$$H \rightarrow d \mid c$ Where $S$, $F$, and $H$ are non-terminal symbols, $p, d$, and $c...
go_editor
15.2k
views
go_editor
asked
Feb 15, 2015
Compiler Design
gatecse-2015-set3
compiler-design
parsing
normal
+
–
29
votes
2
answers
1865
GATE CSE 2015 Set 3 | Question: 16
Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful, in that order? SLR, LALR Canonical LR, LALR SLR, canonical LR LALR, canonical LR
Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the ...
go_editor
8.5k
views
go_editor
asked
Feb 14, 2015
Compiler Design
gatecse-2015-set3
compiler-design
parsing
normal
+
–
80
votes
7
answers
1866
GATE CSE 2015 Set 1 | Question: 55
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__________________.
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_...
makhdoom ghaya
29.0k
views
makhdoom ghaya
asked
Feb 13, 2015
Compiler Design
gatecse-2015-set1
compiler-design
intermediate-code
normal
numerical-answers
static-single-assignment
+
–
57
votes
2
answers
1867
GATE CSE 2015 Set 1 | Question: 50
A variable $x$ is said to be live at a statement $s_{i}$ in a program if the following three conditions hold simultaneously: There exists a statement $S_{j}$ that uses $x$ There is a path from $S_{i}$ to $S_{j}$ in the flow graph corresponding to the program The path ... above control flow graph are $\text{p, s, u}$ $\text{r, s, u}$ $\text{r, u}$ $\text{q, v}$
A variable $x$ is said to be live at a statement $s_{i}$ in a program if the following three conditions hold simultaneously:There exists a statement $S_{j}$ that uses $x$...
makhdoom ghaya
26.1k
views
makhdoom ghaya
asked
Feb 13, 2015
Compiler Design
gatecse-2015-set1
compiler-design
live-variable-analysis
normal
+
–
53
votes
2
answers
1868
GATE CSE 2015 Set 1 | Question: 13
Which one of the following is TRUE at any valid state in shift-reduce parsing? Viable prefixes appear only at the bottom of the stack and not inside Viable prefixes appear only at the top of the stack and not inside The stack contains only a set of viable prefixes The stack never contains viable prefixes
Which one of the following is TRUE at any valid state in shift-reduce parsing?Viable prefixes appear only at the bottom of the stack and not insideViable prefixes appear ...
makhdoom ghaya
19.0k
views
makhdoom ghaya
asked
Feb 12, 2015
Compiler Design
gatecse-2015-set1
compiler-design
parsing
normal
viable-prefix
+
–
41
votes
7
answers
1869
GATE CSE 2015 Set 2 | Question: 29
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 = j + 1 (9) if j <= 5 goto (3) (10) i = i +1 (11) if i < 5 goto (2) The number of nodes and edges in control-flow-graph constructed for the above code, respectively, are $5$ and $7$ $6$ and $7$ $5$ and $5$ $7$ and $8$
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 = j + 1 (9) if j <= 5 goto (3) ...
go_editor
25.8k
views
go_editor
asked
Feb 12, 2015
Compiler Design
gatecse-2015-set2
compiler-design
intermediate-code
normal
+
–
34
votes
3
answers
1870
GATE CSE 2015 Set 2 | Question: 19
Match the following: ... $\text{P-2, Q-4, R-1, S-3}$ $\text{P-2, Q-3, R-4, S-1}$
Match the following:$$\begin{array}{ll|ll}\hline \text{P.} & \text{Lexical analysis} & \text{1.} & \text{Graph coloring} \\\hline \text{Q.} & \text{Parsing} & \text{2.}&...
go_editor
7.0k
views
go_editor
asked
Feb 12, 2015
Compiler Design
gatecse-2015-set2
compiler-design
normal
compilation-phases
match-the-following
+
–
54
votes
4
answers
1871
GATE CSE 2015 Set 1 | Question: 8
For computer based on three-address instruction formats, each address field can be used to specify which of the following: (S1) A memory operand (S2) A processor register (S3) An implied accumulator register Either $S1$ or $S2$ Either $S2$ or $S3$ Only $S2$ and $S3$ All of $S1$, $S2$ and $S3$
For computer based on three-address instruction formats, each address field can be used to specify which of the following:(S1) A memory operand(S2) A processor register(S...
makhdoom ghaya
18.9k
views
makhdoom ghaya
asked
Feb 12, 2015
Compiler Design
gatecse-2015-set1
compiler-design
intermediate-code
normal
+
–
44
votes
1
answer
1872
GATE CSE 2015 Set 2 | Question: 14
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE? In both AST and CFG, let node $N_2$ be the successor of node $N_1$. In the input program, the code corresponding to $N_2$ ... an AST and a CFG depends on the input program Each node in AST and CFG corresponds to at most one statement in the input program
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE? In both AST and CFG, let node $N_2$ be the successor of nod...
go_editor
13.1k
views
go_editor
asked
Feb 12, 2015
Compiler Design
gatecse-2015-set2
compiler-design
easy
abstract-syntax-tree
+
–
1
votes
1
answer
1873
The identification of common sub-expression and replacement of run-time computations by compile-time computations is ?
Vikrant Singh
4.3k
views
Vikrant Singh
asked
Feb 1, 2015
Compiler Design
compiler-design
code-optimization
test-series
+
–
3
votes
0
answers
1874
Which of the following is true?
Vikrant Singh
355
views
Vikrant Singh
asked
Feb 1, 2015
Compiler Design
compiler-design
+
–
1
votes
1
answer
1875
according to me answer should be 3. give correct explanation.
sumit_62
353
views
sumit_62
asked
Dec 21, 2014
Compiler Design
compiler-design
context-free-grammar
numerical-answers
test-series
+
–
2
votes
1
answer
1876
LR(K) grammer can be ambigious or not?
ansaritk
902
views
ansaritk
asked
Dec 17, 2014
Compiler Design
compiler-design
parsing
lr-parser
ambiguous
+
–
49
votes
4
answers
1877
GATE CSE 2004 | Question: 10
Consider the grammar rule $E \rightarrow E1 - E2$ for arithmetic expressions. The code generated is targeted to a CPU having a single user register. The subtraction operation requires the first operand to be in the register. If $E1$ and $E2$ do ... Evaluation of $E1$ and $E2$ should necessarily be interleaved Order of evaluation of $E1$ and $E2$ is of no consequence
Consider the grammar rule $E \rightarrow E1 – E2$ for arithmetic expressions. The code generated is targeted to a CPU having a single user register. The subtraction...
Vikrant Singh
13.6k
views
Vikrant Singh
asked
Nov 12, 2014
Compiler Design
gatecse-2004
compiler-design
target-code-generation
normal
+
–
80
votes
9
answers
1878
GATE CSE 2005 | Question: 61
Consider line number $3$ of the following C-program. int main() { /*Line 1 */ int I, N; /*Line 2 */ fro (I=0, I<N, I++); /*Line 3 */ } Identify the compiler’s response about this line while creating the object-module: No compilation error Only a lexical error Only syntactic errors Both lexical and syntactic errors
Consider line number $3$ of the following C-program.int main() { /*Line 1 */ int I, N; /*Line 2 */ fro (I=0, I<N, I++); /*Line 3 */ }Identify the compiler’s response ab...
Vikrant Singh
21.6k
views
Vikrant Singh
asked
Nov 12, 2014
Compiler Design
gatecse-2005
compiler-design
compilation-phases
normal
+
–
37
votes
4
answers
1879
GATE IT 2005 | Question: 83b
Consider the context-free grammar $E\rightarrow E+E$ $E\rightarrow (E *E)$ $E\rightarrow \text{id}$ where $E$ is the starting symbol, the set of terminals is $\{id, (,+,),*\}$, and the set of non-terminals is $\{E\}$. For the terminal string $id + id + id + id$, how many parse trees are possible? $5$ $4$ $3$ $2$
Consider the context-free grammar$E\rightarrow E+E$$E\rightarrow (E *E)$$E\rightarrow \text{id}$where $E$ is the starting symbol, the set of terminals is $\{id, (,+,),*\}...
Ishrat Jahan
6.9k
views
Ishrat Jahan
asked
Nov 3, 2014
Compiler Design
gateit-2005
compiler-design
parsing
normal
+
–
36
votes
2
answers
1880
GATE IT 2005 | Question: 83a
Consider the context-free grammar $E \rightarrow E + E$ $E \rightarrow (E * E)$ $E \rightarrow id$ where $E$ is the starting symbol, the set of terminals is $\{id, (,+,),*\}$, and the set of nonterminals is $\{E\}$. Which of the following terminal strings has more than one parse tree ... $id + (id* (id * id))$ $(id* (id * id)) + id$ $((id * id + id) * id)$
Consider the context-free grammar$E \rightarrow E + E$$E \rightarrow (E * E)$$E \rightarrow id$where $E$ is the starting symbol, the set of terminals is $\{id, (,+,),*\...
Ishrat Jahan
6.5k
views
Ishrat Jahan
asked
Nov 3, 2014
Compiler Design
gateit-2005
compiler-design
grammar
parsing
easy
+
–
25
votes
1
answer
1881
GATE IT 2007 | Question: 33
Consider the program below in a hypothetical language which allows global variable and a choice of call by reference or call by value methods of parameter passing. int i ; program main () { int j = 60; i = 50; call f (i, j); print i, j; } procedure f (x, y) { i = 100; x ... :$ i = 100, j = 60$ Call by value : $i = 100, j = 60$; Call by reference :$ i = 10, j = 70$
Consider the program below in a hypothetical language which allows global variable and a choice of call by reference or call by value methods of parameter passing. ...
Ishrat Jahan
8.5k
views
Ishrat Jahan
asked
Oct 29, 2014
Compiler Design
gateit-2007
programming
parameter-passing
normal
compiler-design
runtime-environment
+
–
33
votes
3
answers
1882
GATE IT 2007 | Question: 9
Consider an ambiguous grammar $G$ and its disambiguated version $D.$ Let the language recognized by the two grammars be denoted by $L(G)$ and $L(D)$ respectively. Which one of the following is true? $L (D) ⊂ L (G)$ $L (D) ⊃ L (G)$ $L (D) = L (G)$ $L (D)$ is empty
Consider an ambiguous grammar $G$ and its disambiguated version $D.$ Let the language recognized by the two grammars be denoted by $L(G)$ and $L(D)$ respectively. Which o...
Ishrat Jahan
6.6k
views
Ishrat Jahan
asked
Oct 29, 2014
Compiler Design
gateit-2007
compiler-design
grammar
normal
+
–
39
votes
1
answer
1883
GATE IT 2008 | Question: 79
$A$ CFG $G$ is given with the following productions where $S$ is the start symbol, $A$ is a non-terminal and a and b are terminals. $S → aS \mid A$ $A → aAb \mid bAa \mid \epsilon$ For the string "$aabbaab$" how many steps are required to derive the string and how many parse trees are there? $6$ and $1$ $6$ and $2$ $7$ and $2$ $4$ and $2$
$A$ CFG $G$ is given with the following productions where $S$ is the start symbol, $A$ is a non-terminal and a and b are terminals.$S → aS \mid A$$A → aAb \mid bAa \m...
Ishrat Jahan
8.5k
views
Ishrat Jahan
asked
Oct 29, 2014
Compiler Design
gateit-2008
compiler-design
context-free-grammar
parsing
normal
+
–
18
votes
2
answers
1884
GATE CSE 1996 | Question: 20
Consider the syntax-directed translation schema (SDTS) shown below: $E\rightarrow E + E$ {print + } $E\rightarrow E * E$ {print . } $E\rightarrow id$ {print id.name} $E\rightarrow (E)$ An LR-parser executes the actions associated with ... corresponding production. Draw the parse tree and write the translation for the sentence. $(a+b)*(c+d)$, using SDTS given above.
Consider the syntax-directed translation schema (SDTS) shown below:$E\rightarrow E + E$ {print “+”}$E\rightarrow E * E$ {print “.”}$E\rightarrow id$ {print id.nam...
Kathleen
3.5k
views
Kathleen
asked
Oct 9, 2014
Compiler Design
gate1996
compiler-design
syntax-directed-translation
normal
descriptive
+
–
34
votes
5
answers
1885
GATE CSE 1996 | Question: 11
Let $G$ be a context-free grammar where $G=(\{S, A, B, C\}, \{a, b, d\}, P, S)$ with the productions in $P$ given below. $S \rightarrow ABAC$ $A \rightarrow aA \mid \varepsilon$ $B \rightarrow bB \mid \varepsilon$ ... $\varepsilon$ productions and no unit productions. (A unit production is of the form $x \rightarrow y$, and $x$ and $y$ are non terminals).
Let $G$ be a context-free grammar where $G=(\{S, A, B, C\}, \{a, b, d\}, P, S)$ with the productions in $P$ given below.$S \rightarrow ABAC$$A \rightarrow aA \mid \vareps...
Kathleen
7.7k
views
Kathleen
asked
Oct 9, 2014
Compiler Design
gate1996
compiler-design
grammar
normal
descriptive
+
–
8
votes
2
answers
1886
GATE CSE 1996 | Question: 2.16
Which of the following macros can put a macro assembler into an infinite loop? .MACRO M1, X .IF EQ, X ;if X=0 then M1 X + 1 .ENDC .IF NE, X ;if X ≠ O then .WORD X ;address (X) is stored here .ENDC .ENDM .MACRO M2, X .IF EQ, X M2 X .ENDC .IF NE, X .WORD X + 1 .ENDC .ENDM (ii) only (i) only both (i) and (ii) None of the above
Which of the following macros can put a macro assembler into an infinite loop?.MACRO M1, X .IF EQ, X ;if X=0 then M1 X + 1 .ENDC .IF NE, X ;if X ≠ O then .WORD X ;addre...
Kathleen
3.8k
views
Kathleen
asked
Oct 9, 2014
Compiler Design
gate1996
compiler-design
macros
normal
+
–
28
votes
1
answer
1887
GATE CSE 1996 | Question: 2.10
The grammar whose productions are $\langle\text{stmt}\rangle \to\text{ if id then } \langle\text{stmt}\rangle$ $\langle\text{stmt}\rangle\to\text{ if id then } \langle\text{stmt}\rangle\text{ else } \langle\text{stmt}\rangle$ ... f has more than two parse trees (d) the sentence if a then if b then c:= d else c:= f has two parse trees
The grammar whose productions are$\langle\text{stmt}\rangle \to\text{ if id then } \langle\text{stmt}\rangle$$\langle\text{stmt}\rangle\to\text{ if id then } \langle\text...
Kathleen
5.5k
views
Kathleen
asked
Oct 9, 2014
Compiler Design
gate1996
compiler-design
grammar
normal
+
–
38
votes
2
answers
1888
GATE CSE 1996 | Question: 1.17
The pass numbers for each of the following activities object code generation literals added to literal table listing printed address resolution of local symbols that occur in a two pass assembler respectively are $1, 2, 1, 2$ $2, 1, 2, 1$ $2, 1, 1, 2$ $1, 2, 2, 2$
The pass numbers for each of the following activitiesobject code generationliterals added to literal tablelisting printedaddress resolution of local symbols that occur in...
Kathleen
12.8k
views
Kathleen
asked
Oct 9, 2014
Compiler Design
gate1996
compiler-design
normal
assembler
+
–
23
votes
4
answers
1889
GATE CSE 1995 | Question: 9
Translate the arithmetic expression $a^\ast -(b+c)$ into syntax tree. A grammar is said to have cycles if it is the case that $A \overset{+}{\Rightarrow} A$ Show that no grammar that has cycles can be $\text{LL(1)}.$
Translate the arithmetic expression $a^\ast -(b+c)$ into syntax tree.A grammar is said to have cycles if it is the case that $A \overset{+}{\Rightarrow} A$ Show that no g...
Kathleen
6.6k
views
Kathleen
asked
Oct 8, 2014
Compiler Design
gate1995
compiler-design
grammar
normal
descriptive
+
–
6
votes
2
answers
1890
GATE CSE 1995 | Question: 8
Construct the $\text{LL(1)}$ table for the following grammar. $Expr \rightarrow \_Expr$ $Expr \rightarrow (Expr)$ $Expr \rightarrow Var\; ExprTail$ $ExprTail \rightarrow \_Expr$ $Expr \rightarrow \lambda$ $Var \rightarrow Id\; VarTail$ $VarTail \rightarrow (Expr)$ $VarTail \rightarrow \lambda$ $Goal \rightarrow Expr$
Construct the $\text{LL(1)}$ table for the following grammar.$Expr \rightarrow \_Expr$$Expr \rightarrow (Expr)$$Expr \rightarrow Var\; ExprTail$$ExprTail \rightarrow \_Ex...
Kathleen
2.5k
views
Kathleen
asked
Oct 8, 2014
Compiler Design
gate1995
compiler-design
parsing
normal
descriptive
+
–
Page:
« prev
1
...
58
59
60
61
62
63
64
65
66
67
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register