A Graphical Model for Context-Free Grammar Parsing

被引:0
|
作者
Pingali, Keshav [1 ]
Bilardi, Gianfranco [2 ]
机构
[1] Univ Texas Austin, Austin, TX 78712 USA
[2] Univ Padua, I-35131 Padua, Italy
来源
关键词
All Open Access; Bronze;
D O I
10.1007/978-3-662-46663-6_1
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
In the compiler literature, parsing algorithms for context-free grammars are presented using string rewriting systems or abstract machines such as pushdown automata. Unfortunately, the resulting descriptions can be baroque, and even a basic understanding of some parsing algorithms, such as Earley's algorithm for general context-free grammars, can be elusive. In this paper, we present a graphical representation of context-free grammars called the Grammar Flow Graph (GFG) that permits parsing problems to be phrased as path problems in graphs; intuitively, the GFG plays the same role for context-free grammars that nondeterministic finite-state automata play for regular grammars. We show that the GFG permits an elementary treatment of Earley's algorithm that is much easier to understand than previous descriptions of this algorithm. In addition, look-ahead computation can be expressed as a simple inter-procedural dataflow analysis problem, providing an unexpected link between front-end and back-end technologies in compilers. These results suggest that the GFG can be a new foundation for the study of context-free grammars.
引用
收藏
页码:3 / 27
页数:25
相关论文
共 50 条
  • [21] NON CONTEXT-FREE GRAMMAR FORMS
    MAURER, HA
    PENTTONEN, M
    SALOMAA, A
    WOOD, D
    MATHEMATICAL SYSTEMS THEORY, 1979, 12 (04): : 297 - 324
  • [22] EQUATIONS ASSOCIATED WITH A CONTEXT-FREE GRAMMAR
    COARDOS, V
    KYBERNETIKA, 1979, 15 (04) : 253 - 260
  • [23] Functional chart parsing of context-free grammars
    Ljunglöf, P
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2004, 14 : 669 - 680
  • [24] A Formal Model for Behavior Trees Based on Context-Free Grammar
    Anwer, Sajid
    Wen, Lian
    Wang, Zhe
    2020 27TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2020), 2020, : 465 - 469
  • [25] Certified CYK parsing of context-free languages
    Firsov, Denis
    Uustalu, Tarmo
    JOURNAL OF LOGICAL AND ALGEBRAIC METHODS IN PROGRAMMING, 2014, 83 (5-6) : 459 - 468
  • [26] A stochastic context-free grammar model for time series analysis
    Wang, W.
    Portnoy, V.
    Pollak, L.
    2007 IEEE INTERNATIONAL CONFERENCE ON ACOUSTICS, SPEECH, AND SIGNAL PROCESSING, VOL III, PTS 1-3, PROCEEDINGS, 2007, : 1245 - +
  • [27] Past systolic parsing of context-free languages
    Barsan, C
    Evans, DJ
    INTERNATIONAL JOURNAL OF COMPUTER MATHEMATICS, 1996, 60 (3-4) : 171 - 181
  • [28] CONTEXT-FREE PARSING ON O(N) PROCESSORS
    BARNARD, DT
    SKILLICORN, DB
    COMPUTER LANGUAGES, 1992, 17 (01): : 61 - 66
  • [29] SEMANTICALLY DRIVEN PARSING OF CONTEXT-FREE LANGUAGES
    SIDERI, M
    EFREMIDIS, S
    PAPAKONSTANTINOU, G
    COMPUTER JOURNAL, 1989, 32 (01): : 91 - 93
  • [30] SUBSTRING PARSING FOR ARBITRARY CONTEXT-FREE GRAMMARS
    REKERS, J
    KOORN, W
    SIGPLAN NOTICES, 1991, 26 (05): : 59 - 66