Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Groovy AST Demystified

Greach 2013 - Groovy AST Demystified

Related Books

Free with a 30 day trial from Scribd

See all

Groovy AST Demystified

  1. 1. Andres Almiray Canoo Engineering AGGroovy AST Demystified
  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. GE EV NI IL U S
  7. 7. Standard Groovy Distro includes:∗ @EqualsAndHashCode ∗ @AutoClone∗ @ToString ∗ @AutoExternalize∗ @TupleConstructor ∗ @Synchronized∗ @Canonical ∗ @Field∗ @InheritConstructors ∗ @Grab∗ @IndexedProperty ∗ @GrabResolver∗ @Lazy∗ @PackageScope ∗ @CompileStatic∗ @NotYetImplemented ∗ @TypeChecked
  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∗ @Scalify ∗ @EventPublisher∗ GContracts ∗ @Threading ∗ @Invariant ∗ @PropertyListener ∗ @Requires ∗ @MVCAware ∗ @Ensures ∗ @MessageSourceAware∗ Grails ∗ @ResourceResolverAwa ∗ @Entity re ∗ @ResourcesAware ∗ @TestFor ∗ @ThreadingAware
  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?1. Define AST implementation ∗ huh ……1. Profit!
  13. 13. Global AST Transformation1. Add AST implementation entry to ∗ META- INF/services/org.codehaus.groovy.transform.ASTTra nsformation1. Define AST implementation ∗ ??? !!! ??? !!!1. Profit!
  14. 14. Additional Tools∗ AST browser∗ AST Builder
  15. 15. Thank You! @aalmirayandres.almiray@canoo.com

    Be the first to comment

    Login to see the comments

  • neodevelop

    Jan. 29, 2013
  • kazuchika

    Jan. 30, 2013
  • TakeshiWatanabe2

    Jan. 30, 2013
  • MarcinGrzejszczak

    Jan. 30, 2014
  • ErickBrito5

    Apr. 4, 2015
  • capacman

    Jul. 18, 2018

Greach 2013 - Groovy AST Demystified

Views

Total views

2,613

On Slideshare

0

From embeds

0

Number of embeds

462

Actions

Downloads

33

Shares

0

Comments

0

Likes

6

×