On LR(k)-Parsers of Polynomial Size

被引:0
|
作者
Blum, Norbert [1 ]
机构
[1] Univ Bonn, D-53117 Bonn, Germany
关键词
D O I
暂无
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Usually, a parser for an LR(k)-grammar G is a deterministic pushdown transducer winch produces backwards the unique rightmost derivation for a given input string x is an element of L(G). The best known upper bound for the size of such a parser is O(2(vertical bar G vertical bar vertical bar Sigma vertical bar k+1)) where vertical bar G vertical bar and vertical bar Sigma vertical bar are the sizes of the grammar G and the terminal alphabet Sigma, respectively. If we add to a parser the possibility to manipulate a directed graph of size O(vertical bar G vertical bar n) where n is the length of the input then we obtain an extended parser. The graph is used for an efficient parallel simulation of all potential leftmost derivations of the current right sentential form such that the unique rightmost derivation of the input can be computed. Given an arbitrary LR(k)-grammar G, we show how to construct an extended parser of O(vertical bar G vertical bar + #LA vertical bar N vertical bar 2(k) k log k) size where vertical bar N vertical bar is the number of nonterminal symbols and #LA is the number of possible lookaheads with respect to the grammar G. As the usual parser, this extended parser uses only tables as data structure. Using some ingenious data structures and increasing the parsing time by a small constant factor, the size of the extended parser can be reduced to O(vertical bar G vertical bar + #LA vertical bar N vertical bar k(2)). The parsing time is O(ld(input) + k vertical bar G vertical bar n) where ld(input) is the length of the derivation of the input. Moreover, we have constructed a one pass parser.
引用
收藏
页码:163 / 174
页数:12
相关论文
共 50 条
  • [41] On different LL and LR parsers used in LLLR parsing
    Slivnik, Bostjan
    COMPUTER LANGUAGES SYSTEMS & STRUCTURES, 2017, 50 : 108 - 126
  • [42] Efficient controlling of parsing-stack operation for LR parsers
    Fuketa, M
    Morita, K
    Lee, S
    Aoe, J
    INFORMATION SCIENCES, 1999, 118 (1-4) : 145 - 157
  • [43] HOW TO BUILD LR PARSERS WHICH ACCEPT INCOMPLETE INPUT
    SNELTING, G
    SIGPLAN NOTICES, 1990, 25 (04): : 51 - 58
  • [44] CONSTRUCTING LR-PARSERS FOR REGULAR RIGHT PART GRAMMARS
    LALONDE, WR
    ACTA INFORMATICA, 1979, 11 (02) : 177 - 193
  • [45] Grammar-Constrained Neural Semantic Parsing with LR Parsers
    Baranowski, Artur
    Hochgeschwender, Nico
    FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, ACL-IJCNLP 2021, 2021, : 1275 - 1279
  • [46] ON THE SPACE OPTIMIZING EFFECT OF ELIMINATING SINGLE PRODUCTIONS FROM LR PARSERS
    SOISALONSOININEN, E
    ACTA INFORMATICA, 1980, 14 (02) : 157 - 174
  • [47] A SIMPLE REALIZATION OF LR-PARSERS FOR REGULAR RIGHT PART GRAMMARS
    SASSA, M
    NAKATA, I
    INFORMATION PROCESSING LETTERS, 1987, 24 (02) : 113 - 120
  • [48] A GENERAL-MODEL FOR FIXED LOOK-AHEAD LR PARSERS
    BERMUDEZ, ME
    SCHIMPF, KM
    INTERNATIONAL JOURNAL OF COMPUTER MATHEMATICS, 1988, 24 (3-4) : 237 - 271
  • [49] Lr inequalities for the derivative of a polynomial
    Devi, Khangembam Babina
    Krishnadas, Kshetrimayum
    Chanam, Barchand
    NOTE DI MATEMATICA, 2021, 41 (02): : 19 - 29
  • [50] Combining LAPIS and WordNet for the learning of LR parsers with optimal semantic constraints
    Kazakov, D
    INDUCTIVE LOGIC PROGRAMMING, 1999, 1634 : 140 - 151