Recent questions tagged first-and-follow

3 3 votes
3 3 answers
507
507 views
Which of the following statement(s) is/are FALSE while computing $\textbf{FIRST}$ and $\textbf{FOLLOW}$ sets for a Context-Free Grammar?If $X \rightarrow \alpha$ is a pro...
0 0 votes
1 1 answer
283
283 views
Consider the Grammar:$\begin{array}{l}\mathrm{T} \rightarrow \mathrm{Q} x \\\mathrm{Q} \rightarrow \mathrm{RS} \\\mathrm{R} \rightarrow \mathrm{y} \mid \varepsilon \\\mat...
1 1 vote
1 1 answer
277
277 views
How many of the following are TRUE regarding construction of $\text{FIRST(X)}$ for a grammar symbol $\mathrm{X}?$ If $\text{X}$ is a terminal, then $\text{FIRST(X)}$ is $...
21 21 votes
4 4 answers
6.7k
6.7k views
Which of the following statement(s) is/are TRUE while computing $\operatorname{First}$ and $\operatorname{Follow}$ during top down parsing by a compiler?For a production ...
1 1 vote
1 answers 1 answer
1.2k
1.2k views
14. Compute FIRST and FOLLOW for the following grammar S->AS, S->b, A->SA, A- a
2 2 votes
1 1 answer
341
341 views
Help me find the correct look ahead symbols for LR(1) parserHi!I have this grammar: S - E E - E + (E) E - intWhat will be First Canonical item or state will be g...
0 0 votes
1 1 answer
1.3k
1.3k views
Find First and Follow for the following grammar:S→A C B |CbB |BaA → da| BCB → g | εC→ h | ε
0 0 votes
2 answers 2 answers
636
636 views
Find the first and follow of given grammar $S->A$$A - AB|\epsilon$$B->aB|b$
0 0 votes
1 1 answer
478
478 views
Which of the following are present in FIRST(S) ∩ FIRST(F)?S → EE → Ff | GhF → ef | Gh | ϵG → Gg | ϵ A) {e, f, g, h} B). {e, f, h, ϵ}C). {e, g, h, ϵ}D). {...
1 1 vote
1 1 answer
475
475 views
Consider the following grammar: Prog → {S} S→ Prog X; | Y = z; X →ϵ |S Prog Y → SZ Z→id Determine follow(S) from the above grammar. (A) { } , id} (B) { }, ϵ , id} (...
0 0 votes
2 2 answers
747
747 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
0 0 votes
2 2 answers
624
624 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
20 20 votes
2 answers 2 answers
12.3k
12.3k views
Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by $(1), (2)$, and $(3)$.$$\begin{aligned} & S ...
1 1 vote
3 answers 3 answers
1.6k
1.6k views
$\text{ Find $\textbf{First(A)}$ and $\textbf{Follow(B)}$ }?$
0 0 votes
1 1 answer
431
431 views
Does Follow and First operation always apply on non left recursive grammar?