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

22
LINES

< > BotCompany Repo | #1009829 // Parse contents of Java classes

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (2791L/20K).

1  
!7
2  
3  
4  
5  
p {
6  
  S src = loadSnippet(#1006722); // nice complicated Java source
7  
  parse(javaTok(src));
8  
}
9  
10  
svoid parse(L<S> tok) {
11  
  for (L<S> tClass : allClasses(tok)) {
12  
    S className = getClassDeclarationName(tClass);
13  
    print("class " + className + "{");
14  
    print_threadIndentPlus();
15  
    L<S> contents = tok_contentsOfClass(tClass);
16  
    L<S> vars = allVarNames(contents);
17  
    if (nempty(vars)) print(join(", ", vars));
18  
    parse(contents);
19  
    print_threadIndentMinus();
20  
    print("}");
21  
  }
22  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009829
Snippet name: Parse contents of Java classes
Eternal ID of this version: #1009829/7
Text MD5: 01d0d4b92295f3764d95540dddf6a1c2
Transpilation MD5: 33dac711781c6bc8cdd56b81b182f3ef
Author: stefan
Category: javax / parsing
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-20 01:54:53
Source code size: 514 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 417 / 888
Version history: 6 change(s)
Referenced in: [show references]