1 If X is a terminal then FutsrX X 2 If X is a nonterminal a
     1. If X is a terminal, then Futsr(X) (X). 2. If X is a nonterminal and X YIY Y is a production for some k 21, then place a in FIRST(X) if for some i, a is in and eis in all of for all j 1.2. that is, Yi Yi-14 e. If e is in in FIRST(ii) k, then add Eto FIRST(X). For example, everything nothing is surely in FIRST(X). If Yi does not derive e, then we add more to FIRST(X) but if Yi c, then we add FIRST(Ya), and 3. If X eis a production, then add e to FIRSTtX). Computation of FOLLOW O 1. Place s in FOLLow (S), where S is the start symbol, and s is the input right end marker. 2. is a production A aBA, then everything in FIRST(a except is in FOLLow(B). 3. If there is a production A aB, or a production A aBs, where FIRST(B) contains e, then everything in FouLow(A) is in FouLow(B. Algorithm 4.31: Construction of a predictive parsing table. INPUT: Grammar G. OUTPUT: Parsing table M. METHoD: For each production A a of the grammar, do the following: 1. For each terminal a in FIRST(A), add A a to MA, a. 2. If is in FIRST(a), then for each terminal b in FOLLow(A), add A a to MLA, b. If e is in FIRST (a) and s is in FOLLow(A), add A a to MIA, as well. Elimination of left-recursion Algorithm 4.19 (p. 213) Step 1: Group the A-production as A Aal Aa2 Aa3 where Bi\'s don\'t contain A\'s. by Step 2: Replace the A-production  
  
  Solution
Answer:
A -------> AXYz | Az | z | By
We have an algorithm :
A ---> A alpha | beta
A ---> beta A\'
A\' ---> Epsilon/ A\'
Here in the given problem A = AXYz , alpha = Az , beta = By
Now,
A----> AXYzaz |By
A----> By (AXYzaz)\'
(AXYzaz)\' ----> epsilon / (AXYzaz)\'
A ----> z

