Re: Automatically generated GWT Wrapper

106 views
Skip to first unread message

Thomas Broyer

unread,
Jun 5, 2013, 5:54:19 AM6/5/13
to google-we...@googlegroups.com


On Wednesday, June 5, 2013 3:25:05 AM UTC+2, Martin Kimmel wrote:
Hello,

I just thought that it would be pretty cool to have a tool which analyses JavaScript Libraries and automatically generates some Java/GWT Files as a Wrapper (using JSNI, JavaScript Overlays, ...)
Do you know if something like this already exists?

IIRC, Ray Cromwell said they have such a tool internally at Google (or at least in the works) and they'll open source it. This is on the road map for GWT at least.
 
Else I would like to try programming such a tool.
Do you have any input what things I have to consider when doing so?

A co-worker made one for OpenLayers on a project, based on JSDoc annotations. I have no idea how he made it though, and he had to tweak the generated code by hand (mostly because JSDoc annotations were incorrect)

Jozef Môstka

unread,
Dec 16, 2013, 4:45:52 PM12/16/13
to google-we...@googlegroups.com


Dňa streda, 5. júna 2013 3:25:05 UTC+2 Martin Kimmel napísal(-a):

Else I would like to try programming such a tool.
Do you have any input what things I have to consider when doing so?

Hi,
Im actualy working on gwt wraper generator. Its not public now. So if you wont help, send Email and I will give you svn access, and I'll explain the principles.
 

dhoffer

unread,
Dec 17, 2013, 9:36:59 AM12/17/13
to google-we...@googlegroups.com
That would be great of Google could open source what Ray/Google has...it would be very useful.

-Dave


On Tuesday, June 4, 2013 7:25:05 PM UTC-6, Martin Kimmel wrote:
Hello,

I just thought that it would be pretty cool to have a tool which analyses JavaScript Libraries and automatically generates some Java/GWT Files as a Wrapper (using JSNI, JavaScript Overlays, ...)
Do you know if something like this already exists?

Else I would like to try programming such a tool.
Do you have any input what things I have to consider when doing so?

Best regards,
Martin

Srini v

unread,
Dec 17, 2013, 7:35:00 PM12/17/13
to google-we...@googlegroups.com
It will be great if you can send principles we need such took and may be we can also help
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Jozef Môstka

unread,
Dec 18, 2013, 2:35:14 AM12/18/13
to google-we...@googlegroups.com
Hi,

Its simple. I use Nodejs because parser for js exist only in js. https://github.com/ariya/esprima .

Im do parser only for styled js syntax. som js must be writed slyle like Foo.prototype.func=function. But can be maded for other style.
Also, best result will be only from orifinal js source, not minified, in original directory structure.
In first step I will look for all files is floders, so I can create from path namespace.
second step I will parse all classes, properties and method. so I get basic object structure.
next step I will parse coments, if exist. And try read from there types of properties and arguments, its not necessary, but its fastes and more corrects.
nex step I will look for types of arguments. So in Each object I will look inside all methods, and look how its use his properties. in evry use of property I will look whats method and propery is readed from that property and remember it. when I look in all object for one property, I will look in all object in project and try to find best match for that object. If none is find, JavaScriptObject will be used in gwt as type.
same thinks will be used for method arguments. but, (also in public property looking can be used) will looking not only inside method, but also where method is used. before method is used, value must be initialized, so I will look there.
There is also anonimus finctions. so there we bust generate for his good names.

It is of course hard to exercise and time. But this things its doing only one time.

one detail is, for parsing comments can be maded interface. so in evry code can be diferent comment.

I have Idea how must be work, But I have realy not idea, How to write this and how to organize code.

If somebody think is good ide, we can create public repository.

Second big think I have is to rewrite also body of functions I will be this done. so all javascript will be converted to java.

Dňa streda, 18. decembra 2013 1:35:00 UTC+1 chinni napísal(-a):
It will be great if you can send principles we need such took and may be we can also help

On Monday, 16 December 2013, Jozef Môstka wrote:


Dňa streda, 5. júna 2013 3:25:05 UTC+2 Martin Kimmel napísal(-a):

Else I would like to try programming such a tool.
Do you have any input what things I have to consider when doing so?

Hi,
Im actualy working on gwt wraper generator. Its not public now. So if you wont help, send Email and I will give you svn access, and I'll explain the principles.
 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages