Re: Execute a code segment during script compile

2020-03-04 Thread Saravanan Palanichamy
:58, Saravanan Palanichamy wrote: > :D yes which is why I am using the script to gather intent and not using it > as the runtime. I need to understand the retry parameters of 10 and 20. I > gather this knowledge at the time of creation and compilation which is > harmless to exits >

Re: Execute a code segment during script compile

2020-02-25 Thread Saravanan Palanichamy
You wouldn't want to run @Retry({System.exit(0)}) on your server, I presume. > > On Mon, 24 Feb 2020 at 00:39, Saravanan Palanichamy > wrote: > > > > > > > On 2020/02/23 23:14:32, Paul King wrote: > > > Just for future reference, I'd probably start out with

Execute a code segment during script compile

2020-02-23 Thread Saravanan Palanichamy
Hello Is it possible to do this in the groovy AST transformation -> a) in a code visitor, visit a closure expression (in the INSTRUCTION_SELECTION phase) b) Using the Closure Node, execute this code to determine its results based on different parameters Essentially I want to be able to

Re: Execute a code segment during script compile

2020-02-23 Thread Saravanan Palanichamy
ble. Perhaps you could give a concrete simple example > of the kind of thing you are trying to do. I understand most of what you > are saying but a few bits are still a little unclear (to me at least). > > Cheers, Paul. > > > On Mon, Feb 24, 2020 at 9:06 AM Saravanan Palanichamy &g

CompareToNullExpression does not visitTransforms

2020-09-07 Thread Saravanan Palanichamy
Hello I am running into an issue with the ClassCodeExpressionTransformer. Why does CompareToNullExpression not visit any expressions it owns? Should it not transform objectExpression? I am trying to change property access into my custom method calls and if a compare to null expression with

Re: RE: CompareToNullExpression does not visitTransforms

2020-09-08 Thread Saravanan Palanichamy
On 2020/09/08 14:59:46, "Milles, Eric (TR Technology)" wrote: > https://github.com/apache/groovy/pull/1361 > Thank you Eric, I'll give this a shot

Dynamic class types

2020-10-19 Thread Saravanan Palanichamy
Hello everyone My DSL that uses AST transformations has this quirk * A Groovy script defines classes and uses other classes from the class path * I want to be able to replace all these types during compile with my own standard class definition * If I have the types I am replacing in the class

Re: Dynamic class types

2020-10-19 Thread Saravanan Palanichamy
ResolveVisitor checks isResolved() and > isPrimaryClassNode() first. > > -Original Message- > From: Saravanan Palanichamy > Sent: Monday, October 19, 2020 5:53 AM > To: dev@groovy.apache.org > Subject: Dynamic class types > > Hello everyone > > My DSL that uses

Re: Upgrading from 2.5 to 3.0.5 and my class loader extension does not work

2020-08-14 Thread Saravanan Palanichamy
pected to be written in Groovy/Java. > > Cheers, > Daniel Sun > On 2020/08/08 13:19:01, Saravanan Palanichamy wrote: > > Hello > > > > I have an extension of GroovyClassLoader that I use as follows > > > > a) I override loadClass to make sure I decide where

Re: Memory leak with org.codehaus.groovy.runtime.metaclass.MetaMethodIndex$Entry

2020-10-23 Thread Saravanan Palanichamy
Hello Any help with this is super appreciated regards Saravanan On 2020/09/08 01:25:11, Saravanan Palanichamy wrote: > Upon further analysis, if I call > InvokerHelper.removeClass(clazz) > after I instantiate and use the instance, then things get unloaded correctly. > What

Re: StaticPropertyAccessHelper transforms are not routed through my expression transformer

2020-08-07 Thread Saravanan Palanichamy
gt; > > There may be several instances of this to correct and test if all of the > Expression sub-types are looked at. I'd start by filing a new Jira ticket. > > > -Original Message- > From: Saravanan Palanichamy > Sent: Thursday, August 6, 2020 8:43 AM > To: d

