Scripting A Refactoring With Rascal And Eclipse

Mark Hills 1 Paul Klint 1 Jurgen Vinju 1
1 ATEAMS - Analysis and Transformation based on rEliAble tool coMpositionS
Inria Lille - Nord Europe, CWI - Centrum Wiskunde & Informatica
Abstract : To facilitate experimentation with creating new, complex refactorings, we want to reuse existing transformation and analysis code as orchestrated parts of a larger refactoring: i.e., to script refactorings. The language we use to perform this scripting must be able to deal with the diversity of languages, tools, analyses, and transformations that arise in practice. To illustrate one solution to this problem, in this paper we describe, in detail, a specific refactoring script for switching from the Visitor design pattern to the Interpreter design pattern. This script, written in the meta-programming language Rascal, and targeting an interpreter written in Java, extracts facts from the interpreter code using the Eclipse JDT, performs the needed analysis in Rascal, and then transforms the interpreter code using a combination of Rascal code and existing JDT refactorings. Using this script we illustrate how a new, real and complex refactoring can be scripted in a few hundred lines of code and within a short timeframe. We believe the key to successfully building such refactorings is the ability to pair existing tools, focused on specific languages, with general-purpose meta-programming languages.
Type de document :
Communication dans un congrès
Sommerlad, P. Proceedings of the 5th Workshop on Refactoring Tools 2012, Jun 2012, Rapperswil, Switzerland. ACM, pp.40 - 49, 2012
Liste complète des métadonnées

https://hal.inria.fr/hal-00756879
Contributeur : Jurgen Vinju <>
Soumis le : vendredi 23 novembre 2012 - 22:05:10
Dernière modification le : mercredi 14 décembre 2016 - 01:07:09

Identifiants

  • HAL Id : hal-00756879, version 1

Collections

Citation

Mark Hills, Paul Klint, Jurgen Vinju. Scripting A Refactoring With Rascal And Eclipse. Sommerlad, P. Proceedings of the 5th Workshop on Refactoring Tools 2012, Jun 2012, Rapperswil, Switzerland. ACM, pp.40 - 49, 2012. 〈hal-00756879〉

Partager

Métriques

Consultations de la notice

190