Closed suntong closed 2 years ago
well, found that problem still holds.
The BNF was written for a single expr
If you want multiple, then you need to add another rule, something like:
<exprs> ::= <expr> ";" <exprs>
| <expr>
You can also probably use newline instead of ;
if you remove the \n
from whitespace.
Ok, thanks for helping!
Is it possible to parse this as-is?
I'm not asking people to write a BNF parser for me but the question is on the
\n
. I.e., if I put it into!whitespace : ' ' | '\t' | '\n' | '\r' ;
then how can I reliably tell that one rule is finished and time to start a new one?
What are the best approaches to parse this? thx!