A pure LuaJIT implementation of LPeg v1.0, a PEG pattern matching library for Lua, with added left recursion support.
LPegLJ is a pure LuaJIT implementation of LPeg v1.0, a library for Parsing Expression Grammar (PEG) pattern matching in Lua. It provides a complete parser toolkit that allows developers to define complex grammars and parse text efficiently while maintaining full compatibility with the original LPeg API. The project extends LPeg with additional features like left recursion support and stream parsing capabilities.
LuaJIT developers who need advanced text parsing capabilities, particularly those building compilers, interpreters, data processors, or domain-specific languages that require sophisticated grammar definitions.
Developers choose LPegLJ because it offers the proven LPeg API with enhanced features like left recursion support and stream parsing, all implemented efficiently in pure LuaJIT without external dependencies. It provides better performance and additional capabilities compared to standard LPeg while maintaining complete compatibility.
LPeg version 1.0 Parser in pure LuaJIT
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Maintains complete syntactical and functional backward compatibility with LPeg v1.0, allowing seamless migration of existing grammars without modification.
Adds direct and indirect left recursion based on Sérgio Medeiros' algorithm, enabling more expressive and natural grammar definitions for complex parsers.
Patterns can be serialized and loaded, as mentioned in the README, facilitating persistent grammar definitions and reuse across sessions.
Supports infinite parsing in stream mode, making it ideal for processing continuous data streams like logs or network protocols without memory overload.
Only works with LuaJIT 2.x, as stated in the README, which restricts its use in standard Lua or other Lua implementations, limiting portability.
Reimplements LPeg v1.0, so it may lack newer features, bug fixes, or performance improvements from subsequent releases of the original library.
Requires understanding of PEG concepts and LuaJIT specifics, with the README providing minimal tutorials, making it less accessible for beginners.