I don't understand this binary expression grammar
expr -> expr '+' term | expr '-' term | term term -> term '*' factor | term '/' factor | factor factor -> '(' expr ')' | NUM
In plain english:
An expr can be one of the following:
expr
+
term
-
A term can be one of the following:
*
factor
/
A factor can be one of the following:
(
)
In plain english:
An
expr
can be one of the following:expr
followed by the character+
followed by aterm
expr
followed by the character-
followed by aterm
term
A
term
can be one of the following:term
followed by the character*
followed by afactor
term
followed by the character/
followed by afactor
factor
A
factor
can be one of the following:(
followed by andexpr
followed by a character)