Generation of LR parsers by partial evaluation

被引:4
|
作者
Sperber, M
Thiemann, P
机构
[1] Univ Tubingen, Wilhelm Schickard Inst Informat, D-72076 Tubingen, Germany
[2] Univ Freiburg, Inst Informat, D-79110 Freiburg, Germany
来源
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS | 2000年 / 22卷 / 02期
关键词
algorithms; experimentation; languages; performance; continuations; functional programming; LR parsing; parser generation; partial evaluation;
D O I
10.1145/349214.349219
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The combination of modern programming languages and partial evaluation yields new approaches to old problems. In particular, the combination of functional programming and partial evaluation can turn a general parser into a parser generator. We use an inherently functional approach to implement general LR(k) parsers and specialize them with respect to the input grammars using offline partial evaluation. The functional specification of LR parsing yields a concise implementation of the algorithms themselves. Furthermore, we demonstrate the elegance of the functional approach by incorporating on-the-fly attribute evaluation for S-attributed grammars and two schemes for error recovery, which lend themselves to natural and elegant implementation. The parsers require only minor changes to achieve good specialization results. The generated parsers have production quality and match those produced by traditional parser generators in speed and compactness.
引用
收藏
页码:224 / 264
页数:41
相关论文
共 50 条
  • [31] INCREMENTAL GENERATION OF PARSERS
    HEERING, J
    KLINT, P
    REKERS, J
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1990, 16 (12) : 1344 - 1351
  • [32] Generation of incremental parsers
    Vilares, M
    Alonso, MA
    Darriba, VM
    COMPUTATIONAL LINGUISTICS AND INTELLIGENT TEXT PROCESSING, PROCEEDINGS, 2003, 2588 : 191 - 202
  • [33] GENERATING LR(1) PARSERS OF SMALL-SIZE
    GALVEZ, JF
    LECTURE NOTES IN COMPUTER SCIENCE, 1992, 641 : 16 - 29
  • [34] UPPER-BOUNDS ON THE SIZE OF LR(K) PARSERS
    UKKONEN, E
    INFORMATION PROCESSING LETTERS, 1985, 20 (02) : 99 - 103
  • [35] PRACTICAL GENERAL METHOD FOR CONSTRUCTING LR(K) PARSERS
    PAGER, D
    ACTA INFORMATICA, 1977, 7 (03) : 249 - 268
  • [37] Complexity of Extended vs. Classic LR Parsers
    Borsotti, Angelo
    Breveglieri, Luca
    Reghizzi, Stefano Crespi
    Morzenti, Angelo
    DESCRIPTIONAL COMPLEXITY OF FORMAL SYSTEMS, DCFS 2014, 2014, 8614 : 77 - 89
  • [38] On different LL and LR parsers used in LLLR parsing
    Slivnik, Bostjan
    COMPUTER LANGUAGES SYSTEMS & STRUCTURES, 2017, 50 : 108 - 126
  • [39] 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
  • [40] HOW TO BUILD LR PARSERS WHICH ACCEPT INCOMPLETE INPUT
    SNELTING, G
    SIGPLAN NOTICES, 1990, 25 (04): : 51 - 58