Upgrading from 2.5 to 3.0.5 and my class loader extension does not work

2020-08-08 Thread Saravanan Palanichamy
Hello I have an extension of GroovyClassLoader that I use as follows a) I override loadClass to make sure I decide where to load from b) I first call loadClass on my parent class loader to make sure the class is not loaded there (I assert if it is. This code is not shown below) c) I then call

Re: Parrot parser customization

2020-08-08 Thread Saravanan Palanichamy
ink you want to implement your own DSL. The AST transformation of Groovy > could help you. > > Cheers, > Daniel Sun > On 2020/08/08 23:54:47, Saravanan Palanichamy wrote: > > Hello everyone > > > > If I wanted to introduce new syntax in my groovy script, how wo

Parrot parser customization

2020-08-08 Thread Saravanan Palanichamy
Hello everyone If I wanted to introduce new syntax in my groovy script, how would I go about doing it? I want to embed custom syntax directly into the groovy file and have it be parsed into my custom AST nodes. An example would be myFunction() { List tableValues = select value from

StaticPropertyAccessHelper transforms are not routed through my expression transformer

2020-08-06 Thread Saravanan Palanichamy
Hello My class derives from ClassCodeExpressionTransformer and I use it to transform my method call expression. Lets say I add an extra parameter to these methods. This works for normal expression, however for property setter expressions, this does not work because it does not route through my

Re: Upgrading from 2.5 to 3.0.5 and my class loader extension does not work

2020-08-15 Thread Saravanan Palanichamy
in Groovy/Java. > > Cheers, > Daniel Sun > On 2020/08/08 13:19:01, Saravanan Palanichamy wrote: > > Hello > > > > I have an extension of GroovyClassLoader that I use as follows > > > > a) I override loadClass to make sure I decide where to load from &g

Local variable annotations for multi declaration expressions

2021-01-28 Thread Saravanan Palanichamy
Hello How do I annotate local variables in a multi declaration? @MyTag def (var1, var2) = ["", ""] --> this works and I am able to see the annotations in my AST def (@MyTag var1, @MyOtherTag var2) = ["", ""] --> This does not work. In the second declaration model, The IDE calls out

Unable to breakpoint inside closures generated during AST transformation

2021-02-20 Thread Saravanan Palanichamy
Hello folks In my AST transformation that takes a block of code and executes it as a closure, I am unable to set a breakpoint inside the block of code at runtime. This however works if the closure was written as part of the script directly. What am I missing? Sample Groovy code class

Disabling auto inferencing

2022-12-03 Thread Saravanan Palanichamy
Hello developers I am developing a DSL and ran into this issue. Groovy auto infers that b is really a derived clazz and allows me to call the derived clazz method. How do I prevent this behavior from happening? Are there some settings in the DeclarationExpression or VariableExpression AST models

Re: Disabling auto inferencing

2022-12-04 Thread Saravanan Palanichamy
Thanks Jochen and Christopher for helping clarify behaviour. So if I wanted to make sure declaration and not flow type is honored, the quickest way is to make sure flow type matches declaration by casting it? Are there other ways inside the compiler to fix this (some options or some indications in

Duplicate visits to expressions defined in RHS of a setter

2023-04-01 Thread Saravanan Palanichamy
Hello Groovy Devs - I have a class defined MyTestClass in java/kotlin (does not matter) - I have a groovy class defined MyClassDefinedInGroovy - I have code in a groovy function that is creating these classes and setting a variable in the object. I compile this with static compilation

Re: [EXT] Duplicate visits to expressions defined in RHS of a setter

2023-04-04 Thread Saravanan Palanichamy
he >> idiosyncrasies of the tree. >> https://github.com/groovy/groovy-eclipse/blob/master/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/core/util/DepthFirstVisitor.java >> >> >> >> *From:* Saravanan Palanichamy >> *Sent:* Saturday, April 1, 202