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

24
LINES

< > BotCompany Repo | #1002530 // Test constructor finding

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

Libraryless. Click here for Pure Java version (2993L/20K/65K).

!752

!include #1002529 // Explain

p {
  for (S java : toLinesFullTrim([[
    class bla { bla() {} }
    class bla { void bla() {} }
    class blubb { void bla() {} }
    class bla { class sub { sub() {} } } // difficult case!
  ]])) pcall {
    O parseResult = jparse1(java);
    L e = cast call(parseResult, "explain", "source");
    printStructure(e);
    Explain explain = new Explain(parseResult, e);
    assertEquals("classdecl", explain.className());
    
    // remove all inner classes
    explain.pruneSubs("classdecl");
   
    print(java); 
    print("  Constructors: " + structure(explain.findAll("constructordecl")));
  }
}

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: #1002530
Snippet name: Test constructor finding
Eternal ID of this version: #1002530/1
Text MD5: de6fa112c682952205243adee952bb7d
Transpilation MD5: dccb6d92949e5c99cc9ec2ca6fd0362b
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-01-31 03:57:46
Source code size: 661 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 701 / 739
Referenced in: [show references]