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

20
LINES

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

JavaX fragment (include)

1  
// Subclassable, OBVIOUSLY!
2  
static class Module {
3  
  void go(Lisp entry) throws Exit {}
4  
}
5  
6  
static class Exit extends Exception {}
7  
8  
static class SimpleInterpreter {
9  
  void interpret(S src, Module module) {
10  
    for (S line : toLines(src)) {
11  
      Lisp entry = nlParse(line, false, true);
12  
      if (!entry.is("[]", 0))
13  
        try {
14  
          module.go(entry);
15  
        } catch (Exit e) {
16  
          break;
17  
        }
18  
    }
19  
  }
20  
}

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