Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

35
LINES

< > BotCompany Repo | #643 // translateToJava (snippet arg or input/main.java to output/main.java)

JavaX source code - run with: x30.jar

1  
!636
2  
!quickmain
3  
!auto-import
4  
!standard functions
5  
!class _x14
6  
7  
import java.security.MessageDigest;
8  
import java.security.NoSuchAlgorithmException;
9  
import java.lang.reflect.*;
10  
11  
main {
12  
  psvm {
13  
    String text;
14  
    if (args.length != 0)
15  
      text = loadSnippet(args[0]);
16  
    else
17  
      text = loadTextFile("input/main.java", null);
18  
    if (text == null)
19  
      throw new IOException("No input.");
20  
    
21  
    // load
22  
    
23  
    File srcDir = _x14.TempDirMaker_make();
24  
    saveTextFile(new File(srcDir, "main.java").getPath(), text);
25  
    
26  
    // translate
27  
    
28  
    List<File> libraries = new ArrayList<File>();
29  
    File X = _x14.topLevelTranslate(srcDir, libraries);
30  
    
31  
    // save
32  
    saveTextFile("output/main.java", loadTextFile(new File(X, "main.java").getPath(), null));
33  
    print "output/main.java written!"
34  
  }
35  
}

Author comment

Began life as a copy of #642

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #643
Snippet name: translateToJava (snippet arg or input/main.java to output/main.java)
Eternal ID of this version: #643/1
Text MD5: a1c6228fd907c389cb831674055e7182
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-07-06 18:32:39
Source code size: 845 bytes / 35 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 671 / 586
Referenced in: [show references]