Groovy ASTDemystified       Andres AlmirayCanoo Engineering AG
About the Speaker¡  Java developer since the beginning¡  True believer in Open Source¡  Groovy committer since 2007¡  ...
Agenda¡  AST, How did we get here?¡  AST Transformations¡  Building your own AST
AST,how did we get here?
AST Transformations
G	E	   E	V	   N	I	   I	L	   U	       S
Standard Groovy Distro includes:¡  @EqualsAndHashCode     ¡  @AutoClone¡  @ToString              ¡  @AutoExternalize¡...
Standard Groovy Distro includes:¡  @Bindable               ¡  @Log¡  @Vetoable               ¡  @Slf4j¡  @ListenerLis...
Groovy Ecosystem brings:¡  @ByteCode        ¡  Griffon                       ¡  @EventPublisher¡  @Scalify            ...
Global AST transformations¡  Groovy – Grab¡  Grails – GORM API¡  Griffon – Threading injection¡  Spock – the whole she...
Building your own              AST
Local AST Transformation1.  Define an @interface  ¡  Easy peasy … right?2.  Define AST implementation  ¡  huh ……3.  Prof...
Global AST Transformation1.  Define AST implementation  ¡  ??? !!! ??? !!!2.  Add AST implementation entry to  ¡  META-I...
Additional Tools¡  AST browser¡  AST Builder
Thank You!                @aalmirayandres.almiray@canoo.com
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Groovy AST Demystified
Upcoming SlideShare
Loading in …5
×

Groovy AST Demystified

1,707 views

Published on

Groovy AST Demystified

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,707
On SlideShare
0
From Embeds
0
Number of Embeds
42
Actions
Shares
0
Downloads
20
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Groovy AST Demystified

  1. 1. Groovy ASTDemystified Andres AlmirayCanoo Engineering AG
  2. 2. About the Speaker¡  Java developer since the beginning¡  True believer in Open Source¡  Groovy committer since 2007¡  Project lead of the Griffon framework¡  Currently working for
  3. 3. Agenda¡  AST, How did we get here?¡  AST Transformations¡  Building your own AST
  4. 4. AST,how did we get here?
  5. 5. AST Transformations
  6. 6. G E E V N I I L U S
  7. 7. Standard Groovy Distro includes:¡  @EqualsAndHashCode ¡  @AutoClone¡  @ToString ¡  @AutoExternalize¡  @TupleConstructor ¡  @Synchronized¡  @Canonical ¡  @Field¡  @InheritConstructors ¡  @Grab¡  @IndexedProperty ¡  @GrabResolver¡  @Lazy ¡  @CompileStatic¡  @PackageScope ¡  @TypeChecked¡  @NotYetImplemented
  8. 8. Standard Groovy Distro includes:¡  @Bindable ¡  @Log¡  @Vetoable ¡  @Slf4j¡  @ListenerList ¡  @Log4j¡  @ConditionalInterrupt ¡  @Commons¡  @ThreadInterrupt ¡  @Singleton¡  @TimedInterrupt ¡  @Immutable¡  @WithReadLock ¡  @Delegate¡  @WithWriteLock ¡  @Category¡  @Newify ¡  @Mixin
  9. 9. Groovy Ecosystem brings:¡  @ByteCode ¡  Griffon ¡  @EventPublisher¡  @Scalify ¡  @Threading¡  GContracts ¡  @PropertyListener ¡  @Invariant ¡  @MVCAware ¡  @Requires ¡  @MessageSourceAware ¡  @Ensures ¡  @ResourceResolverAware¡  Grails ¡  @ResourcesAware ¡  @Entity ¡  @ThreadingAware ¡  @TestFor
  10. 10. Global AST transformations¡  Groovy – Grab¡  Grails – GORM API¡  Griffon – Threading injection¡  Spock – the whole shebang
  11. 11. Building your own AST
  12. 12. Local AST Transformation1.  Define an @interface ¡  Easy peasy … right?2.  Define AST implementation ¡  huh ……3.  Profit!
  13. 13. Global AST Transformation1.  Define AST implementation ¡  ??? !!! ??? !!!2.  Add AST implementation entry to ¡  META-INF/services/ org.codehaus.groovy.transform.ASTTransformation3.  Profit!
  14. 14. Additional Tools¡  AST browser¡  AST Builder
  15. 15. Thank You! @aalmirayandres.almiray@canoo.com

×