The rule above will match ANY postfix incrementation expression of ANY variable and replace it with a postfix decrementation expression. The metavariables are simple Java identifiers starting with "$". These act quite like groups in regular expressions. To make the rules more flexible, Jackpot introduces concept of meta-variables (wildcards). This one will match any consecutive postfix incrementations of i, j and k and replace them with code on the right. The rule above will match any postfix incrementation expression of any variable named "i" and replace it with a postfix decrementation expression. Every matched code structure is then replaced by corresponding code located at the right hand of the "=>" operator. Jackpot searches the code that matches the pattern on the left hand of the "=>" operator. The simplest case of a rule expressing a simple transform is : Java syntax to represent match-patterns and transformations. It introduces its own DSL that is quite straightforward to learn and use. Jackpot is an experimental tool for automated code transformations. The implementation will reuse Eclipse JDT Plugin: especially its JDT AST/DOM manipulation classes and ASTRewrite mechanism. It wouldn't be a straight port by copy-pasting its source and adapting into Eclipse environment. The goal of the project is to reimplement part of Jackpot functionality as an Eclipse plugin.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |