4 ms·
A good in-between option is a parser generator like Ragel ,http://www.colm.net/open-source/ragel/ http://www.colm.net/open-source/ragel/ This takes in the defi
by snops 8y ago
A good in-between option is a parser generator like Ragel ,http://www.colm.net/open-source/ragel/ http://www.colm.net/open-source/ragel/
This takes in the definition of a regular language as a set of regular expressions, and generates C code for finite state machine to parse the language. You can visualise the state machine in Graphviz to manually verify all paths, making it much easier to spot hidden corner cases, while being a lot quicker to code than a big pile of if statements.
- friend-monoid 8y agoBeen using ragel for a while now, it’s awesome. Ragel is a bit like the vim of parsing: the learning curve can be pretty steep, but once you get it, you’ll be the parser magician. Parsing in general just becomes pretty easy with ragel.