Type errors for the IDE with Xtext and Xsemantics

2Citations
Citations of this article
11Readers
Mendeley users who have this article in their library.

Abstract

Providing IDE support for a programming language or a DSL (Domain Specific Language) helps the users of the language to be more productive and to have an immediate feedback on possible errors in a program. Static types can drive IDE mechanisms such as the content assist to propose sensible completions in a given program context. Types can also be used to enrich other typical IDE parts such as the Outline and theHovering pop-ups. In this paper, we focus on statically typed imperative languages, adopting some form of type inference. We present a few general patterns for implementing efficient type systems, focusing on type error recovery. This way, the type system is able to type as many parts of the program as possible, keeping a good IDE experience. Type error messages will be placed on the important parts of the program, avoiding cascading errors that can confuse the user. We show two case studies:we apply the presented patterns to implement the type system of two statically typed DSLs, a simple expression language and a reduced Java-like language, with OOP features. We use Xtext as the language workbench for implementing the compiler and the IDE support andXsemantics, a DSL for implementing type systems using a syntax that mimics formal systems. The patterns shown in the paper can be reused also for implementing languages with other language frameworks.

Cite

CITATION STYLE

APA

Bettini, L. (2019). Type errors for the IDE with Xtext and Xsemantics. Open Computer Science, 9(1), 52–79. https://doi.org/10.1515/comp-2019-0003

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free