Groovy AST Demyistified - 33degree

1,396 views

Published on

Groovy AST Demyistified - 33degree

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,396
On SlideShare
0
From Embeds
0
Number of Embeds
204
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Groovy AST Demyistified - 33degree

  1. 1. Andres  Almiray   @aalmiray  Groovy ASTDemystified
  2. 2. ABOUT THE SPEAKERJava developer since the beginningTrue believer in Open SourceGroovy committer since 2007Project lead of the Griffon frameworkCurrently working for
  3. 3. AGENDAAST, How did we get here?AST TransformationsBuilding your own AST
  4. 4. AST,HOW DIDWE GETHERE?
  5. 5. ASTTRANSFORMATIONS
  6. 6. G E E V N I I L U S
  7. 7. STANDARD GROOVYDISTRO INCLUDES:*  @EqualsAndHashCode *  @AutoClone*  @ToString *  @AutoExternalize*  @TupleConstructor *  @Synchronized*  @Canonical *  @Field*  @InheritConstructors *  @Grab*  @IndexedProperty *  @GrabResolver*  @Lazy *  @CompileStatic*  @PackageScope *  @TypeChecked*  @NotYetImplemented
  8. 8. STANDARD GROOVYDISTRO INCLUDES:*  @Bindable *  @Log*  @Vetoable *  @Slf4j*  @ListenerList *  @Log4j*  @ConditionalInterrupt *  @Commons*  @ThreadInterrupt *  @Singleton*  @TimedInterrupt *  @Immutable*  @WithReadLock *  @Delegate*  @WithWriteLock *  @Category*  @Newify *  @Mixin
  9. 9. GROOVY ECOSYSTEMBRINGS:*  @ByteCode *  Griffon*  @Scalify *  @EventPublisher *  @Threading*  GContracts *  @PropertyListener *  @Invariant *  @MVCAware *  @Requires *  @MessageSourceAware *  @Ensures *  @ResourceResolverAware*  Grails *  @ResourcesAware *  @Entity *  @ThreadingAware *  @TestFor
  10. 10. GLOBAL ASTTRANSFORMATIONSGroovy – GrabGrails – GORM APIGriffon – Threading injectionSpock – the whole shebang
  11. 11. BUILDINGYOUR OWNAST
  12. 12. LOCAL ASTTRANSFORMATION1.  Define an @interface •  Easy peasy … right?2.  Define AST implementation •  huh ……3.  Profit!
  13. 13. GLOBAL ASTTRANSFORMATION1.  Add AST implementation entry to •  META-INF/services/ org.codehaus.groovy.transform.ASTTransformation2.  Define AST implementation •  ??? !!! ??? !!!3.  Profit!
  14. 14. ADDITIONAL TOOLSAST browserAST Builder
  15. 15. Thank You! @aalmirayandres.almiray@canoo.com

×