Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: sniper mode (aka high fidelity code transformation) #1284

Closed
monperrus opened this issue May 5, 2017 · 11 comments · Fixed by #1927
Closed

feature: sniper mode (aka high fidelity code transformation) #1284

monperrus opened this issue May 5, 2017 · 11 comments · Fixed by #1927

Comments

@monperrus
Copy link
Collaborator

monperrus commented May 5, 2017

we only rewrite the changed nodes, keeping the original formatting.

see ROADMAP

@monperrus
Copy link
Collaborator Author

depends on #1168

@monperrus
Copy link
Collaborator Author

useful for repairnator and co

@tdurieux
Copy link
Collaborator

see #1358

@monperrus monperrus changed the title add support for sniper mode (only rewrites the changed nodes) feature: add support for sniper mode (only rewrites the changed nodes) Jan 17, 2018
@monperrus
Copy link
Collaborator Author

closed per #1927

@monperrus
Copy link
Collaborator Author

FYI:
An Algorithm for Layout Preservation in Refactoring Transformations
https://link.springer.com/chapter/10.1007/978-3-642-28830-2_3

@monperrus
Copy link
Collaborator Author

More papers on high-fidelity / layout preserving code transformation:

High-fidelity C/C++ code transformation (2017)
https://www.sciencedirect.com/science/article/pii/S0167642307000718/pdf

Detaching and reconstructing the documentary structure of source code (2010)
https://www.researchgate.net/profile/Gabor_Kusper/publication/284888833_ICAI2010-volume2/links/5659ad0408aeafc2aac4c23a/ICAI2010-volume2.pdf#page=401

Layout preserving parser for refactoring in Erlang (2009)
https://pdfs.semanticscholar.org/8487/eeda4c867e8f7cd13d83391488b2abec4a39.pdf

revcpp: A reversible c++ preprocessor (2015)
https://www.lrde.epita.fr/~sigoure/revcpp.pdf

Scrap you reprinter (2017)
https://www.cs.kent.ac.uk/people/staff/dao7/publ/reprinter2017.pdf

@monperrus
Copy link
Collaborator Author

monperrus commented Nov 7, 2019

Transformation tools with high-fidelity / layout preserving features (thanks to @jurgenvinju):

@jurgenvinju
Copy link

jurgenvinju commented Nov 7, 2019

Tools:

  • Clair is based on Rascal, provides concrete syntax matching for an external C++ parser

Relevant papers:

@jurgenvinju
Copy link

the paper which coined the term "hifi" transformation for "no loss of layout and source code comments":

"High Fidelity C/C++ Code Transformation" by Daniel Waddington and Bin Yao https://www.researchgate.net/publication/222998573_High-Fidelity_CC_Code_Transformation

@monperrus monperrus changed the title feature: add support for sniper mode (only rewrites the changed nodes) feature: sniper mode (aka high fidelity code transformation) Mar 6, 2020
@monperrus
Copy link
Collaborator Author

FYI, JavaParser calls this feature "lexical preservation", see @ftomassetti's post
https://tomassetti.me/lexical-preservation-javaparser/

@jlundhol
Copy link

This paper by Rodin T. A. Aarssen and Tijs van der Storm suggesting "Separator Syntax Trees" might be of interest:

High-fidelity metaprogramming with separator syntax trees (2020)
https://dl.acm.org/doi/abs/10.1145/3372884.3373162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants