Hi

I did a similar experiment a while ago, but abandoned it due to the missing 
support for overloads in JsInterop and I did not come up with a pleasing 
solution for constructors. Many parts of the DOM API use method overloading 
(fx the canvas API) and constructors -(fx to create a Path2D object)

Feel free to take whatever from it if you find anything useful.

https://github.com/rhmoller/webidl2gwt

It contains:
- a scraper that extract webidl snippets from https://html.spec.whatwg.org
- a quick and dirty and incomplete webidl parser based on an Antlr4 grammar
- an example with a hacked version of GWT where the method overloading 
guard has been removed. It does some painting using Canvas.
- a factory approach for constructing new instances of JsInterop types. 



Den onsdag den 1. april 2015 kl. 23.32.55 UTC+2 skrev nick936:
>
> Hi, 
> while playing with the new JsInterop feature i decided to write a code 
> generator which generate the interfaces out of webidls fetched from 
> https://html.spec.whatwg.org/ or the mozilla repository. Yesterday i 
> started this littel project. It's a prototype and far away from being 
> stable, but enough to use the generated interfaces for test purposes. I did 
> a rather quick and dirty just to use the interfaces my internal test 
> project and the code needs some refactoring. I used ANTLR4, javasoup and 
> javapoet. You can find the sources in this github repo 
> https://github.com/Nickel671/JsInteropGenerator. You can find the 
> generated Interfaces here 
> https://github.com/Nickel671/JsInteropGenerator/tree/master/target/generated-sources/gwt/org/niklas/elemental/Elemental/client/elements.
>  
> If you are interested in this i will improve it.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/84278c54-274e-46ee-b72c-d2529c4e7c16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to