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

28
LINES

< > BotCompany Repo | #1017815 // nlLogic_visit - visit rules and expressions

JavaX fragment (include)

1  
svoid nlLogic_visit(IfThen rule, VF1<O> visitor) {
2  
  if (rule == null) ret;
3  
  callF(visitor, rule);
4  
  nlLogic_visit(rule.in, visitor);
5  
  nlLogic_visit(rule.out, visitor);
6  
}
7  
8  
svoid nlLogic_visit(Exp e, VF1<O> visitor) {
9  
  if (e == null) ret;
10  
  callF(visitor, e);
11  
  if (e cast And) {
12  
    nlLogic_visit(e.a, visitor);
13  
    nlLogic_visit(e.b, visitor);
14  
  } else if (e cast ExpNot)
15  
    nlLogic_visit(e.a, visitor);
16  
  else if (e cast Func)
17  
    nlLogic_visit(e.arg, visitor);
18  
}
19  
20  
svoid nlLogic_visit(Collection l, VF1<O> visitor) {
21  
  for (O o : unnull(l)) nlLogic_visit(o, visitor);
22  
}
23  
24  
svoid nlLogic_visit(O o, VF1<O> visitor) {
25  
  if (o cast Exp) nlLogic_visit(o, visitor);
26  
  if (o cast IfThen) nlLogic_visit(o, visitor);
27  
  if (o cast Collection) nlLogic_visit(o, visitor);
28  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017815
Snippet name: nlLogic_visit - visit rules and expressions
Eternal ID of this version: #1017815/8
Text MD5: 757c9f0de22ca9307569cba33a0ee460
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-06 11:33:37
Source code size: 793 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 470 / 489
Version history: 7 change(s)
Referenced in: [show references]