4 ms·
I didn't roll my own parser generator, I used LPeg: http://www.inf.puc-rio.br/~roberto/lpeg/ http://www.inf.puc-rio.br/~roberto/lpeg/ It's a great library, I h
by leafo 14y ago
I didn't roll my own parser generator, I used LPeg: http://www.inf.puc-rio.br/~roberto/lpeg/ http://www.inf.puc-rio.br/~roberto/lpeg/
It's a great library, I highly recommend it.
I've assembled a few parsers using various tools, and I must say PEGs are my favorite. They are very flexible and performance is comparable. (even CoffeeScript 2.0 is being written with a PEG.)
You can check out the guts of the parser here: https://github.com/leafo/moonscript/blob/master/moonscript/parse.lua#L377 https://github.com/leafo/moonscript/blob/master/moonscript/p...
- lukegru 14y agoAh, ok cool. I haven't tried using PEGs and I don't even know the theory behind it, so I'm watching a video [1] by the author of LPEG now, which is quite good. Cheers! [1] http://vimeo.com/1485123 http://vimeo.com/1485123