A Reflexive and Automated Approach to ...
Type de document :
Communication dans un congrès avec actes
DOI :
Titre :
A Reflexive and Automated Approach to Syntactic Pattern Matching in Code Transformations
Auteur(s) :
Lecerf, Jason [Auteur]
Laboratoire d'Intégration des Systèmes et des Technologies [LIST (CEA)]
Brant, John [Auteur]
RefactoryWorkers
Goubier, Thierry [Auteur]
Laboratoire d'Intégration des Systèmes et des Technologies [LIST (CEA)]
Ducasse, Stephane [Auteur]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Laboratoire d'Intégration des Systèmes et des Technologies [LIST (CEA)]
Brant, John [Auteur]
RefactoryWorkers
Goubier, Thierry [Auteur]
Laboratoire d'Intégration des Systèmes et des Technologies [LIST (CEA)]
Ducasse, Stephane [Auteur]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Titre de la manifestation scientifique :
ICSME 2018 - 34th IEEE International Conference on Software Maintenance and Evolution
Ville :
Madrid
Pays :
Espagne
Date de début de la manifestation scientifique :
2018-09-23
Titre de la revue :
ICSME 2018 - 34th IEEE International Conference on Software Maintenance and Evolution
Mot(s)-clé(s) en anglais :
code templates
pattern matching
syntactic patterns
parser generation
GLR parsing
pattern matching
syntactic patterns
parser generation
GLR parsing
Discipline(s) HAL :
Informatique [cs]/Langage de programmation [cs.PL]
Résumé en anglais : [en]
Empowering software engineers often requires to let them write code transformations. However existing automated or tool-supported approaches force developers to have a detailed knowledge of the internal representation of ...
Lire la suite >Empowering software engineers often requires to let them write code transformations. However existing automated or tool-supported approaches force developers to have a detailed knowledge of the internal representation of the underlying tool. While this knowledge is time consuming to master, the syntax of the language, on the other hand, is already well known to developers and can serve as a strong foundation for pattern matching. Pattern languages with metavariables (that is variables holding abstract syntax subtrees once the pattern has been matched) have been used to help programmers define program transformations at the language syntax level. The question raised is then the engineering cost of metavariable support. Our contribution is to show that, with a GLR parser, such patterns with metavariables can be supported by using a form of runtime reflexivity on the parser internal structures. This approach allows one to directly implement such patterns on any parser generated by a parser generation framework, without asking the pattern writer to learn the AST structure and node types. As a use case for that approach we describe the implementation built on top of the SmaCC (Smalltalk Compiler Compiler) GLR parser generator framework. This approach has been used in production for source code transformations on a large scale. We will express perspectives to adapt this approach to other types of parsing technologies.Lire moins >
Lire la suite >Empowering software engineers often requires to let them write code transformations. However existing automated or tool-supported approaches force developers to have a detailed knowledge of the internal representation of the underlying tool. While this knowledge is time consuming to master, the syntax of the language, on the other hand, is already well known to developers and can serve as a strong foundation for pattern matching. Pattern languages with metavariables (that is variables holding abstract syntax subtrees once the pattern has been matched) have been used to help programmers define program transformations at the language syntax level. The question raised is then the engineering cost of metavariable support. Our contribution is to show that, with a GLR parser, such patterns with metavariables can be supported by using a form of runtime reflexivity on the parser internal structures. This approach allows one to directly implement such patterns on any parser generated by a parser generation framework, without asking the pattern writer to learn the AST structure and node types. As a use case for that approach we describe the implementation built on top of the SmaCC (Smalltalk Compiler Compiler) GLR parser generator framework. This approach has been used in production for source code transformations on a large scale. We will express perspectives to adapt this approach to other types of parsing technologies.Lire moins >
Langue :
Anglais
Comité de lecture :
Oui
Audience :
Internationale
Vulgarisation :
Non
Collections :
Source :
Fichiers
- https://hal.archives-ouvertes.fr/hal-01851857/document
- Accès libre
- Accéder au document
- https://hal.archives-ouvertes.fr/hal-01851857/document
- Accès libre
- Accéder au document
- https://hal.archives-ouvertes.fr/hal-01851857/document
- Accès libre
- Accéder au document
- document
- Accès libre
- Accéder au document
- reflexiveparsing.pdf
- Accès libre
- Accéder au document
- reflexiveparsing.pdf
- Accès libre
- Accéder au document