Backtracking techniques which are often used to extend recursive descent (RD) parsers can have explosive run-times and cannot deal with grammars with left recursion. GLL parsers are fully general, worst-case cubic parsers which have the recursive descent-like property that they are easy to write and to use for grammar debugging. They have the direct relationship with the grammar that an RD parser has. In this paper we give an algorithm for generating GLL parsers which build an SPPF representation of the derivations of the input, complementing our existing GLL recognition algorithm, and we show that such parsers and recognisers are worst-case cubic. Key words: generalised parsing, recursive descent, GLL parsing, RNGLR and RIGLR parsing, context free languages In this paper we present the GLL (Generalised LL) parsing algorithm which handles any context free grammar, including those with ambiguity, and which we shall prove has worst-case cubic performance. The algorithm has the 'recursively decent' property: parsers may be constructed straightforwardly by hand directly from the grammar, and the resulting parsers may easily be traced using a conventional language debugger because they have a straightforward relationship with the grammar itself. This simple mapping between grammar rules and parser fragments allows programmers to think operationally about grammars whilst retaining the declarative nature of the grammar specification. In this respect GLL parsers are significantly different to approaches based on backtracking and lookahead extensions of deterministic parsers [13, 14, 1, 24, 9, 5] including algorithms such as
Scott and Johnstone [14] , REF showed GLL parsing, which is an algorithm for generating a generalized parser using LL parsing.
GLL parse-tree generation
Sci. Comput. Program.
Sci. Comput. Program.
Computer Science