An update on scripting Jackpot

An update on scripting Jackpot

I've added scripting support for developing Transformers in Jackpot . The way you use it is similar to running Query. Open the 'Query and Refactor' (CTRL-Shift-Q), and select 'Transformer scripting runner'.

I have converted all the example scripts on the Jackpot website to Javascript so you can try these scripts, both query and transformer, on your projects. I've not really pushed the scripts so let me know if you find any errors. There are 2 scripts that are not working

  • find_unused_variables.js – I cannot seem to instantiate a Finder object.

  • beanize.js – I got exactly the same result as Beanize.java class. But for some strange reason, when I tried to view what source changes were made, Jackpot could not report the changes viz. the visual diff window did not open. I got the same result with the Java implementation. Also, while I was porting Beanize.java to Javascript, I found some missing methods like getMemberDecls() from Tree. Seems like Beanize.java is quite dated. Anyway if you manage to get this working let me know.

Here are the list of modules you will need if you are interested in trying this:

  • Script engine – here. I've fix some bugs. The continuation character '\\' is now working in the script console. You can get the source here. The sources includes the window module.

  • Jackpot script engine – here. Source here.

  • Examples of Jackpot scripts – here. Unzip this. The scripts are under scripts/jackpot

See my earlier blog for more info. I will probably stop doing script related module for awhile. On to my next project....

Comments:

find_unused_variables.js: typo 'igonre' in shouldTest.

Posted by Jesse Glick on August 14, 2006 at 04:52 PM SGT #

Jessie, thanks. Actually you pointed out another error. I should have a 'var' in front of ignore. Keep the scope local.

Posted by chuk on August 15, 2006 at 01:41 AM SGT #

When I must put scripts directory please?

Posted by ATom on August 16, 2006 at 07:50 AM SGT #

ATom, you can put your scripts anywhere. Once you have selected one of the Jackpot script runner, a dialog box will open up, asking you to select the script to execute. the scripts under 'query' are for Query and 'transformer' are for Transformers. OTOH, if you want to use the scripting environement in general, then go to Options -> Misc to configure the script repostory.

Posted by Chuk on August 16, 2006 at 09:03 AM SGT #

Beanize is quite dated, as you suspected. The reason it was included as an example is because it shows how to use a Finder to locate references to an element you want to change. However, it was only really practical when Jackpot supported individual element selection in source files (like other refactorings), but the UI folks thought that was too confusing. It will all get resolved for NetBeans 6.0, but for now I should remove it from the Jackpot web-site.

Posted by Tom Ball on August 18, 2006 at 12:05 AM SGT #

Post a Comment:
Comments are closed for this entry.
About

Random thought at random intervals

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today