Xtext is a framework for the development of languages, which also generates all the typical and recurrent artifacts for a fully-fledged IDE on top of Eclipse. The validation (e.g., checking the correctness of programs from the point of view of types) of languages developed in Xtext has to be implemented by the programmer writing Java code. In this paper we present XTypeS (Xtext TypeSystem), a DSL for writing the type system for an Xtext language. A type system definition in XTypeS is a set of rules which act on the elements of the AST of a program, which in Xtext is represented by an EMF model. Then, XTypeS will generate the corresponding Java code that can be used to implement the validation part for a language developed in Xtext. We describe the features of XTypeS by writing the type system of two languages implemented in Xtext: Featherweight Java and lambda-calculus.
A DSL for Writing Type Systems for Xtext Languages / Lorenzo Bettini. - STAMPA. - (2011), pp. 31-40. (Intervento presentato al convegno Principles and Practice of Programming in Java tenutosi a Kongens Lyngby, Denmark nel August 24-26, 2011) [10.1145/2093157.2093163].
A DSL for Writing Type Systems for Xtext Languages
BETTINI, LORENZO
2011
Abstract
Xtext is a framework for the development of languages, which also generates all the typical and recurrent artifacts for a fully-fledged IDE on top of Eclipse. The validation (e.g., checking the correctness of programs from the point of view of types) of languages developed in Xtext has to be implemented by the programmer writing Java code. In this paper we present XTypeS (Xtext TypeSystem), a DSL for writing the type system for an Xtext language. A type system definition in XTypeS is a set of rules which act on the elements of the AST of a program, which in Xtext is represented by an EMF model. Then, XTypeS will generate the corresponding Java code that can be used to implement the validation part for a language developed in Xtext. We describe the features of XTypeS by writing the type system of two languages implemented in Xtext: Featherweight Java and lambda-calculus.I documenti in FLORE sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.