in Compiler Design edited by
435 views
2 votes
2 votes
A->A*B                                   {1}

A->E                                       {A.val=E.val}

B->C+D                                  {2}

C->C-D                                   {C.val=D.val.+C.val}

D->D-E                                    {D.val=D.val+E..val}

E->E/F                                    {3}

F->G                                       {F.val=G.val}

A,B,C,D,E,F,G->id                  {A.val->id,B.val->id,C.val->id,D.val->id,E.val->id,F.val->id,G.val->id}

Fill 1 ,2 and 3 so that for:6*4-3-5/4+12 it outputs 32.
in Compiler Design edited by
435 views

4 Comments

I am not getting A.val=A.val/B.val part...
0
0
yes first one is wrong it should be B.val/A.val.
0
0

thanks a lot.. @Shubhgupta @Shobhit Joshi

0
0

Please log in or register to answer this question.