let’s say Expr = 1+2. and I want this Expr in parenthesis, what should I do in order to have this unification?
NewExpr = (1+2).
How can I make this NewExpr out from old Expr?
(ps: if you are interested – I’m doing a prefix to infix conversion)
Well, if you manipulate terms, the problem is that
1 + 2is equivalent to(1 + 2). So you won’t find a good solution I guess.Though, that should not bother you since if you put that
Exprinto a more complicated term, the parenthesis will indeed be added accordingly.If you don’t know the
=../2operator, you can read more about it here.