i have those rules to build a simple calculator :
statement -> assignment | calculation
assignment -> variable '=' sum end
calculation -> sum end
sum -> product (('+' product)|('-' product))*
product -> factor (('*' factor)|('/' factor))*
factor -> term
term -> variable | number
My problem is how to model the rules for :
Postfix Increment Postfix Decrement PrefixI increment Prefix Decrement
How can represent it in this grammar above
so for example if i have the assignment :
x=1
j=x++ +2
the result will be :
j=3 and i=2
how to do post Increment after assignment