Exercise 5:

Expressions over binary + and -
The set of tokens of the language is {+,-,NUMBER}. The token NUMBER represents unsigned integers, i.e., non-empty sequences of digits. Recall that 4,1+2,1-2,3+4-1+2 are correct but +, 1+, ++, -1 2, +4 are not. The generated AST must correspond to an interpretation of both + and - as a left-associative operator. For example, for input 1+2-3-4 the resulting AST must be -(-(+(1,2),3),4), i.e., like if the implicit parenthesization was ((1+2)-3)-4.
Authors: Pau Fernández / Documentation:
To be able to submit you need to either log in, register, or become a guest.