search
Log In

Recent questions tagged parsing

0 votes
1 answer
1
0 votes
1 answer
2
0 votes
1 answer
3
0 votes
4 answers
4
0 votes
0 answers
5
Implement Algorithm $3.23$, which converts a regular expression into a nondeterministic finite automaton, by an L-attributed SDD on a top-down parsable grammar. Assume that there is a token char representing any character, and that char.$lexval$ is the character it ... that is, a state never before returned by this function. Use any convenient notation to specify the transitions of the $NFA$.
asked Sep 6, 2019 in Compiler Design Lakshman Patel RJIT 169 views
1 vote
0 answers
6
In Fig. $4.56$ is a grammar for certain statements, similar to that discussed in Question $4.4.12$. Again, $e$ and $s$ are terminals standing for conditional expressions and "other statements," respectively. Build an LR parsing table for this grammar, resolving conflicts in the usual way ... your parser on the following inputs: if e then s ; if e then s end while e do begin s ; if e then s ; end
asked Aug 20, 2019 in Compiler Design Lakshman Patel RJIT 108 views
0 votes
0 answers
7
The following is an ambiguous grammar for expressions with $n$ binary, infix operators, at $n$ different levels of precedence: $E\rightarrow E\theta_{1}E\mid E\theta_{2}E\mid \cdot\cdot\cdot E\theta_{n}E\mid(E)\mid id$ ... of the tables for the two (ambiguous and unambiguous) grammars compare? What does that comparison tell you about the use of ambiguous expression grammars?
asked Aug 20, 2019 in Compiler Design Lakshman Patel RJIT 170 views
0 votes
1 answer
8
0 votes
0 answers
10
0 votes
0 answers
12
Consider the family of grammars $G_{n}$, defined by: $S\rightarrow A_{i}b_{i}$ for $1\leq i\leq n$ $A_{i} \rightarrow a_{j} A_{i}\mid a_{j}$ for $1\leq i,j\leq n$ and $i\neq j$ Show that: $G_{n}$, has $2n^{2}-n$ productions. $G_{n}$, has $2^{n} + n^{2} + n$ sets of $LR(0)$ items. $G_{n}$ is $SLR(1)$. What does this analysis say about how large $LR$ parsers can get?
asked Aug 20, 2019 in Compiler Design Lakshman Patel RJIT 102 views
0 votes
0 answers
15
For each of the (augmented) grammars of Question $4.2.2(a)-(g)$ : Construct the SLR sets of items and their GOTO function. Indicate any action conflicts in your sets of items. Construct the SLR-parsing table, if one exists.
asked Aug 20, 2019 in Compiler Design Lakshman Patel RJIT 48 views
1 vote
2 answers
17
In operator precedence parsing we have the rule that production cannot have two adjacent non-terminals or an epsilon production, so this production, S--> ab is allowed but not S--> AB, A->a and B->b, though they are giving us the same output. Why so?
asked Jun 14, 2019 in Compiler Design Hirak 322 views
0 votes
1 answer
18
S → aSbS /bSaS / ϵ S → aABb A→ c/ ϵ B → d/ ϵ Which of the following is LL1. Explain in details.
asked Jun 1, 2019 in Compiler Design Hirak 198 views
0 votes
0 answers
19
why do first sets can have epsilon symbol but follow sets don’t? P.S: I’ve a silly doubt :P
asked May 12, 2019 in Compiler Design aditi19 134 views
0 votes
1 answer
20
Use the exhaustive search parsing method to parse the string $abbbbbb$ with the grammar with productions $S\rightarrow aAB,$ $A\rightarrow bBb,$ $B\rightarrow A|\lambda.$ In general, how many rounds will be needed to parse any string $w$ in this language?
asked Apr 14, 2019 in Theory of Computation Naveen Kumar 3 87 views
0 votes
1 answer
21
Can lookahead symbol be epsilon in LR(1) parsing? and pls give the LR(1) diagram for the following grammar? A->AB | a B->*AC | Cb | ∈ C->+ABc | ∈
asked Mar 26, 2019 in Compiler Design aditi19 286 views
0 votes
1 answer
22
is it always true or not??? STATEMENT → in LR(0) Parsing i1 is a final state,there is a shift move. it always give S/R conflict. Explain with example.
asked Feb 8, 2019 in Compiler Design sandeep singh gaur 112 views
8 votes
3 answers
23
Which one of the following kinds of derivation is used by LR parsers? Leftmost Leftmost in reverse Rightmost Rightmost in reverse
asked Feb 7, 2019 in Compiler Design Arjun 4.4k views
10 votes
3 answers
24
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 & \$ \\ \hline 3 & 2 & 1 & ... $)$ , then the answer should be $3210$)
asked Feb 7, 2019 in Compiler Design Arjun 8k views
4 votes
2 answers
25
Which of the following statements is FALSE? Any DCFL has an equivalent grammar that can be parsed by a SLR(1) parser with end string delimiter Languages of grammars parsed by LR(2) parsers is a strict super set of the languages of grammars parsed by LR(1) parsers Languages of ... of grammars parsed by LL(1) parsers There is no DCFL which is not having a grammar that can be parsed by a LR(1) parser
asked Jan 26, 2019 in Compiler Design Arjun 762 views
2 votes
2 answers
26
Which of the following statements regarding $LR(0)$ parser is FALSE? A $LR(0)$ configurating set cannot have multiple reduce items A $LR(0)$ configurating set cannot have both shift as well as reduce items If a reduce item is present in a $LR(0)$ configurating set it cannot have any other item A $LR(0)$ parser can parse any regular grammar
asked Jan 26, 2019 in Compiler Design Arjun 404 views
2 votes
2 answers
27
Which of the following sentences regarding Viable prefixes is/are CORRECT? Viable prefixes is the set of prefixes of right-sentential forms that can appear on the stack of a shift-reduce parser Viable prefixes is the set of prefixes of right-sentential forms that do not extend past the end of the ... prefixes can be recognized using a DFA Only (i) Only (ii) Only (i) and (ii) (i), (ii) and (iii)
asked Jan 26, 2019 in Compiler Design Arjun 448 views
3 votes
1 answer
28
Which of the following is TRUE regarding LL(0) grammar? We can have a LL(0) grammar for any regular language We can have a LL(0) grammar for a regular language only if it does not contain empty string We can have a LL(0) grammar for any regular language if and only if it has prefix property We can have a LL(0) grammar for only single string languages
asked Jan 26, 2019 in Compiler Design Arjun 403 views
3 votes
1 answer
29
Match the following: $\begin{array}{|cc|cc|} \hline (i) &LL(1)&(A)& \text{bottom-up} \\ \hline (ii)& \text{Recursive Descent}& (B) &\text{Predictive} \\ \hline (iii) &\text{Recursive Ascent}& (C)& \text{Top-down} \\ \hline (iv) &LR(1) &(D)& \text{Deterministic CFL} \\ \hline \end{array}$ i-b; ii-c; iii-a; iv-d i-d; ii-a; iii-c; iv-d i-c; ii-b; iii-d; iv-a i-a; ii-c; iii-b; iv-d
asked Jan 26, 2019 in Compiler Design Arjun 337 views
0 votes
1 answer
30
If we have more than 1 parse tree,but one is LMD and other is RMD , Is Grammar Ambiguous? There are no other parse tree other than these two.
asked Jan 25, 2019 in Compiler Design Reshu $ingh 147 views
...