Hi,
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):