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

13
LINES

< > BotCompany Repo | #1010547 - tok_endOfImplementsList

JavaX fragment (include)

1  
// i = index of "implements"/"extends"
2  
static int tok_endOfImplementsList(L<S> tok, int i) {
3  
  int level = 0;
4  
  while (i < l(tok)) {
5  
    S t = tok.get(i);
6  
    if (eq(t, "<")) ++level;
7  
    else if (eq(t, ">")) {
8  
      if (level == 0) ret i; else --level;
9  
    } else if (eq(t, "{")) ret i;
10  
    i += 2;
11  
  }
12  
  ret i;
13  
}

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1010547
Snippet name: tok_endOfImplementsList
Eternal ID of this version: #1010547/1
Text MD5: 15133cc234084f50029cf3fe1cff6d78
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-20 16:58:40
Source code size: 328 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 239 / 255
Referenced in: [show references]

Formerly at http://tinybrain.de/1010547 & http://1010547.tinybrain.de