Search results for compiler

689
views
1 answers
5 votes
Consider the following grammar- ... .$\operatorname{First}(\mathrm{A})$ and $\operatorname{First}(\mathrm{T})$ are same.
707
views
1 answers
3 votes
A lexical analyzer uses the following patterns to recognize four tokens $\textsf{T1, T2, T3},$ and $\textsf{T4}$ over the alphabet $ \{a,b,c\}.$ ... outputs the token that matches the longest possible prefix.Rule$1$Rule$2$Rule$3$Rule$4$
632
views
1 answers
3 votes
Consider the syntax-directed translation given by the following grammar and semantic rules. Here, $S$ is the only non-terminal and $\Sigma=\{0,1,2\}$ is a ... The value computed by the translation scheme for the input string $201$ is $20.$
2.3k
views
2 answers
0 votes
Consider the following syntax-directed definition $\text{(SDD)}$.$S \rightarrow D H T U$ ... $ value computed by the $\text{SDD}$ (in the attribute $S.val$)?$45$50$55$65$
445
views
1 answers
4 votes
Consider the following grammar$\begin{aligned}& A \rightarrow B B \\& B \rightarrow b\end{aligned}$Suppose we draw an $\operatorname{LR}(0)$ ... state with $2$ incoming transitionsThere is exactly one state with $3$ outgoing transitions
595
views
1 answers
3 votes
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 ... generating any conflict.The parser may execute a shift operation without generating any conflict.
2.5k
views
1 answers
1 votes
Which of the following is/are Bottom-Up Parser(s)?Shift-reduce ParserPredictive ParserLL$(1)$ Parser LR Parser
450
views
1 answers
4 votes
Consider the following context-free grammar, with start symbol $S$ and terminals $a, ; , \lt , \gt .$ ... many different parse trees are there for the string $\lt \lt a \gt ;a\gt ?$
1.7k
views
1 answers
0 votes
Let $G=(V, \Sigma, S, P)$ be a context-free grammar in Chomsky Normal Form with $\Sigma=\{a, b, c\}$ and $V$ containing $10$ variable symbols ... number of steps (application of rules) in the derivation $S \rightarrow^* w$ is __________.
15.4k
views
7 answers
49 votes
Consider evaluating the following expression tree on a machine with load-store architecture in which memory can be accessed only through load and store instructions. The ... $9$5$3$
553
views
1 answers
2 votes
Consider the following grammar:$\begin{aligned}& S \rightarrow a S^{\prime} \\& S^{\prime} \rightarrow b S^{\prime} \mid \epsilon\end{aligned}$Which of the following is/are ... $bS'$a S^{\prime} b$bbS$
294
views
1 answers
0 votes
6. Generate code for the following C program using any code generation algorithm. [3 Marks] main() { int x, a, b, c, d, e; x= a + b -( c + d ) * e }
256
views
1 answers
0 votes
Q1. For the following grammar N -> AB | BA A -> a | CAC B -> b | CBC C -> a | b Find the FIRST and FOLLOW
170
views
1 answers
0 votes
18.4k
views
6 answers
37 votes
Which of the following statements is false?An unambiguous grammar has same leftmost and rightmost derivationAn LL(1) parser is a top-down parserLALR is more powerful than SLRAn ambiguous grammar can never be LR(k) for any k
181
views
1 answers
0 votes
Find the minimum number of total variables in SSA form:a = b + mm = a + ed = b + mb = a + e
592
views
3 answers
1 votes
$\text{ Find $\textbf{First(A)}$ and $\textbf{Follow(B)}$ }?$
137
views
0 answers
0 votes
Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | b
199
views
0 answers
0 votes
Please provide in detail solution step by step 5. Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | bPlease provid in detail solution step by step