Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Search results for parsing
5
votes
1
answer
1
Ullman (Compiler Design) Edition 2 Exercise 5.1 Question 1 (Page No. 309 - 310)
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.$
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)...
admin
40.4k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
parsing
+
–
57
votes
11
answers
2
GATE CSE 2017 Set 1 | Question: 43
Consider the following grammar: stmt $\rightarrow$ if expr then expr else expr; stmt | $Ò$ expr $\rightarrow$ term relop term | term term $\rightarrow$ id | number id $\rightarrow$ a | b | c number $\rightarrow [0-9]$ where relop is a relational ... program if $e_1$ then $e_2$ else $e_3$ has $2$ control flow paths. $e_1 \rightarrow e_2$ and $e_1 \rightarrow e_3$.
Consider the following grammar:stmt $\rightarrow$ if expr then expr else expr; stmt | $Ò$expr $\rightarrow$ term relop term | termterm $\rightarrow$ id | numberid $\righ...
Arjun
20.2k
views
Arjun
asked
Feb 14, 2017
Compiler Design
gatecse-2017-set1
compiler-design
parsing
normal
numerical-answers
+
–
83
votes
13
answers
3
GATE CSE 2013 | Question: 9
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$ and $A \rightarrow a$) to parse a string with $n$ tokens? $n/2$ $n-1$ $2n-1$ $2^{n}$
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 \epsilo...
Arjun
32.9k
views
Arjun
asked
Sep 23, 2014
Compiler Design
gatecse-2013
compiler-design
parsing
normal
+
–
50
votes
3
answers
4
GATE CSE 2009 | Question: 42
Which of the following statements are TRUE? There exist parsing algorithms for some programming languages whose complexities are less than $\Theta(n^3)$ A programming language which allows recursion can be implemented with static storage allocation. No L-attributed ... both source language and intermediate code level. I and II I and IV III and IV I, III and IV
Which of the following statements are TRUE?There exist parsing algorithms for some programming languages whose complexities are less than $\Theta(n^3)$A programming langu...
Kathleen
18.2k
views
Kathleen
asked
Sep 22, 2014
Compiler Design
gatecse-2009
compiler-design
parsing
normal
+
–
44
votes
7
answers
5
GATE CSE 2014 Set 1 | Question: 34
A canonical set of items is given below $S \to L .> R $ $Q \to R.$ On input symbol $<$ the set has a shift-reduce conflict and a reduce-reduce conflict. a shift-reduce conflict but not a reduce-reduce conflict. a reduce-reduce conflict but not a shift-reduce conflict. neither a shift-reduce nor a reduce-reduce conflict.
A canonical set of items is given below$S \to L . R $$Q \to R.$On input symbol $<$ the set hasa shift-reduce conflict and a reduce-reduce conflict.a shift-reduce conflict...
go_editor
24.3k
views
go_editor
asked
Sep 26, 2014
Compiler Design
gatecse-2014-set1
compiler-design
parsing
normal
+
–
53
votes
2
answers
6
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
18.9k
views
makhdoom ghaya
asked
Feb 12, 2015
Compiler Design
gatecse-2015-set1
compiler-design
parsing
normal
viable-prefix
+
–
67
votes
10
answers
7
GATE CSE 2003 | Question: 16
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar? Removing left recursion alone Factoring the grammar alone Removing left recursion and factoring the grammar None of the above
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?Removing left recursion aloneFactoring the grammar aloneRemoving left recursion and factor...
Kathleen
27.0k
views
Kathleen
asked
Sep 16, 2014
Compiler Design
gatecse-2003
compiler-design
parsing
easy
+
–
37
votes
3
answers
8
GATE CSE 2008 | Question: 55
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if The SLR(1) parser for G has S-R conflicts The LR(1) parser for G has S-R conflicts The LR(0) parser for G has S-R conflicts The LALR(1) parser for G has reduce-reduce conflicts
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only ifThe SLR(1) parser for G has S-R conflictsThe LR(1) parser for G has S-R conflictsThe...
Kathleen
15.7k
views
Kathleen
asked
Sep 12, 2014
Compiler Design
gatecse-2008
compiler-design
parsing
normal
+
–
59
votes
3
answers
9
GATE CSE 2008 | Question: 11
Which of the following describes a handle (as applicable to LR-parsing) appropriately? It is the position in a sentential form where the next shift or reduce operation will occur It is non-terminal whose production will be used for reduction in the ... in the next step along with a position in the sentential form where the right hand side of the production may be found
Which of the following describes a handle (as applicable to LR-parsing) appropriately?It is the position in a sentential form where the next shift or reduce operation wil...
Kathleen
13.3k
views
Kathleen
asked
Sep 11, 2014
Compiler Design
gatecse-2008
compiler-design
parsing
normal
+
–
2
votes
2
answers
10
Is the following grammar LL(1) ?
Is the following grammar LL(1) ? S→ aABbCD | ϵ A→ ASd | ϵ B→ Sac| hC | ϵ C→ Sf |Cg D→ aBD | ϵ Draw the LL(1) parsing table for the given grammar.
Is the following grammar LL(1) ?S→ aABbCD | ϵA→ ASd | ϵB→ Sac| hC | ϵC→ Sf |CgD→ aBD | ϵDraw the LL(1) parsing table for the given grammar.
Subhrangsu
8.6k
views
Subhrangsu
asked
Apr 16, 2022
Compiler Design
compiler-design
parsing
grammar
+
–
37
votes
4
answers
11
GATE CSE 2005 | Question: 14
The grammar $A \rightarrow AA \mid (A) \mid \epsilon$ is not suitable for predictive-parsing because the grammar is: ambiguous left-recursive right-recursive an operator-grammar
The grammar $A \rightarrow AA \mid (A) \mid \epsilon$ is not suitable for predictive-parsing because the grammar is:ambiguousleft-recursiveright-recursivean operator-gram...
Kathleen
23.3k
views
Kathleen
asked
Sep 22, 2014
Compiler Design
gatecse-2005
compiler-design
parsing
grammar
easy
+
–
3
votes
2
answers
12
LL(1) Grammer
S -> (L) | a L -> L . S | S Question: Make necessary changes to make it suitable for LL(1) parsing and Construct FIRST and FOLLOW sets.
S - (L) | aL - L . S | SQuestion: Make necessary changes to make it suitable for LL(1) parsing and Construct FIRST and FOLLOW sets.
kyrierose
27.9k
views
kyrierose
asked
Jun 13, 2017
Compiler Design
compiler-design
grammar
ll-parser
parsing
+
–
56
votes
7
answers
13
GATE CSE 2005 | Question: 83a
Statement for Linked Answer Questions 83a & 83b: Consider the following expression grammar. The semantic rules for expression evaluation are stated next to each grammar production. ... a reduce action It detects shift-reduce conflict, and resolves the conflict in favor of a reduce over a shift action
Statement for Linked Answer Questions 83a & 83b:Consider the following expression grammar. The semantic rules for expression evaluation are stated next to each grammar pr...
Kathleen
20.2k
views
Kathleen
asked
Sep 22, 2014
Compiler Design
gatecse-2005
compiler-design
parsing
difficult
+
–
17
votes
3
answers
14
GATE CSE 2019 | Question: 19
Consider the grammar given below: $S \rightarrow Aa$ $A \rightarrow BD$ $B \rightarrow b \mid \epsilon $ $D \rightarrow d \mid \epsilon $ Let $a,b,d$ and $\$ be indexed as follows:$\begin{array}{|l|l|l|l|} \hline a & b & d & \$ \ ... $)$ , then the answer should be $3210$)
Consider the grammar given below:$S \rightarrow Aa$$A \rightarrow BD$$B \rightarrow b \mid \epsilon $$D \rightarrow d \mid \epsilon $Let $a,b,d$ and $\$$ be indexed as fo...
Arjun
20.0k
views
Arjun
asked
Feb 7, 2019
Compiler Design
gatecse-2019
numerical-answers
compiler-design
parsing
1-mark
+
–
4
votes
0
answers
15
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
852
views
GO Classes
asked
Feb 5
Compiler Design
goclasses2024-mockgate-14
numerical-answers
compiler-design
parsing
ll-parser
2-marks
+
–
4
votes
1
answer
16
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
718
views
GO Classes
asked
Jan 13
Compiler Design
goclasses2024-mockgate-11
goclasses
compiler-design
parsing
lr-parser
2-marks
+
–
4
votes
1
answer
17
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
263
views
GO Classes
asked
Feb 5
Compiler Design
goclasses2024-mockgate-14
compiler-design
parsing
2-marks
+
–
5
votes
1
answer
18
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
404
views
GO Classes
asked
Jan 21
Compiler Design
goclasses2024-mockgate-12
goclasses
compiler-design
parsing
ll-parser
2-marks
+
–
5
votes
1
answer
19
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
545
views
GO Classes
asked
Jan 21
Compiler Design
goclasses2024-mockgate-12
goclasses
compiler-design
parsing
first-and-follow
multiple-selects
1-mark
+
–
3
votes
1
answer
20
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
496
views
GO Classes
asked
Jan 13
Compiler Design
goclasses2024-mockgate-11
goclasses
compiler-design
parsing
lr-parser
multiple-selects
1-mark
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register