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
followed by the character +
followed by a term
expr
followed by the character -
followed by a term
term
A term
can be one of the following:
term
followed by the character *
followed by a factor
term
followed by the character /
followed by a factor
factor
A factor
can be one of the following:
(
followed by and expr
followed by a character )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.