zl90 / Cornell-CS4120

I'm taking Cornell University's "Introduction to Compilers" course
5 stars 0 forks source link

Figure out how to parse negative integers #28

Closed zl90 closed 11 months ago

zl90 commented 11 months ago

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