A Reflexive and Automated Approach to ...
Document type :
Communication dans un congrès avec actes
DOI :
Title :
A Reflexive and Automated Approach to Syntactic Pattern Matching in Code Transformations
Author(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]
Conference title :
ICSME 2018 - 34th IEEE International Conference on Software Maintenance and Evolution
City :
Madrid
Country :
Espagne
Start date of the conference :
2018-09-23
Journal title :
ICSME 2018 - 34th IEEE International Conference on Software Maintenance and Evolution
English keyword(s) :
code templates
pattern matching
syntactic patterns
parser generation
GLR parsing
pattern matching
syntactic patterns
parser generation
GLR parsing
HAL domain(s) :
Informatique [cs]/Langage de programmation [cs.PL]
English abstract : [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 ...
Show more >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.Show less >
Show more >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.Show less >
Language :
Anglais
Peer reviewed article :
Oui
Audience :
Internationale
Popular science :
Non
Collections :
Source :
Files
- https://hal.archives-ouvertes.fr/hal-01851857/document
- Open access
- Access the document
- https://hal.archives-ouvertes.fr/hal-01851857/document
- Open access
- Access the document
- https://hal.archives-ouvertes.fr/hal-01851857/document
- Open access
- Access the document
- document
- Open access
- Access the document
- reflexiveparsing.pdf
- Open access
- Access the document
- reflexiveparsing.pdf
- Open access
- Access the document