GLL: Generalised LL
Recursive Descent (RD) parsers are popular because their control flow follows the structure of the grammar and hence they are easy to write and to debug. However, the class of grammars which admit RD parsers is very limited. Backtracking techniques may be used to extend this class, but can have explosive run-times and cannot deal with grammars with left recursion. Tomita-style
RNGLR
parsers are fully general but are based onLR
techniques and do not have the direct relationship with the grammar that an RD parser has. We develop the fully generalGLL
parsing technique which is recursive descent-like, and has the property that the parse follows closely the structure of the grammar rules, but usesRNGLR
-like machinery to handle non-determinism. The resulting recognisers run in worst-case cubic time and can be built even for left recursive grammars.
Implementations
Haskel
- gll-combinators
- fungll-combinators
- Happy-GLL
Scala
- gll-combinators
- Iguana
Java
- A Reference GLL Implementation