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

19
LINES

< > BotCompany Repo | #1018005 // nlLogic_visitWithParent

JavaX fragment (include)

// visitor: voidfunc(node, parent, parentField)
svoid nlLogic_visitWithParent(IfThen rule, VF3<O, O, S> visitor) {
  if (rule == null) ret;
  callF(visitor, rule);
  nlLogic_visitWithParent(rule.in, rule, 'in, visitor);
  nlLogic_visitWithParent(rule.out, rule, 'out, visitor);
}

svoid nlLogic_visitWithParent(Exp e, O parent, S parentField, VF3<O, O, S> visitor) {
  if (e == null) ret;
  callF(visitor, e, parent, parentField);
  if (e cast And) {
    nlLogic_visitWithParent(e.a, e, 'a, visitor);
    nlLogic_visitWithParent(e.b, e, 'b, visitor);
  } else if (e cast ExpNot)
    nlLogic_visitWithParent(e.a, e, 'a, visitor);
  else if (e cast Func)
    nlLogic_visitWithParent(e.arg, e, 'arg, visitor);
}

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