Modular grammar specification

A. Johnstone, E. Scott, M.G.J. Brand, van den

    Research output: Contribution to journalArticleAcademicpeer-review

    8 Citations (Scopus)
    5 Downloads (Pure)


    We establish a semantics for building grammars from a modularised specification in which modules are able to delete productions from imported nonterminals. 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. One of our goals is to allow a precise answer to the question: ‘what character level language does this grammar generate’ in the face of difficult issues such as the mutual embedding of languages that have different 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. Keywords: Context free grammar; Modularity; Whitespace processing
    Original languageEnglish
    Pages (from-to)23-43
    JournalScience of Computer Programming
    Publication statusPublished - 2014


    Dive into the research topics of 'Modular grammar specification'. Together they form a unique fingerprint.

    Cite this