218 views
0 votes
0 votes
Consider the following SDT:

 C -> C+S   {C.val= __________(1)}

C -> S         {C.val=S.val}

S -> S*E     {S.val=__________(2)}

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

E ->id          {E.val=id.num}  

What is the missing translation (1) and (2), if the string "2 * 3 + 5 * 3 + 1 * 3" produces 160 instead of 24?

 

#  * means multiplication  #

Please log in or register to answer this question.

Related questions

1 votes
1 votes
0 answers
1
Soumya Tiwari asked Jan 26, 2019
248 views
1 votes
1 votes
1 answer
2
1 votes
1 votes
0 answers
3
Shankar Kakde asked Jan 16, 2019
232 views
0 votes
0 votes
0 answers
4
Shadan Karim asked Dec 29, 2018
503 views
S→ SABCA→ aAd/ϵB→ bB/ϵC→ Cc/Be/ϵNumber of elements in the follow(S) are __________