Menu

#2566 Jython to Java converter wants

nextrelease
open
nobody
None
1
2026-02-16
2023-11-22
No

I used JythonToJava converter when creating the prototype GUI for the Das2Server params. This works fairly well, greatly reducing the amount of time needed to convert the code. However with the Java to Python converter I wrote a while ago my expectations are higher, and it would be nice to get this closer to the same capability.

This ticket is to enumerate the wants so I can get back to the task at hand.

Discussion

  • Jeremy Faden

    Jeremy Faden - 2023-11-22
         if narg==1:
              c= JCheckBox(text='one arg')
         elif narg==2:
              c= JCheckBox(text='two args')
    

    converts to "if {} else { if ..."

     
  • Jeremy Faden

    Jeremy Faden - 2023-11-22

    No-arg split() should be replaced by split("\s+")

     
  • Jeremy Faden

    Jeremy Faden - 2023-12-02

    This also needs to be be redone like the Java to Jython converter, where it's not building the entire code, but instead each node is converted to a string and they are combined properly at higher level. No-arg split cannot be properly done because of this, an extra () is added:

    s= ' a b  c d'
    ss= s.split()
    for s1 in ss:
        print '>>%s<<' % s1
    
    String s = " a b  c d";
    Object ss = s.trim().split(\\s+)();
    for ( Object s1 : ss ) {
        System.out.println(String.format(">>%s<<",s1));
    }
    
     
  • Jeremy Faden

    Jeremy Faden - 2023-12-02

    if :...elif: ... is done.

    split is done.

     
  • Jeremy Faden

    Jeremy Faden - 2024-06-11
     
  • Jeremy Faden

    Jeremy Faden - 2026-02-16
     
MongoDB Logo MongoDB