4 ms·
PEG for Lua is pretty easy to use and experiment with: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html
by pederb72 16y ago
PEG for Lua is pretty easy to use and experiment with: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html
- _tef 16y agonotably: lpeg uses backtracking over packrat parsing
- fanf2 16y agoPackrat parsing has fairly horrible memory usage. LPEG is amazingly frugal in terms of code size, run time, and memory usage. It's worth noting that the PEG ordered choice operator leads to much more restricted backtracking than occurs in most regex implementations, so LPEG has much more predictable performance. And unlike a DFA matched you still get straightforward capture handling.