Modular grammar specification |
| |
Affiliation: | 1. Department of Computer Science, Royal Holloway, University of London, Egham, Surrey, United Kingdom;2. Eindhoven University of Technology, Mathematics and Computer Science, Den Dolech 2, NL-5612 AZ Eindhoven, The Netherlands |
| |
Abstract: | 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 |
本文献已被 ScienceDirect 等数据库收录! |
|