OCCompilerASTPlugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OCCompilerASTPlugin

SergeStinckwich
I have one question about Opal Compiler.

I would like do an AST transformation before using the compiler. If I
understand correctly, I have to built a subclass of
OCCompilerASTPlugin ? Is it correct ?
Any documentation more update about Opal than this :
https://github.com/SquareBracketAssociates/PharoLimbo/tree/master/Opal
Thank you.

--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/

Reply | Threaded
Open this post in threaded view
|

Re: OCCompilerASTPlugin

Marcus Denker-4

> On 04 Sep 2016, at 20:48, Serge Stinckwich <[hidden email]> wrote:
>
> I have one question about Opal Compiler.
>
> I would like do an AST transformation before using the compiler. If I
> understand correctly, I have to built a subclass of
> OCCompilerASTPlugin ? Is it correct ?

Yes. See the example ASTPluginMeaningOfLife

Plugins are not active by default, you need to compile with a compiler that includes your plugin.
e.g. add on the class side

compiler
        "the example plugin is active for this class"
        ^super compiler addPlugin: ASTPluginMeaningOfLife.

to enable it for this hierarchy.
 ( see ASTTransformExamplePluginActive )


> Any documentation more update about Opal than this :
> https://github.com/SquareBracketAssociates/PharoLimbo/tree/master/Opal

There is the paper: https://marcusdenker.de/publications/Bera13a-OpalIWST.pdf

But it is not a tutorial.

        Marcus