Your SlideShare is downloading. ×
Groovy AST Demystified
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Groovy AST Demystified

1,348
views

Published on

Groovy AST Demystified

Groovy AST Demystified

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,348
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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