Modular grammar specification. / Johnstone, Adrian; Scott, Elizabeth; van den Brand, Mark.

In: Science of Computer Programming, Vol. 87, 01.07.2014, p. 23-43.

Research output: Contribution to journalArticlepeer-review

Published

Documents

Links

Abstract

We establish a semantics for building grammars from a modularised speci-
cation in which modules are able to delete productions from imported nonterminals.
Our goal is to allow a precise answer to the question: `what character
level language does this grammar generate' in the face of dicult issues such
as the mutual embedding of languages that have dierent whitespace and
commenting conventions. Our technique is to automatically generate a character
level grammar from grammars written at token level in the conventional
way; the grammar is constructed from modules each of which may have its
own whitespace convention. Modules have import lists of nonterminals; some
or all of an imported nonterminal's productions may be suppressed at import
time. There are two basic import mechanisms which (a) reference or
(b) clone an imported nonterminal's productions. We conclude with a set
of examples using the concrete syntax from our ART GLL parser generator
tool.
Original languageEnglish
Pages (from-to)23-43
Number of pages21
JournalScience of Computer Programming
Volume87
Early online date1 Oct 2013
DOIs
Publication statusPublished - 1 Jul 2014
This open access research output is licenced under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

ID: 10009872