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

11
LINES

< > BotCompany Repo | #1023868 // ai_printParseTreeWithLevels

JavaX fragment (include)

1  
static void ai_printParseTreeWithLevels(PTElement e) {
2  
  ai_printParseTreeWithLevels(e, "");
3  
}
4  
5  
static void ai_printParseTreeWithLevels(PTElement e, S indent) {
6  
  if (e == null) ret with print("No parse tree");
7  
  print(indent + "[" + (l(indent)/2+1) + "] " + e);
8  
  indent += "  ";
9  
  for (PTElement child : unnull(e.children))
10  
    ai_printParseTreeWithLevels(child, indent);
11  
}

Author comment

Began life as a copy of #1017456

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023868
Snippet name: ai_printParseTreeWithLevels
Eternal ID of this version: #1023868/1
Text MD5: 6ff2046efa3659f42f510a025481374e
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-10 20:14:28
Source code size: 387 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 128 / 155
Referenced in: [show references]