Feb. 28, 2015
3:18 p.m.
A simple AST-transformer plugin architecture for Opal... -> subclass OCCompilerASTPlugin -> implement #transform e.g. transform | rule | rule := RBParseTreeRewriter replaceLiteral: 42 with: 'meaning of life'. rule executeTree: ast. ^ast The plugin can be activated *per class hierarchy* by overriding #compiler compiler "the example plugin is active for this class" ^super compiler addPlugin: ASTPluginMeaningOfLife. or of course for a single compilation: (Smalltalk compiler addPlugin: ASTPluginMeaningOfLife) evaluate: â42â For review here: https://pharo.fogbugz.com/f/cases/15019/Compiler-AST-transformation-Plugins Marcus