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

13
LINES

< > BotCompany Repo | #1017742 // ai_parseTree_simplifyNode

JavaX fragment (include)

1  
static PTElement ai_parseTree_simplifyNode(PTElement e) {
2  
  if (e == null) null;
3  
  e = ai_parseTree_descendToComposite(e);
4  
  if (e == null) null;
5  
  if (e instanceof ChoosePart) {
6  
    ai_Reconstructed r = e/ChoosePart.reconstruction;
7  
    WeightedProduction prod = r.production;
8  
    S hint = prod.simplificationHint;
9  
    if (eq(hint, "L")) ret first(e.children);
10  
    if (eq(hint, "R")) ret second(e.children);
11  
  }
12  
  ret e;
13  
}

Author comment

Began life as a copy of #1017408

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: #1017742
Snippet name: ai_parseTree_simplifyNode
Eternal ID of this version: #1017742/4
Text MD5: cdad1256b2b33906cba9d792257a8ebc
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-07 20:40:30
Source code size: 434 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 272 / 305
Version history: 3 change(s)
Referenced in: [show references]