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

19
LINES

< > BotCompany Repo | #1018005 // nlLogic_visitWithParent

JavaX fragment (include)

1  
// visitor: voidfunc(node, parent, parentField)
2  
svoid nlLogic_visitWithParent(IfThen rule, VF3<O, O, S> visitor) {
3  
  if (rule == null) ret;
4  
  callF(visitor, rule);
5  
  nlLogic_visitWithParent(rule.in, rule, 'in, visitor);
6  
  nlLogic_visitWithParent(rule.out, rule, 'out, visitor);
7  
}
8  
9  
svoid nlLogic_visitWithParent(Exp e, O parent, S parentField, VF3<O, O, S> visitor) {
10  
  if (e == null) ret;
11  
  callF(visitor, e, parent, parentField);
12  
  if (e cast And) {
13  
    nlLogic_visitWithParent(e.a, e, 'a, visitor);
14  
    nlLogic_visitWithParent(e.b, e, 'b, visitor);
15  
  } else if (e cast ExpNot)
16  
    nlLogic_visitWithParent(e.a, e, 'a, visitor);
17  
  else if (e cast Func)
18  
    nlLogic_visitWithParent(e.arg, e, 'arg, visitor);
19  
}

Author comment

Began life as a copy of #1017815

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: #1018005
Snippet name: nlLogic_visitWithParent
Eternal ID of this version: #1018005/1
Text MD5: 8ed25bf40be2112bf80d1496232ad7df
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-25 13:27:17
Source code size: 728 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 237 / 282
Referenced in: [show references]