期刊论文详细信息
Open Computer Science 卷:9
Type errors for the IDE with Xtext and Xsemantics
Bettini Lorenzo1 
[1] Dipartimento di Statistica, Informatica, Applicazioni, Università di Firenze, ItalyFirenze;
关键词: language implementation;    type system;    ide;   
DOI  :  10.1515/comp-2019-0003
来源: DOAJ
【 摘 要 】

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.

【 授权许可】

Unknown   

  文献评价指标  
  下载次数:0次 浏览次数:0次