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

20
LINES

< > BotCompany Repo | #1002960 // SimpleInterpreter (include)

JavaX fragment (include)

// Subclassable, OBVIOUSLY!
static class Module {
  void go(Lisp entry) throws Exit {}
}

static class Exit extends Exception {}

static class SimpleInterpreter {
  void interpret(S src, Module module) {
    for (S line : toLines(src)) {
      Lisp entry = nlParse(line, false, true);
      if (!entry.is("[]", 0))
        try {
          module.go(entry);
        } catch (Exit e) {
          break;
        }
    }
  }
}

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: #1002960
Snippet name: SimpleInterpreter (include)
Eternal ID of this version: #1002960/1
Text MD5: 2e4f877ef7f6d7c5ceaffc30b849d44d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-04-10 23:23:18
Source code size: 441 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 555 / 706
Referenced in: [show references]