Type qualifiers as composable language extensions for code analysis and generation

Travis Carlson, Eric Van Wyk

Research output: Contribution to journalArticlepeer-review

1 Scopus citations

Abstract

The work presented here reformulates type qualifiers as composable language extensions that can be automatically and reliably composed by the end-user programmer. Type expressions can be annotated with type qualifiers to specify new subtyping relations that are expressive enough to detect many kinds of programming errors. Type qualifiers, as illustrated in our ABLEC extensible language framework for C, can also introduce rich forms of concrete syntax, can generate dynamic checks on data when static checks are infeasible or not appropriate, and can inject generated code that affects program behavior, for example to log or display program execution or for the run-time conversion of data. The ABLEC framework and extensions to it are implemented using context-free grammars and attribute grammars. This provides an expressive mechanism for type qualifier implementations to check for additional errors, e.g.dereferences to pointers not qualified by a “nonnull” qualifier, and generate custom and informative error messages. This approach distinguishes programmers that use language extensions from language engineers that develop extensions. The framework provides modular analyses that extension developers use to ensure that their extension will compose with other extensions that all pass these analyses. Thus, when a programmer selects a set of extensions to use they will automatically and reliably compose to form a working translator for the extended language.

Original languageEnglish (US)
Pages (from-to)49-69
Number of pages21
JournalJournal of Visual Languages and Computing
Volume50
DOIs
StatePublished - Feb 2019

Bibliographical note

Publisher Copyright:
© 2018

Keywords

  • Extensible languages
  • Pluggable types
  • Type qualifiers
  • Type systems

Fingerprint

Dive into the research topics of 'Type qualifiers as composable language extensions for code analysis and generation'. Together they form a unique fingerprint.

Cite this