Let the grammar g fornbsp arithmetic expressions as


Let the Grammar G for  arithmetic expressions as follows:

1.      E àE + T

2.      E àE - T

3.      EàT

4.      T à T*F

5.      T à T/F

6.      T à F

7.      F ài

8.      F à (E)

            Where "i" stands for an identifier .

The above grammar looks as below after the left recursions have been removed. 

The Parse table (Lecture 5/slide 58) is given below:

 

401_12.png

Using the following parse table,  parse the following arithmetic expression:

(i*i + i*i + i*i) / i

Print out the contents of the stacktop and the input buffer in each step (Lecture 5/Slide 68). 

 

1294_123.png

509_10.png

Solution Preview :

Prepared by a verified Expert
Chemistry: Let the grammar g fornbsp arithmetic expressions as
Reference No:- TGS01276654

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)