Leftry

A left recursion enabled recursive-descent parser combinator library.

$ luarocks install --server=https://luarocks.org/dev leftry

This library is for creating and composing parsers.

For example:

```
local grammar = require("leftry")
local factor = grammar.factor
local span = grammar.span
local A = factor("A", function(A) return
span(A, "1"), "1"
end)
local B = factor("B", function(B) return
span(B, "2"), A
end)
print(B("111122222", 1))
```

This creates a parser `B` that can parse the string "111122222".

Versions

scm-3dev7 years ago1,352 downloads
scm-2dev7 years ago1,339 downloads
scm-1dev8 years ago81 downloads

Dependencies

lua >= 5.2

Manifests