3 ms·
In case you didn't know yet, a BNF grammar always is a graph. So the diagram is just a different way of depicting the same thing. For example, the (E)BNF¹ for
by rednab 11y ago
In case you didn't know yet, a BNF grammar always is a graph. So the diagram is just a different way of depicting the same thing.
For example, the (E)BNF¹ for the graph in the article is:
expr = term { ("+" | "-") term }
where the accolades indicate zero-or-more repetition.
This actually is important because if your grammar can be written down as a graph it means it is a context-free grammar².
Parsing is a wonderful subject to study thanks to the depth of the subject and the breath of texts available explaining it. Have fun!
¹) https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_F...
²) https://en.wikipedia.org/wiki/Context-free_grammar https://en.wikipedia.org/wiki/Context-free_grammar
- varlock 11y agoI honestly didn't know! Thanks for the pointers!