Create Syntax-directed translation of delete extra parentheses, for the language specified by the grammar:
1. S::=E
2. E::=E+T
3. E::=T
4. T::=T*F
5. T::=F
6. F::=a
7. F::=b
8. F::=(E)
S โ axiom
in | out |
---|---|
((a)) | a |
((a))+((b)) | a+b |
((a)+a)*(b+b)*((a)) | (a+a)*(b+b)*a |
a) | syntax error |