Download PDF

Practical Aspects of Declarative Languages, Date: 2011/01/24 - 2011/01/25, Location: Austin, Texas, USA

Publication date: 2011-01-01
Volume: 6539 Pages: 84 - 98
ISSN: 978-3-642-18377-5
Publisher: Springer

Practical Aspects of Declarative Languages

Author:

Devriese, Dominique
Piessens, Frank

Keywords:

Science & Technology, Technology, Computer Science, Artificial Intelligence, Computer Science, Software Engineering, Computer Science, Theory & Methods, Computer Science, Context-Free Grammars, Haskell, grammar-combinators

Abstract:

We propose a novel context-free grammar representation for parsing libraries in a pure programming language. Our representation explicitizes the recursion in the grammar, thus avoiding fundamental limitations of the grammar model currently employed by parser combinator libraries. Additionally, we decouple the grammar from its semantic actions using techniques from the Multirec generic programming library. The look and feel of the grammar and semantic actions remain close to traditional EBNF and syntax-directed definitions respectively. In an accompanying technical report, we demonstrate that our representation supports more declarative implementations of grammar transformations than other work. The ideas described in this paper form the basis for our freely available grammar-combinators parsing library. © 2011 Springer-Verlag.