642 views
0 votes
0 votes

Compute FIRST and FOLLOW for each of the grammars of 

  1. $S\rightarrow 0S1\mid 01$ 
  2. $S\rightarrow +SS\mid \ast SS\mid a$ 
  3. $S\rightarrow S(S)S\mid \epsilon$ 
  4. $S\rightarrow S+S\mid SS\mid (S)\mid S\ast\mid a$
  5. $S\rightarrow (L)\mid a$ and $L\rightarrow L,S\mid S$ 
  6. $S\rightarrow aSbS\mid bSaS\mid\epsilon$ 
  7. The following grammar for boolean expressions:
  • $bexpr\:\rightarrow\:bexpr\:or\:bterm\mid bterm$
  • $bterm\:\rightarrow\:bterm\:and\:bfactor\mid bfactor$
  • $bfactor\:\rightarrow\:not\:bfactor\mid (bexpr)\mid true\mid false$

Please log in or register to answer this question.

Related questions

0 votes
0 votes
2 answers
1
0 votes
0 votes
0 answers
4
admin asked Aug 20, 2019
220 views
Is it possible, by modifying the grammar in any way, to construct a predictive parser for the language of $S\rightarrow SS + \mid SS {\ast} \mid a$ (postfix expressions w...