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

11
LINES

< > BotCompany Repo | #1017553 // nlLogic_render

JavaX fragment (include)

1  
sS nlLogic_render(IfThen rule) {
2  
  if (rule == null) null;
3  
  ret nlLogic_render(rule.in) + " => " + nlLogic_render(rule.out);
4  
}
5  
6  
sS nlLogic_render(Exp e) {
7  
  if (e cast Func) ret e.name + "(" + nlLogic_render(e.arg) + ")";
8  
  if (e cast Sentence) ret join(e.tok);
9  
  if (e cast And) ret nlLogic_render(e.a) + " && " + nlLogic_render(e.b);
10  
  ret "TODO: " + className(e);
11  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017553
Snippet name: nlLogic_render
Eternal ID of this version: #1017553/4
Text MD5: 5f2ceaaaba6bc40ca4934370d73188d2
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-27 12:16:25
Source code size: 379 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 354 / 390
Version history: 3 change(s)
Referenced in: [show references]