四則演算言語
こういう名前があるのかは知らない
code:arithmetic.ebnf
expr = mul ( "+" mul | "-" mul)*
mul = primary ( "*" primary | "/" primary )
primary = num | "(" expr ")"
単項演算子 + - を含む四則演算言語
code:arithmetic2.ebnf
expr = mul ("+" mul | "-" mul)*
mul = unary ("*" unary | "/" unary)*
unary = ("+" | "-")? primary
primary = num | "(" expr ")"