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

38
LINES

< > BotCompany Repo | #1007916 // Compiler Bot using CompilerBot [LIVE in JavaX Starter]

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

Libraryless. Click here for Pure Java version (6644L/44K/149K).

!7

p {
  CompilerBot.verbose = true;
  makeAndroid("Compiler bot with caching!");
}

static synchronized S answer(S s) {
  new Matches m;
  if (match3("Please compile this JavaX snippet: *", s, m)) {
    S snippetID = $1;
    File jar = CompilerBot.compileSnippet(snippetID);
    ret "ok, " + quote(jar.getAbsolutePath());
  }

  if "Please compile this Java text: *"
    ret compile($1, "");

  if "Please compile this Java text: * with libraries *"
    ret compile($1, $2);

  if (match3("Please compile this Java text: * for java version *", s, m)) {
    String src = unquote(m.m[0]);
    String target = unquote(m.m[1]);
    return compile(src, "", target);
  }

  return null;
}

static S compile(S src, S libs) {
  return compile(src, libs, null);
}

static synchronized S compile(S src, S dehlibs, S javaTarget) {
  File jar = CompilerBot.compile(src, dehlibs, javaTarget);
  ret "ok, " + quote(jar.getAbsolutePath());
}

Author comment

Began life as a copy of #1002203

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: #1007916
Snippet name: Compiler Bot using CompilerBot [LIVE in JavaX Starter]
Eternal ID of this version: #1007916/3
Text MD5: 4780102e1ad9eae1a639734f1f69a9c7
Transpilation MD5: 6ccc9468c6b8846d5222a2c140654f2a
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-13 23:52:14
Source code size: 967 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 542 / 2243
Version history: 2 change(s)
Referenced in: [show references]