×

Elkhound

swMATH ID: 236
Software Authors: McPeak, Scott; Necula, George C.
Description: The Generalized LR (GLR) parsing algorithm is attractive for use in parsing programming languages because it is asymptotically efficient for typical grammars, and can parse with any context-free grammar, including ambiguous grammars. However, adoption of GLR has been slowed by high constant-factor overheads and the lack of a general, user-defined action interface.
In this paper we present algorithmic and implementation enhancements to GLR to solve these problems. First, we present a hybrid algorithm that chooses between GLR and ordinary LR on a token-by-token basis, thus achieving competitive performance for determinstic input fragments. Second, we describe a design for an action interface and a new worklist algorithm that can guarantee bottom-up execution of actions for acyclic grammars. These ideas are implemented in the Elkhound GLR parser generator.
To demonstrate the effectiveness of these techniques, we describe our experience using Elkhound to write a parser for C++, a language notorious for being difficult to parse. Our C++ parser is small (3500 lines), efficient and maintainable, employing a range of disambiguation strategies.
Homepage: http://scottmcpeak.com/elkhound/
Programming Languages: C++
Related Software: ATERM; BRNGLR; Chapel; Simula 67; NAS Parallel Benchmarks; CHARM++; eSkel; Eiffel; Smalltalk; ParoC++; XSugar; Locomotif; Infernal; dk.brics.automaton; Rfam; CDuce; Cecil; MOPS; BLAST; YACC
Referenced in: 7 Publications

Standard Articles

1 Publication describing the Software, including 1 Publication in zbMATH Year
Elkhound: A fast, practical GLR parser generator. Zbl 1125.68354
McPeak, Scott; Necula, George C.
2004

Referenced in 1 Field

7 Computer science (68-XX)

Referencing Publications by Year