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

55
LINES

< > BotCompany Repo | #1001640 // Try to make a source compilable (developing)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2038L/14K/45K).

!747

m {
  static S snippetID = "#1001579"; // The Riddle
  
  !include #1001497 // parseBoolean
   
  p {
    startBot("Translator Runner Bot", "#1001206");
    
    S src = loadSnippet(snippetID);
    
    // remove the non-symbolic translator invocations
    L<S> lines = toLines(src);
    findTranslators(lines);
    src = fromLines(lines);
    
    L<S> tok = javaTok(src);
    if (hasCodeTokens(tok, "m", "{"))
      src = translate("#628", src); // quickmain
      
    src = translate("#629", src); // standard functions
    
    if (isJavaCompilable(src)) {
      print("Compilable!");
      S transpID = uploadTranspilation(snippetID, src);
      print("Transpilation uploaded as: " + formatSnippetID(transpID));
      //activateTranspilation(snippetID, transpID);
      return;
    }
    
    print("Not compilable.");
  }
  
  static S uploadTranspilation(S snippetID, S src) {
    S title = "Transpilation of " + formatSnippetID(snippetID);
    S id = findSnippet(src, title);
    if (id != null) ret id;
    ret createJavaProgram(src, title);
  }
  
  static void activateTranspilation(S javaxID, S javaID) {
    // TODO
  }
  
  static S translate(S translatorID, S src) {
    S s = sendToLocalBot("Translator Runner Bot", "please run translator * on this text: *", translatorID, src);
    if (isQuoted(s))
      ret unquote(s);
    new Matches m;
    if (find3("stored as *", s, m))
      ret unquote(sendToLocalBot("Translator Runner Bot", "get string *", m.unq(0)));
    throw fail(s);
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001640
Snippet name: Try to make a source compilable (developing)
Eternal ID of this version: #1001640/1
Text MD5: 59ddbdbc46092867d00a8ca5ce2d52cd
Transpilation MD5: 2a51eb222dbf0e487e699b4b156370d4
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-31 17:36:26
Source code size: 1564 bytes / 55 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 588 / 652
Referenced in: #3000190 - Answer for stefanreich(>> t 20 questions)
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000238 - Answer for stefanreich (>> t power bot)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)