B
Balaji
Hello Eveybody,
I have written a method which prints the prefix notation of any expression.
here is the method...
def PrintPrefix(expr):
if expr.__class__==E:
print expr.operator,
PrintPrefix(expr.left),
PrintPrefix(expr.right),
else:
print expr,
Now if i pass an expression to it like e1=x+y+z:
I call it by passing PrintPrefix(e1):
The output is ++xyz
now i want to store this in a string...
Can anyone help....
Balaji
I have written a method which prints the prefix notation of any expression.
here is the method...
def PrintPrefix(expr):
if expr.__class__==E:
print expr.operator,
PrintPrefix(expr.left),
PrintPrefix(expr.right),
else:
print expr,
Now if i pass an expression to it like e1=x+y+z:
I call it by passing PrintPrefix(e1):
The output is ++xyz
now i want to store this in a string...
Can anyone help....
Balaji