Restricting Grammars with Tree Automata
Channel: Splash Conference 2017
Date: 2017-11-04

Michael D. Adams, Matthew Might
Precedence and associativity declarations in systems like yacc resolve ambiguities in context-free grammars (CFGs) by specifying restrictions on allowed parses. However, they are special purpose and do not handle many other grammatical restrictions that language designers need in order to resolve ambiguities like dangling else, the interactions between binary operators and functional if expressions in ML, and the interactions between object allocation and function calls in JavaScript. Often, language designers resort to restructuring their grammars in order to encode these restrictions, but this obfuscates the designer's intent and makes grammars difficult to read, write, and maintain.