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

!636
!quickmain
!auto-import
!standard functions
!class _x14

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.lang.reflect.*;

main {
  psvm {
    String text;
    if (args.length != 0)
      text = loadSnippet(args[0]);
    else
      text = loadTextFile("input/main.java", null);
    if (text == null)
      throw new IOException("No input.");
    
    // load
    
    File srcDir = _x14.TempDirMaker_make();
    saveTextFile(new File(srcDir, "main.java").getPath(), text);
    
    // translate
    
    List<File> libraries = new ArrayList<File>();
    File X = _x14.topLevelTranslate(srcDir, libraries);
    
    // save
    saveTextFile("output/main.java", loadTextFile(new File(X, "main.java").getPath(), null));
    print "output/main.java written!"
  }
}

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: 757 / 671
Referenced in: [show references]