Complexity of Extended vs. Classic LR Parsers
For the deterministic context-free languages, we compare the space and time complexity of their LR (1) parsers, constructed in two different ways: the classic method by Knuth  for BNF grammars, and the recent one by the authors , which directly builds the parser from EBNF grammars represented as transition networks. For the EBNF grammars, the classic Knuth’s method is indirect as it needs to convert them to BNF. We describe two parametric families of formal languages indexed by the number of stars, which exhibit a linear growth of the parser size (number of states) in passing from the classic to our novel direct methods. Experimental measurements of the number of parser states and of the parsing speed for two real languages (Java and JSON) confirm the advantage of the new direct parser model for EBNF grammars.
KeywordsExtended BNF grammar EBNF LR (1) ELR (1) transition network TN shift-reduce bottom-up parser parsing performance
Unable to display preview. Download preview PDF.