Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged goclasses-compiler-practice-questions
2
2 votes
3
3 answers
603
603 views
GO Classes DPP | COMPILER|LA
A lexical analyzer is designed for a new language with the following rules for token generation:$\mathrm{KEYWORD1}: \verb|if|$ $\mathrm{KEYWORD2}: \verb|iff|$ $\mathrm{ID...
GO Classes
603
views
asked
Feb 4
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-191
goclasses-compiler-practice-questions
multiple-selects
+
–
2
2 votes
5
5 answers
595
595 views
GO Classes DPP | COMPILER|GRAMMAR
Consider the following arammar $G$ :$$\begin{aligned}& S \rightarrow(L) \mid a \\& L \rightarrow L, S \mid S\end{aligned}$$Which of the following statement(s) is/are TRUE...
GO Classes
595
views
asked
Feb 4
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-191
goclasses-compiler-practice-questions
multiple-selects
+
–
5
5 votes
2
2 answers
320
320 views
GO Classes DPP | COMPILER|BOTTOM-UP PARSER
Consider a Bottom-Up parser for a grammar $G$. During the parsing of an input string $w$, the parser reaches a configuration where the stack contains the prefix $\alpha$ ...
GO Classes
320
views
asked
Feb 4
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-191
goclasses-compiler-practice-questions
+
–
2
2 votes
2
2 answers
333
333 views
GO Classes DPP | COMPILER|LA
Which of the following statement(s) is/are TRUE regarding Lexical Analysis and Regular Expressions?The number of states in a minimal Deterministic Finite Automaton (DFA) ...
GO Classes
333
views
asked
Feb 4
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-191
goclasses-compiler-practice-questions
+
–
1
1 vote
2
2 answers
323
323 views
GO Classes DPP | COMPILER|SDT
Consider the following Syntax Directed Translation (SDT) scheme where $S$ is the start symbol and $id.\mathrm{val}$ represents the numerical value of an identifier:$$\beg...
GO Classes
323
views
asked
Feb 4
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-191
goclasses-compiler-practice-questions
multiple-selects
+
–
1
1 vote
2
2 answers
388
388 views
GO Classes DPP | COMPILER|LA
A lexical analyzer for a specific language identifies tokens using the following regular expressions:$$\begin{aligned}& L_1: a(a \mid b)^* \\& L_2: a b(a \mid b)^* \\& L_...
GO Classes
388
views
asked
Jan 31
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-189
goclasses-compiler-practice-questions
+
–
1
1 vote
1
1 answer
311
311 views
GO Classes DPP | COMPILER|DEAD CODE ELIMINATION
Consider the following basic block of intermediate code:1. a = 10 2. b = a + 5 3. c = b * 2 4. a = c - b 5. d = a + bAssuming that only the variable $\verb|d|$ is "live" ...
GO Classes
311
views
asked
Jan 31
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-189
goclasses-compiler-practice-questions
+
–
2
2 votes
2
2 answers
307
307 views
GO Classes DPP | COMPILER|SDT
Consider the following L-attributed Syntax Directed Definition (SDD). $S$ is the start symbol, and S.val is a synthesized attribute. A.inh is an inherited attribute.$S \r...
GO Classes
307
views
asked
Jan 31
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-189
goclasses-compiler-practice-questions
+
–
1
1 vote
1
1 answer
287
287 views
GO Classes DPP | COMPILER|CODE OPTIMIZATION
In the context of Code Optimization, consider the following code segment inside a loop:for (i = 0; i < n; i++) { x = y + z; a[i] = 2 * i + x; }Moving the statemen...
GO Classes
287
views
asked
Jan 31
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-189
goclasses-compiler-practice-questions
+
–
2
2 votes
3
3 answers
368
368 views
GO Classes DPP | COMPILER|SDT
Consider the following syntax-directed translation scheme (SDTS) where $S$ is the start symbol:$$\begin{aligned}& S \rightarrow E\{\text { print }(\text { E.val })\} \\& ...
GO Classes
368
views
asked
Jan 31
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-189
goclasses-compiler-practice-questions
+
–
2
2 votes
1
1 answer
316
316 views
GO Classes DPP | COMPILER|LR PARSER
Consider the following grammar $g$ :$$\begin{gathered}s \rightarrow l=r \mid r \\l \rightarrow * r \mid i d \\r \rightarrow l\end{gathered}$$Which of the following statem...
GO Classes
316
views
asked
Jan 29
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-187
goclasses-compiler-practice-questions
multiple-selects
+
–
1
1 vote
1
1 answer
283
283 views
GO Classes DPP | COMPILER|CSE
Consider the following basic block of three-address code:$\mathrm{t 1=a+b}$ $\mathrm{t 2=c* d}$ $\mathrm{t} 3=\mathrm{t} 1+\mathrm{t} 2$ $\mathrm{a=t 3}$ $\mathrm{t 4=c*d...
GO Classes
283
views
asked
Jan 29
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-187
goclasses-compiler-practice-questions
+
–
2
2 votes
1
1 answer
301
301 views
GO Classes DPP | COMPILER|LEXICAL ANALYZER
Consider the following regular expression over the alphabet $\{a, b\}$ used for a lexical analyzer token definition:$$R=(a+b)^*(a a+b b)(a+b)^*$$Which of the following de...
GO Classes
301
views
asked
Jan 29
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-187
goclasses-compiler-practice-questions
+
–
1
1 vote
2
2 answers
310
310 views
GO Classes DPP | COMPILER|SDT
Consider the following SDT scheme used to evaluate an expression. The synthesized attribute $\mathrm{val}$ stores the numerical value.\[\begin{aligned}E &\rightarrow E_1 ...
GO Classes
310
views
asked
Jan 29
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-187
goclasses-compiler-practice-questions
numerical-answers
+
–
2
2 votes
1
1 answer
291
291 views
GO Classes DPP | COMPILER|LL(1) PARSER
Consider the following grammar $G$ with terminal set $\Sigma=\{a, b, c, d\}$ and non-terminal set $V=\{S, A, B\}$ :$$\begin{gathered}S \rightarrow a A b \mid b B a \\A \r...
GO Classes
291
views
asked
Jan 29
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-187
goclasses-compiler-practice-questions
multiple-selects
+
–
0
0 votes
1
1 answer
354
354 views
GO Classes DPP | COMPILER|CODE OPTIMIZATION
Consider the following sequence of three-address code (TAC) instructions:1. i = 1 2. j = 1 3. t1 = 5 * i 4. t2 = t1 + j 5. a[t2] = 0 6. j = j + 1 7. if j <= 5 goto (3) 8....
GO Classes
354
views
asked
Jan 27
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-185
goclasses-compiler-practice-questions
+
–
2
2 votes
2
2 answers
344
344 views
GO Classes DPP | COMPILER|PARSING
Consider the following grammar $G$ with start symbol $S$ :$$\begin{aligned}& S \rightarrow L=R \\& S \rightarrow R \\& L \rightarrow * R \\& L \rightarrow i d . \\& R \ri...
GO Classes
344
views
asked
Jan 27
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-185
goclasses-compiler-practice-questions
+
–
1
1 vote
1
1 answer
314
314 views
GO Classes DPP | COMPILER|LIVE VARIABLE ANALYSIS
Consider the following basic block of Three-Address Code:1. a = 1 2. b = a + 1 3. c = a + b 4. a = c + b 5. return aA variable is live at a point if its current value wil...
GO Classes
314
views
asked
Jan 27
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-185
goclasses-compiler-practice-questions
+
–
1
1 vote
2
2 answers
307
307 views
GO Classes DPP | COMPILER|SDT
Consider the following Syntax-Directed Translation (SDT) scheme with the grammar rules and actions provided below:$$\begin{aligned}& S \rightarrow S_1 \# T\left\{S . \mat...
GO Classes
307
views
asked
Jan 27
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-185
goclasses-compiler-practice-questions
numerical-answers
+
–
2
2 votes
3
3 answers
380
380 views
GO Classes DPP | COMPILER|LEXICAL ANALYZER
Consider the following lexical specification for a scanner:$\mathrm{KEYWORD\_IF: \verb|if|}$ $\mathrm{ID: [a-z][0-9]*}$ $\mathrm{NUM: [0-9]+}$ The scanner follows the Lon...
GO Classes
380
views
asked
Jan 27
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-185
goclasses-compiler-practice-questions
numerical-answers
+
–
1
1 vote
1
1 answer
274
274 views
GO Classes DPP | COMPILER|CODE OPTIMIZATION
Consider the following three-address code sequence used for a loop:i = 0 L1: t1 = i * 4 t2 = base + t1 val = load t2 i = i + 1 if i < 100 goto L1Which optimization techni...
GO Classes
274
views
asked
Jan 23
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-183
goclasses-compiler-practice-questions
+
–
1
1 vote
1
1 answer
266
266 views
GO Classes DPP | COMPILER|LR(1) PARSER
An $\mathrm{LR(1)}$ parser is being constructed for a grammar. If a particular state in the corresponding $\mathrm{LR}(1)$ canonical collection contains the item $[A \rig...
GO Classes
266
views
asked
Jan 23
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-183
goclasses-compiler-practice-questions
+
–
1
1 vote
2
2 answers
270
270 views
GO Classes DPP | COMPILER|DAG
In a compiler's optimization phase, a Directed Acyclic Graph (DAG) is often used instead of a standard syntax tree to represent expressions. Consider the expression: $a=(...
GO Classes
270
views
asked
Jan 23
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-183
goclasses-compiler-practice-questions
numerical-answers
+
–
0
0 votes
1
1 answer
289
289 views
GO Classes DPP | COMPILER|SYNTAX TREE
Consider a syntax tree for the expression $a+b * c-d / e$. If the expression is evaluated using a post-order traversal of this tree, and the values at the leaves are $a=2...
GO Classes
289
views
asked
Jan 23
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-183
goclasses-compiler-practice-questions
numerical-answers
+
–
1
1 vote
1
1 answer
248
248 views
GO Classes DPP | COMPILER|EXPRESSION EVALUATION
Consider the expression tree shown below. Each leaf represents a numerical value, which can be chosen from the set $\{-1,1\}$. Over all possible choices of the values at ...
GO Classes
248
views
asked
Jan 23
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-183
goclasses-compiler-practice-questions
numerical-answers
+
–
0
0 votes
2
2 answers
293
293 views
GO Classes DPP | COMPILER|LIVE VARIABLE ANALYSIS
Consider the following basic block consisting of three-address code instructions. Assume that only the variable $\verb|x|$ is "live" at the exit of this basic block.1. a ...
GO Classes
293
views
asked
Jan 20
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-181
goclasses-compiler-practice-questions
numerical-answers
+
–
1
1 vote
1
1 answer
246
246 views
GO Classes DPP | COMPILER|TAC
Consider the following C-style code segment:while (a < b) { if (c < d) x = y + z; else x = y - z; }Assume this code is translated into Three-Address Code (TAC) us...
GO Classes
246
views
asked
Jan 20
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-181
goclasses-compiler-practice-questions
numerical-answers
+
–
1
1 vote
1
1 answer
283
283 views
GO Classes DPP | COMPILER|DAG
In a compiler's optimization phase, a Directed Acyclic Graph (DAG) is constructed for the following basic block:1. t1 = a + b 2. t2 = c * d 3. t3 = t1 + t2 4. t4 = a + b ...
GO Classes
283
views
asked
Jan 20
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-181
goclasses-compiler-practice-questions
numerical-answers
+
–
1
1 vote
1
1 answer
276
276 views
GO Classes DPP | COMPILER|SDT
Consider the following S-attributed SDT scheme used to calculate the value of an expression. The grammar generates simple arithmetic additions and is suitable for an LR p...
GO Classes
276
views
asked
Jan 20
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-181
goclasses-compiler-practice-questions
+
–
3
3 votes
2
2 answers
342
342 views
GO Classes DPP | COMPILER|LEXICAL ANALYZER
Consider the following regular expression over the alphabet $\Sigma=\{a, b\}$ that represents a specific class of tokens in a new programming language:$$r=(a+b)^* a b b$$...
GO Classes
342
views
asked
Jan 20
Compiler Design
goclasses
compiler
goclasses-cs-dpp
goclasses-cs-dpp-day-181
goclasses-compiler-practice-questions
numerical-answers
+
–
Page:
1
2
3
4
5
next »