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

30
LINES

< > BotCompany Repo | #1001620 // Extract class from source snippet (developing)

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

Libraryless. Click here for Pure Java version (1404L/10K/31K).

1  
!747
2  
3  
m {
4  
  static S snippetID = "#1001187", className = "Console";
5  
  
6  
  p {
7  
    S text = loadSnippet(snippetID);
8  
    S c = findClass(text, className);
9  
    if (c == null)
10  
      print(className + " not found in " + snippetID + ".");
11  
    else {
12  
      print("Found.");
13  
      print();
14  
      print(c);
15  
    }
16  
  }
17  
  
18  
  static S findClass(S text, S className) {
19  
    for (L<S> c : allClasses(text)) {
20  
      S name = getClassDeclarationName(c);
21  
      if (eq(name, className))
22  
        ret join(c);
23  
        
24  
      S result = findClass(join(getClassBody(c)), className);
25  
      if (result != null) ret result;
26  
    }
27  
    
28  
    ret null;
29  
  }
30  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001620
Snippet name: Extract class from source snippet (developing)
Eternal ID of this version: #1001620/1
Text MD5: 600d0de8de34c9b9763c538d8dacf530
Transpilation MD5: 6fbacfbe37bca74df63e6a772723b1b9
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-11-29 20:44:30
Source code size: 655 bytes / 30 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 600 / 653
Referenced in: [show references]