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

8
LINES

< > BotCompany Repo | #1017431 // ptElement_depth - how deeply are we in the parse tree?

JavaX fragment (include)

1  
static int ptElement_depth(PTElement e) {
2  
  int n = -1;
3  
  while (e != null) {
4  
    ++n;
5  
    e = e.parent;
6  
  }
7  
  ret n;
8  
}

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: #1017431
Snippet name: ptElement_depth - how deeply are we in the parse tree?
Eternal ID of this version: #1017431/1
Text MD5: 8f87893f07180b446b6f8591876e7439
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-20 15:29:52
Source code size: 126 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 319 / 356
Referenced in: [show references]