Deprecated: Implicit conversion from float-string "1547396018.054" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1547396018.054" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1547396018.054" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1547396018.054" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1547396018.054" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1547396215.526" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1547396215.526" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1547396215.526" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1547396215.526" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1547396215.526" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1547396460.458" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1547396460.458" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1547396460.458" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1547396460.458" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1547396460.458" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1547397330.868" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1547397330.868" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1547397330.868" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1547397330.868" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1547397330.868" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1546263121.075" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1546263121.075" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1546263121.075" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1546263121.075" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1546263121.075" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1547399297.853" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1547399297.853" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1547399297.853" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1547399297.853" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1547399297.853" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594
Compiler Design: UPPCL AE 2018:70
edited by
834 views
2 votes
2 votes

Consider the following grammar $\text{G:}$

  • $\text{P} \rightarrow \text{Q + R} \mid \text{Q – R} \mid \text{Q} \mid \text{R}$
  • $\text{Q} \rightarrow q \mid r$
  • $\text{R} \rightarrow r \mid s$

where $\text{P, Q,}$ and $\text{R}$ are non-terminal symbols, and $q,r,$ and $s$ are terminal symbols. Which of the following statement(s) is/are correct?

$\text{S1.  LL(1)}$ can parse all strings that are generated using grammar $\text{G}$

$\text{S2.  LR(1)}$ can parse all strings that are generated using grammar $\text{G}$

  1. Neither $\text{S1}$ nor $\text{S2}$ 
  2. Only $\text{S1}$ 
  3. Only $\text{S2}$ 
  4. Both $\text{S1}$ and $\text{S2}$
edited by

2 Answers

0 votes
0 votes
The Grammar is Ambigous.

P->Q->q

P->R->q

So none must be the answer.
0 votes
0 votes
this grammer is ambigous because its have more than one parse tree for r so that its not both

ans is (a) should be correcct.
Answer:

Related questions


Deprecated: Implicit conversion from float-string "1546663287.115" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1546663287.115" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1546663287.115" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1546663287.115" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1546667775.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1546667775.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1546667775.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1546667775.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1546665065.209" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1546665065.209" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1546665065.209" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1546665065.209" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1546664976.871" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1546664976.871" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1546664976.871" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1546664976.871" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803
611
views
2 answers
1 votes
admin asked Jan 5, 2019
611 views
Which of the following statements are $\text{TRUE}$?Top-down parsers are equipped to handle left recursive grammar.$\text{LALR}$ parser is more powerful than an $\text{SL...
365
views
1 answers
0 votes
admin asked Jan 5, 2019
365 views
The following grammar $\text{G}$ is left recursive.$\text{E} \rightarrow \text{E + T}\; \mid \; \text{T} $$\text{T} \rightarrow \text{T * F} \; \mid \; \text{F} $$\text{F...
251
views
0 answers
1 votes
admin asked Jan 5, 2019
251 views
Match all items in Group $1$ with correct options from those given in Group $2.$$$\begin{array} {|l|l|} \hline \qquad \qquad \textbf{Group 1} & \qquad \textbf{Group 2} \\...
267
views
0 answers
1 votes
admin asked Jan 5, 2019
267 views
Which phase during compilation does a compiler recognize the $\textbf{keywords}$ of a language?Code generationParsingDataflow analysisLexical analysis