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
0
answers
1
FIRST $ FOLLOW
S -> A B A -> f S f A -> b b B d B -> Ɛ B -> c First(S) = First(A) = First(B) = Follow(S) = Follow(A) = Follow(B) =
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
Ana_101
10
views
Ana_101
asked
12 hours
ago
Compiler Design
first-and-follow
compiler-design
parsing
grammar
+
–
0
votes
1
answer
2
FIRST & FOLLOR
S -> A B A -> f S f A -> b b B d B -> Ɛ B -> c First(S) = First(A) = First(B) = Follow(S) = Follow(A) = Follow(B) =
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
Ana_101
22
views
Ana_101
asked
15 hours
ago
Compiler Design
first-and-follow
compiler-design
parsing
first-order-logic
descriptive
+
–
0
votes
0
answers
3
BARC 2024 CSE
Number of nodes in the DAG(Directed Acyclic Graph) representing (a+b)+c+(a+b)
Number of nodes in the DAG(Directed Acyclic Graph) representing (a+b)+c+(a+b)
Ayanava Dutta
147
views
Ayanava Dutta
asked
Mar 17
Compiler Design
normal
directed-acyclic-graph
compiler-design
+
–
1
votes
3
answers
4
GATE CSE 2024 | Set 2 | Question: 11
Consider the following two sets: Set $\text{X}$ Set $\text{Y}$ P. Lexical Analyzer 1. Abstract Syntax Tree Q. Syntax Analyzer 2. Token R. Intermediate Code Generator 3. Parse Tree S. Code Optimizer 4. Constant Folding Which one of the following options is the CORRECT match ... $\mathrm{P}-4 ; \mathrm{Q}-3 ; \mathrm{R}-2 ; \mathrm{S}-1$
Consider the following two sets:Set $\text{X}$Set $\text{Y}$P. Lexical Analyzer1. Abstract Syntax TreeQ. Syntax Analyzer2. TokenR. Intermediate Code Generator3. ...
Arjun
2.3k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set2
compiler-design
compilation-phases
match-the-following
+
–
2
votes
1
answer
5
GATE CSE 2024 | Set 2 | Question: 19
Which of the following statements is/are FALSE? An attribute grammar is a syntax-directed definition $\text{(SDD)}$ in which the functions in the semantic rules have no side effects The attributes in a $\text{L}$-attributed definition ... $\text{L}$-attributed definitions based on $\text{LR(1)}$ grammar can be evaluated using a bottom-up parsing strategy
Which of the following statements is/are FALSE?An attribute grammar is a syntax-directed definition $\text{(SDD)}$ in which the functions in the semantic r...
Arjun
2.5k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set2
compiler-design
syntax-directed-translation
multiple-selects
+
–
2
votes
1
answer
6
GATE CSE 2024 | Set 2 | Question: 30
Consider the following context-free grammar where the start symbol is $\text{S}$ and the set of terminals is $\{a, b, c, d\}$. \[ \begin{array}{l} S \rightarrow A a A b \mid B b B a \\ A \rightarrow c S \mid \epsilon \\ B \rightarrow d S \mid \epsilon \end{ ... blank $(4)$ blank $(1)$ $S \rightarrow B b B a$ $(2)$ $S \rightarrow A a A b$ $(3)$ blank $(4)$ blank
Consider the following context-free grammar where the start symbol is $\text{S}$ and the set of terminals is $\{a, b, c, d\}$.\[\begin{array}{l}S \rightarrow A a A b \mid...
Arjun
3.0k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set2
compiler-design
+
–
2
votes
1
answer
7
GATE CSE 2024 | Set 2 | Question: 33
Consider the following expression: $x[i]=(p+r) *-s[i]+u / w$. The following sequence shows the list of triples representing the given expression, with entries missing for triples $(1), (3)$, and $(6)$ ... $(1)$ [ ]$=s i \quad(3)-(0)(2) \quad(6)=[ ] x i$
Consider the following expression: $x[i]=(p+r) *-s[i]+u / w$. The following sequence shows the list of triples representing the given expression, with entries missing ...
Arjun
1.6k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set2
compiler-design
+
–
2
votes
1
answer
8
GATE CSE 2024 | Set 2 | Question: 55
Consider the following augmented grammar, which is to be parsed with a $\text{SLR}$ parser. The set of terminals is $\{a, b, c, d, \#, @\}$ \[ \begin{array}{l} S^{\prime} \rightarrow S \\ S \rightarrow S S|A a| b A c|B c| b ... $\operatorname{GOTO}\left(I_{0}, S\right)$ is __________.
Consider the following augmented grammar, which is to be parsed with a $\text{SLR}$ parser. The set of terminals is $\{a, b, c, d, \#, @\}$\[\begin{array}{l}S^{\prime} \r...
Arjun
2.5k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set2
numerical-answers
compiler-design
+
–
1
votes
1
answer
9
GATE CSE 2024 | Set 1 | Question: 16
Which of the following is/are Bottom-Up Parser(s)? Shift-reduce Parser Predictive Parser LL$(1)$ Parser LR Parser
Which of the following is/are Bottom-Up Parser(s)?Shift-reduce ParserPredictive ParserLL$(1)$ Parser LR Parser
Arjun
2.1k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set1
multiple-selects
compiler-design
+
–
3
votes
1
answer
10
GATE CSE 2024 | Set 1 | Question: 23
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below. Operator Precedence Associativity + Highest Left - High Right * Medium Right / Low Right The value of the expression $3+1+5 * 2 / 7+2-4-7-6 / 2$ as per the above rules is ________.
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below.Operator PrecedenceAssociativity+Highest Left-HighR...
Arjun
2.4k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set1
numerical-answers
compiler-design
+
–
0
votes
2
answers
11
GATE CSE 2024 | Set 1 | Question: 27
Consider the following syntax-directed definition $\text{(SDD)}$. $S \rightarrow D H T U$ $ \left\{S.v a l = D.val + H.val + T.val + U.val\right\};$ $D \rightarrow ^{"} \mathrm{M}^{"} D_1$ ... the following options is the $\text{CORRECT}$ value computed by the $\text{SDD}$ (in the attribute $S.val$)? $45$ $50$ $55$ $65$
Consider the following syntax-directed definition $\text{(SDD)}$.$S \rightarrow D H T U$$ \left\{S.v a l = D.val + H.val + T.val + U.val\right\};$$D \rightarrow ^{"} \...
Arjun
1.9k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set1
compiler-design
syntax-directed-translation
+
–
0
votes
1
answer
12
GATE CSE 2024 | Set 1 | Question: 28
Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by $(1), (2)$, and $(3)$ ... $R \rightarrow c R$ (1) $S \rightarrow R f$ (2) $T \rightarrow c T$ (3) $R \rightarrow c R$
Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by $(1), (2)$, and $(3)$.$$\begin{aligned} & S ...
Arjun
1.7k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set1
compiler-design
+
–
0
votes
1
answer
13
GATE CSE 2024 | Set 1 | Question: 29
Consider the following pseudo-code. $L 1 : t 1 = -1$ $L 2: t 2 = 0$ $L 3: t 3 = 0$ $L 4: t 4 = 4 * t 3$ $L 5: t 5 = 4 * t 2$ $L 6: t 6 = t 5 * M$ $L 7: t 7 = t 4+t 6$ ... options CORRECTLY specifies the number of basic blocks and the number of instructions in the largest basic block, respectively? $6$ and $6$ $6$ and $7$ $7$ and $7$ $7$ and $6$
Consider the following pseudo-code.$L 1 : t 1 = -1$ $L 2: t 2 = 0$ $L 3: t 3 = 0$ $L 4: t 4 = 4 * t 3$$L 5: t 5 = 4 * t 2$$L 6: t 6 = t 5 * M$$L 7: t 7 = t 4+t 6$$L 8: t ...
Arjun
1.8k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set1
compiler-design
+
–
0
votes
1
answer
14
GATE CSE 2024 | Set 1 | Question: 49
Let $G=(V, \Sigma, S, P)$ be a context-free grammar in Chomsky Normal Form with $\Sigma=\{a, b, c\}$ and $V$ containing $10$ variable symbols including the start symbol $S$. The string $w=a^{30} b^{30} c^{30}$ is derivable from $S$. The number of steps (application of rules) in the derivation $S \rightarrow^* w$ is __________.
Let $G=(V, \Sigma, S, P)$ be a context-free grammar in Chomsky Normal Form with $\Sigma=\{a, b, c\}$ and $V$ containing $10$ variable symbols including the start symbol $...
Arjun
1.3k
views
Arjun
asked
Feb 16
Compiler Design
gatecse2024-set1
numerical-answers
compiler-design
+
–
2
votes
1
answer
15
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 26
Which attributes in the following grammar are synthesized? A.a B.b B.x C.c
Which attributes in the following grammar are synthesized?A.aB.bB.xC.c
GO Classes
815
views
GO Classes
asked
Feb 5
Compiler Design
goclasses2024-mockgate-14
compiler-design
syntax-directed-translation
multiple-selects
1-mark
+
–
4
votes
1
answer
16
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 52
Consider the following given grammar and the parse tree for the sentence $x + y * z.$ The first reduction made by the shift-reduce parser is labeled as 1, and we keep labeling in the same increasing order, such that the 8th (here, the ... labeled 3. $T \rightarrow T^* P$ will be labeled 6. $T \rightarrow T^* P$ will be labeled 7.
Consider the following given grammar and the parse tree for the sentence $x + y * z.$The first reduction made by the shift-reduce parser is labeled as 1, and we keep labe...
GO Classes
303
views
GO Classes
asked
Feb 5
Compiler Design
goclasses2024-mockgate-14
compiler-design
parsing
2-marks
+
–
4
votes
0
answers
17
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 53
The grammar shown below is LL(k) for some value of k. What is the smallest value of k for which this grammar is LL(k)?
The grammar shown below is LL(k) for some value of k. What is the smallest value of k for which this grammar is LL(k)?
GO Classes
923
views
GO Classes
asked
Feb 5
Compiler Design
goclasses2024-mockgate-14
numerical-answers
compiler-design
parsing
ll-parser
2-marks
+
–
0
votes
1
answer
18
compiler design tcompiler-design-timothy-g-griffin
6. Generate code for the following C program using any code generation algorithm. [3 Marks] main() { int x, a, b, c, d, e; x= a + b -( c + d ) * e }
6. Generate code for the following C program using any code generation algorithm. [3 Marks] main() { int x, a, b, c, d, e; ...
Ebrahim
144
views
Ebrahim
asked
Jan 31
Compiler Design
compiler-design
syntax-directed-translation
code-optimization
parsing
ullman
+
–
3
votes
1
answer
19
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 38
Consider the syntax-directed translation given by the following grammar and semantic rules. Here, $S$ is the only non-terminal and $\Sigma=\{0,1,2\}$ is a set of terminals. $\text{S.val}$ denotes the synthesized attribute (a ... $3$ value. The value computed by the translation scheme for the input string $201$ is $20.$
Consider the syntax-directed translation given by the following grammar and semantic rules. Here, $S$ is the only non-terminal and $\Sigma=\{0,1,2\}$ is a set of terminal...
GO Classes
526
views
GO Classes
asked
Jan 28
Compiler Design
goclasses2024-mockgate-13
goclasses
compiler-design
syntax-directed-translation
multiple-selects
2-marks
+
–
4
votes
1
answer
20
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 39
Consider the following grammar $ \begin{aligned} & A \rightarrow B B \\ & B \rightarrow b \end{aligned} $ Suppose we draw an $\operatorname{LR}(0)$ automatan for the given grammar then which of the ... transitions There is exactly one state with $2$ incoming transitions There is exactly one state with $3$ outgoing transitions
Consider the following grammar$$\begin{aligned}& A \rightarrow B B \\& B \rightarrow b\end{aligned}$$Suppose we draw an $\operatorname{LR}(0)$ automatan for the given gra...
GO Classes
379
views
GO Classes
asked
Jan 28
Compiler Design
goclasses2024-mockgate-13
goclasses
compiler-design
lr-parser
multiple-selects
2-marks
+
–
0
votes
0
answers
21
is there something wrong in the production rules?
pcla
95
views
pcla
asked
Jan 27
Compiler Design
syntax-directed-translation
compiler-design
+
–
5
votes
1
answer
22
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 2
Consider the following grammar- ... $\text{Follow(T)}$ are same. $\operatorname{First}(\mathrm{A})$ and $\operatorname{First}(\mathrm{T})$ are same.
Consider the following grammar-$$\begin{aligned}& S \rightarrow b T \\& T \rightarrow A b \mid B a \\& A \rightarrow a S \mid C B \\& B \rightarrow b D \\& C \rightarrow ...
GO Classes
602
views
GO Classes
asked
Jan 21
Compiler Design
goclasses2024-mockgate-12
goclasses
compiler-design
parsing
first-and-follow
multiple-selects
1-mark
+
–
4
votes
1
answer
23
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 16
Consider the following context-free grammar, with start symbol $S$ and terminals $a, ; , \lt , \gt .$ $ S \rightarrow \;\lt L \mid a \qquad L \rightarrow a R \mid \;\lt L R \quad R \rightarrow\;\gt\; \mid \;; L $ How many different parse trees are there for the string $\lt \lt a \gt ;a\gt ?$
Consider the following context-free grammar, with start symbol $S$ and terminals $a, ; , \lt , \gt .$$$S \rightarrow \;\lt L \mid a \qquad L \rightarrow a R \mid \;\lt L...
GO Classes
386
views
GO Classes
asked
Jan 21
Compiler Design
goclasses2024-mockgate-12
goclasses
numerical-answers
compiler-design
parsing
context-free-grammar
1-mark
+
–
2
votes
1
answer
24
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 33
Consider the following grammar: $ \begin{aligned} & S \rightarrow a S^{\prime} \\ & S^{\prime} \rightarrow b S^{\prime} \mid \epsilon \end{aligned} $ Which of the following is/are CORRECT right sentential form of the given grammar? $a b S^{\prime}$ $bS'$ $a S^{\prime} b$ $bbS$
Consider the following grammar:$$\begin{aligned}& S \rightarrow a S^{\prime} \\& S^{\prime} \rightarrow b S^{\prime} \mid \epsilon\end{aligned}$$Which of the following is...
GO Classes
482
views
GO Classes
asked
Jan 21
Compiler Design
goclasses2024-mockgate-12
goclasses
compiler-design
parsing
multiple-selects
2-marks
+
–
5
votes
1
answer
25
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 34
$ \begin{aligned} & S \rightarrow S1 \;T \\ & S 1 \rightarrow a \mid(S S) \\ & T \rightarrow \varepsilon \mid b \;T \end{aligned} $ In the $\text{LL(1)}$ parser table, $M$ ... $\{T \rightarrow \varepsilon\}$ $\{S 1 \rightarrow a\}$ and $\{T \rightarrow \varepsilon\}$
$$\begin{aligned}& S \rightarrow S1 \;T \\& S 1 \rightarrow a \mid(S S) \\& T \rightarrow \varepsilon \mid b \;T\end{aligned}$$In the $\text{LL(1)}$ parser table, $M$, of...
GO Classes
457
views
GO Classes
asked
Jan 21
Compiler Design
goclasses2024-mockgate-12
goclasses
compiler-design
parsing
ll-parser
2-marks
+
–
0
votes
1
answer
26
Made easy mock test question from Compiler Design
Please show the procedure for the given question.
Please show the procedure for the given question.
Rohit Chakraborty
133
views
Rohit Chakraborty
asked
Jan 15
Compiler Design
compiler-design
parsing
made-easy-test-series
+
–
3
votes
1
answer
27
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 26
A lexical analyzer uses the following patterns to recognize four tokens $\textsf{T1, T2, T3},$ and $\textsf{T4}$ over the alphabet $ \{a,b,c\}.$ Rule1: aa*b*c* { print ( T1 ); } Rule2: c { print ( T2 ); ... never be used? Note that the analyzer outputs the token that matches the longest possible prefix. Rule$1$ Rule$2$ Rule$3$ Rule$4$
A lexical analyzer uses the following patterns to recognize four tokens $\textsf{T1, T2, T3},$ and $\textsf{T4}$ over the alphabet $ \{a,b,c\}.$Rule1: aa*b*c* { print...
GO Classes
623
views
GO Classes
asked
Jan 13
Compiler Design
goclasses2024-mockgate-11
goclasses
compiler-design
lexical-analysis
compiler-tokenization
multiple-selects
1-mark
+
–
3
votes
1
answer
28
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 27
Suppose there is a handle on the top of the stack at some point in time while performing $\text{LR(k)}$ parsing. In this context, a cetrain $\text{LR(k)}$ parsers may exhibit uncertainty in ... The parser may perform reduction without generating any conflict. The parser may execute a shift operation without generating any conflict.
Suppose there is a handle on the top of the stack at some point in time while performing $\text{LR(k)}$ parsing. In this context, a cetrain $\text{LR(k)}$ parsers may exh...
GO Classes
531
views
GO Classes
asked
Jan 13
Compiler Design
goclasses2024-mockgate-11
goclasses
compiler-design
parsing
lr-parser
multiple-selects
1-mark
+
–
4
votes
1
answer
29
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 54
Consider the following grammar given below. ... the last character of the string: $a^* b($ $\operatorname{CC}($ $\mathrm{BC}($ $\mathrm{CB}$ $\mathrm{BB}$
Consider the following grammar given below.$$\begin{aligned}& A \rightarrow B+A \\& A \rightarrow B \\& B \rightarrow C B \\& B \rightarrow C \\& C \rightarrow D^* \\& C ...
GO Classes
771
views
GO Classes
asked
Jan 13
Compiler Design
goclasses2024-mockgate-11
goclasses
compiler-design
parsing
lr-parser
2-marks
+
–
0
votes
1
answer
30
Compiler-design
Q1. For the following grammar N -> AB | BA A -> a | CAC B -> b | CBC C -> a | b Find the FIRST and FOLLOW
Q1. For the following grammar N - AB | BA A - a | CAC B - b | CBC C - a | b Find the FIRST and FOLLOW
Ebrahim
171
views
Ebrahim
asked
Jan 12
Compiler Design
compiler-design
syntax-directed-translation
lexical-analysis
ullman
parsing
+
–
Page:
1
2
3
4
5
6
...
68
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register