Redirected
retagged by
1,111 views
2 votes
2 votes
Trailing symbols of E

E -> E + T | T

T -> T * F | F

F -> (E) | id
retagged by

3 Answers

1 votes
1 votes
edited by
0 votes
0 votes
Terminal first follow
E (,id $,+,)
T (,id $,+,),*
F (,id $,+,),*
0 votes
0 votes

 Trail : Any terminal which is present at the last of a right sentential form (and not the sentence) which is derived from a non-terminal is the trailing of that non-terminal.

Trail(E) :

E→E+   --In this the trailing is '+'

E→E+TF [using T→T∗F] -- Here trailing is '∗'

E→E+T∗(E) [using F→(E)Here trailing is ')'

(from E+T∗F) →E+T∗id [using F→id] -- Here trailing is 'id'

therefore

trail(E) = {+,∗,),id}

Similarly for T={ * , id, )}

E→ E+T

       E+T*F     or  E→E+T*id

       E+T*(E)

 for F={ id, )}

E→ E+T

       E+T*F

       E+T*(E      or   E+T*id

edited by

Related questions

0 votes
0 votes
0 answers
1
Ana_101 asked 4 hours ago
5 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 votes
0 votes
1 answer
2
Ana_101 asked 6 hours ago
17 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
5 votes
5 votes
1 answer
3
GO Classes asked Jan 21
601 views
Consider the following grammar-$$\begin{aligned}& S \rightarrow b T \\& T \rightarrow A b \mid B a \\& A \rightarrow a S \mid C B \\& B \rightarrow b D \\& C \rightarrow ...