While doing some AI tests, I got the following python script for to create counter = counter + 1:
increment = Assignment.create(
counter_ref.copy(),
# counter = counter + 1
counter_ref.copy()
+ Literal("1", INTEGER_TYPE) # Ooops :)
)
Now obviously that doesn't work, but it's rather trivial to support this in PSyclone by adding:
def __add__(self, other):
return BinaryOperation.create(BinaryOperation.Operator.ADD,
self, other)
to DataNode. It would obviously need proper testing of other (and might even be able to support counter_ref.copy() + 1???), but could easily be added for some binary (+-*/ mod and power at least?) operations.
While doing some AI tests, I got the following python script for to create
counter = counter + 1:Now obviously that doesn't work, but it's rather trivial to support this in PSyclone by adding:
to
DataNode. It would obviously need proper testing ofother(and might even be able to supportcounter_ref.copy() + 1???), but could easily be added for some binary (+-*/ mod and powerat least?) operations.