Document Type


Publication Date



Some programming languages allow the programmer to extend the language syntax; this language feature is called extensible syntax. In this paper, we use formal mathematics to illuminate the general question of what kinds of syntax extensions can be supported without introducing various forms of undesirable parsing behavior into the language. We define a parser as a function that maps each source string, finite set of CFG rules, and start symbol to a set of syntax trees (usually, a null set or singleton set); and construct well-behavedness criteria for parsers by considering how the behavior of a parser on one set of rules relates to its behavior on other, slightly different sets of rules. Among the results obtained are that there is a unique largest well-behaved completeness property supporting a universal parser, and that whether an ar- bitrary grammar satisfies this property is formally undecidable.