search
Log In
0 votes
304 views
An umambiguous grammar has same right most and left most derivation>??

True or false.?
in Compiler Design
reopened by
304 views
0
true
0
Unambigiuos grammar dont have same LMD and RMD rt???
0
ohh...I thought about parse tree. SOrry. Its false.

2 Answers

0 votes
If any grammar has more than 1 LMD or more than 1 RMD or more than 1 parse tree that will be an ambiuous grammar.SO if grammar is unabiguous it must have only 1 LMD or 1RMD or 1 parse tree.

So here every umbiguous grammar has only 1 LMD and 1 RMD means both must be equal because if it is not it will be ambiguous.

 TRUE
0 votes
ambiguous means only one parse tree so it means  that left recursive most derivative and right most derivation will be same

Related questions

9 votes
2 answers
1
1.4k views
1. If a grammar is LL(1), then it has to be LALR(1).Is it correct?? 2. Is there anything called as LL(0)?? 3. Do every DCFL has LL(1) grammar?? 4. Do every DCFL has LR(1) grammar?? 5. Can someone please specify, As we can say that every regular language is LL(1), what can we say for CFL,CSL,Recursive and RE?? 6. What is the difference between parse tree, syntax tree and abstract syntax tree?
asked Jan 20, 2017 in Compiler Design Lucky sunda 1.4k views
0 votes
0 answers
2
108 views
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 108 views
1 vote
0 answers
3
81 views
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 81 views
0 votes
0 answers
4
115 views
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 115 views
...