fix parser rule

This commit is contained in:
Tan, Kian-ting 2023-09-29 11:31:28 +08:00
parent d3447bfe84
commit 40a1652583

View file

@ -1,5 +1,8 @@
single = "(" expr ")" | int
fac1 = applier "(" int ")" | single
applier = expr
single = "(" expr ")" | int
args = single , args | single
callees = "(" args ")" | "(" ")"
facAux = callees facAux | callees
single facAux | single
fac = single facAux | single
term = fac | fac (MUL | DIV) fac
expr = term (ADD | SUB) term