Recent questions tagged tbb-cd-1

3 3 votes
2 answers 2 answers
1.8k
1.8k views
Consider the following grammar:$S \rightarrow L = P \mid P$$L \rightarrow ^*P \mid id$$P \rightarrow L$The above grammar is:AmbiguousSLR(1)LALR(1)None of the above
3 3 votes
1 answers 1 answer
622
622 views
Which grammar causes recursive-descent parser to go into infinite loop?LL(1)Left recursive grammarRight recursive grammarGrammar with left factors
3 3 votes
1 answers 1 answer
1.7k
1.7k views
Consider the following syntax directed definition of any desk calculator:$L \rightarrow En \{ \text{print}(E.val) \}$$E \rightarrow E1 + 1 \{ E.val = E1.val + Z.val \}$$E...
3 3 votes
0 0 answers
1.3k
1.3k views
$\textbf{goto}$ function of LR class of grammar is represented as:Deterministic Finite Automata transitionsNon-deterministic Finite Automata transitionsPDA transitionsPar...
3 3 votes
1 answers 1 answer
612
612 views
In compilers, the type checking is done in:Lexical AnalysisSemantic AnalysisCode Generation PhaseParsing Phase
3 3 votes
2 answers 2 answers
1.2k
1.2k views
Consider the following grammar:$S \rightarrow aMd \mid bNd \mid aNe \mid bMe$$M \rightarrow c$$N \rightarrow c$The grammar above is:LR(1) but not LALR(1)LALR(1) but no...
3 3 votes
1 answers 1 answer
1.1k
1.1k views
Consider the following grammar:$E \rightarrow E + T \mid T$$T \rightarrow T ^* F \mid F$$F \rightarrow (E) \mid id$What are the productions for E, T and F after convertin...
3 3 votes
1 answers 1 answer
609
609 views
Which one of the following statements is TRUE?SLR parser has more states than LALR parser.LALR parser has more states than Canonical LR.Canonical LR has fewer states than...
3 3 votes
1 answers 1 answer
553
553 views
The language which supports _______ needs heap allocation in the runtime environment.Dynamic Data Structure Static Scoping Global Variable Recursion
3 3 votes
1 answers 1 answer
2.5k
2.5k views
Which one of the following can be handled by predictive parsers?Left recursionLeft factorsAmbiguityNon-determinism
3 3 votes
1 1 answer
1.8k
1.8k views
The least number of temporary variables required to create a $3$ address code sequence for the statement $L= P + R$ is ________.
4 4 votes
2 answers 2 answers
685
685 views
Consider the following grammar:$Z \rightarrow TZ'$$Z' \rightarrow +TZ' \mid \epsilon$$T \rightarrow Y T '$$T ' \rightarrow ^* YT ' \mid \epsilon$$Y \rightarrow (Z) \mi...
3 3 votes
1 answers 1 answer
699
699 views
Assume that the SLR(1) parser for a grammar has P1 states, and the CLR(1) parser for the same has P2 states. Which of the following clearly depicts the relationship betwe...
2 2 votes
1 answers 1 answer
520
520 views
Which one of the following statements is TRUE?SLR parser is more powerful than LALR.LALR parser is more powerful than Canonical LR.Canonical LR is more powerful than LALR...
3 3 votes
1 1 answer
1.4k
1.4k views
Consider the following grammars:$S \rightarrow aS \mid Sa \mid \in$$E \rightarrow E +E \mid E^*E \mid id$$A \rightarrow AA \mid (A) \mid a$$S \rightarrow SS \mid AB, \ A...
2 2 votes
2 answers 2 answers
1.1k
1.1k views
Which of these is NOT true about Abstract Syntax Tree (AST)?An AST is usually the result of the syntax analysis phase of a compiler.AST has no impact on the final output...
2 2 votes
1 answers 1 answer
805
805 views
Consider the following grammar: $E' \rightarrow E$$E \rightarrow E + Y \mid Y$$Y \rightarrow Y ^* F \mid F$$F \rightarrow id \mid (E)$How many $LR(0)$ items are there in ...
3 3 votes
1 answers 1 answer
623
623 views
Consider following Translation Scheme:$S \rightarrow ER$$R \rightarrow ^* E \{ print \{' *' \}; \} R \mid \epsilon$$E \rightarrow F + E \{ print ('+');\} \mid F$$F \right...
2 2 votes
2 answers 2 answers
848
848 views
Read the below mentioned grammar:$S \rightarrow X$$X \rightarrow YX \mid \epsilon$$Y \rightarrow aY \mid b$This grammar is NOT:$LALR$$LR (0)$$LR(1)$None of the above
3 3 votes
1 answers 1 answer
563
563 views
In the construction of $LL(1)$ parsing table for the following grammar $M[S,( ] \& M [W, \$]$ are respectively$S \rightarrow XY$$X \rightarrow (S) \mid \text{ int } W$$Y\...
3 3 votes
1 answers 1 answer
770
770 views
The grammar which has no epsilon transition or two adjacent nonterminals in the right side of any production is ___________.LL(1) grammarUnambiguous grammarOperator gramm...
2 2 votes
1 answers 1 answer
486
486 views
___________ parsers build parse trees starting from the root node and work down to the leaves.LRLLSLRLALR
2 2 votes
2 2 answers
1.2k
1.2k views
Read the following grammar:$S \rightarrow Ka \mid bKc \mid dc \mid bda$$K \rightarrow d$This grammar is NOT:LALR(1)SLR(1)LR(1)None of the above
4 4 votes
1 answers 1 answer
1.3k
1.3k views
The number of proper prefixes for a string of length $n$ are ___________.$n+1$$n(n+1)/2$$n-1$$(n-1)/2$
3 3 votes
2 answers 2 answers
560
560 views
Consider the following grammars:$Z \rightarrow TZ'$$Z' \rightarrow ^* TZ' \mid \epsilon$$T \rightarrow YT'$$T ' \rightarrow ^*YT ' \mid \epsilon$$Y \rightarrow (Z) \mi...
2 2 votes
1 answers 1 answer
890
890 views
__________ is the most powerful parsing method.LL(1)LALRSLRCanonical LR
2 2 votes
1 answers 1 answer
578
578 views
A top-down parser generates ________________.right-most derivationright-most derivation in reverseleft-most derivationleft-most derivation in reverse
2 2 votes
1 answers 1 answer
1.1k
1.1k views
Consider the following two parse trees for the expression: $6 - 4 - 3$ list list / | \ ...
4 4 votes
1 answers 1 answer
1.2k
1.2k views
The default type of conflict resolution rule for the Yacc parser generator is _________________. in favor of shift in favor of reduce either shift or reduce depen...
3 3 votes
1 answers 1 answer
693
693 views
Match the following:$$\begin{array}{|l|l|l|l|} \hline a. & \text{Canonical Parser} & 1. & \text{No adjacent nonterminals} \\ \hline b. & \text{SLR(1) Parser} & 2. & \text...
To see more, click for the full list of questions or popular tags.