My first idea is to implement a new nonterminal inside operator which is basically each existing operator concatenated with the - operator, eg: +-, ÷- etc. This will handle expressions like 4 + -2 * -1.
Will need another solution for statements like x = -4, -5, 6
My first idea is to implement a new nonterminal inside
operator
which is basically each existing operator concatenated with the-
operator, eg:+-
,÷-
etc. This will handle expressions like4 + -2 * -1
.Will need another solution for statements like
x = -4, -5, 6