Open kajvans opened 2 years ago
how do i make it that 5(2+3) works as 5(2+3) and (2+3)5 as (2+3)5 so that if a number is directly connected to a parentheses it multiplies with the end value of the parentheses
You can try to implement this grammar rule for the term:
term : factor ((MUL|DIV) factor)* : factor LPAREN expr RPAREN
how do i make it that 5(2+3) works as 5(2+3) and (2+3)5 as (2+3)5 so that if a number is directly connected to a parentheses it multiplies with the end value of the parentheses