1 research outputs found

    Complexity of extended vs classic LR parsers

    No full text
    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
    corecore