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

16
LINES

< > BotCompany Repo | #1004092 - tok_importedClassNames (just the names, not the packages)

JavaX fragment (include)

static L<S> tok_importedClassNames(L<S> tok) {
  new L<S> names;
  int n = l(tok);
  for (int i = 1; i < n; i += 2)
    if (eq(tok.get(i), "import") /*&& neq(get(tok, i+2), "static")*/) { // static may be OK, e.g. import static x30_pkg.x30_util.VF1;
      int j = findEndOfStatement(tok, i); // index of ;+1
      S s = get(tok, j-3);
      
      // This is to distinguish from imported functions;
      // yes it's rough.
      if (isIdentifier(s) && startsWithUpperCase(s))
        names.add(s);
      i = j-1;
    }
  ret names;
}

Author comment

Began life as a copy of #1003837

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1004092
Snippet name: tok_importedClassNames (just the names, not the packages)
Eternal ID of this version: #1004092/6
Text MD5: a3264df1988bbe2682758a0f65c7584a
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-04 00:48:56
Source code size: 549 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 422 / 818
Version history: 5 change(s)
Referenced in: [show references]

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