University of Minnesota
Software Engineering Center

You are here

Adding Syntax and Static Analysis to Libraries via Extensible Compilers and Language Extensions

Date of Publication: 
October 2006
Associated Research Groups: 
Publication Files: 
We show how new syntactic forms and static analysis can be added to a programming language to support abstractions provided by libraries. Libraries have the important characteristic that programmers can use multiple libraries in a single program. Thus, any attempt to extend a language's syntax and analysis should be done in a composable manner so that similar extensions that support other libraries can be used by the programmer in the same program. To accomplish this we have developed an extensible attribute grammar specification of Java 1.4 written in the attribute grammar specification language Silver. Library writers can specify, as an attribute grammar, new syntax and analysis that extends the language and supports their library. The Silver tools automatically compose the grammars defining the language and the programmer-selected language extensions (for their chosen libraries) into a specification for a new custom language that has language-level support for the libraries. We demonstrate how syntax and analysis are added to a language by extending Java with syntax from the query language SQL and static analysis of these constructs so that syntax and type errors in SQL queries can be detected at compile-time.
LCSD 2006 - Library Centric Software Development Workshop
@inproceedings{vanwyk06lcsd, author = "Van Wyk, E. and Bodin, D. and Huntington, P.", title = "Adding Syntax and Static Analysis to Libraries via Extensible Compilers and Language Extensions", booktitle = "Proc. of LCSD 2006, Library-Centric Software Design", year = 2006, }