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

46
LINES

< > BotCompany Repo | #1004828 // Java Analysis AI Classes

JavaX fragment (include)

1  
!include #1004681 // Concepts
2  
3  
sclass SSnippet extends Concept {
4  
  S snippetID;
5  
  S text;
6  
  long grabbedWhen;
7  
}
8  
9  
sclass JavaTok extends Concept {
10  
  new Ref<SSnippet> onSnippet;
11  
  S text;
12  
  L<S> tok;
13  
}
14  
15  
sclass Substring extends Concept {
16  
  new Ref<SSnippet> from;
17  
  int startIndex, endIndex;
18  
  
19  
  // text of the substring
20  
  S text() {
21  
    ret substring(fullText(), startIndex, endIndex);
22  
  }
23  
  
24  
  // text this was taken from
25  
  S fullText() {
26  
    ret from.get().text;
27  
  }
28  
}
29  
30  
sclass JavaToken extends Substring {
31  
  new Ref<JavaTok> javaTok;
32  
  int index;
33  
  int charIndex;
34  
  
35  
  *() {}
36  
  *(JavaTok javaTok, int *index, int *charIndex) {
37  
    this.javaTok.set(javaTok);
38  
    from.set(javaTok.onSnippet);
39  
    startIndex = charIndex;
40  
    endIndex = startIndex+l(javaTok.tok.get(index));
41  
  }
42  
  
43  
  S token() {
44  
    ret text();
45  
  }
46  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004828
Snippet name: Java Analysis AI Classes
Eternal ID of this version: #1004828/1
Text MD5: 7ffb77abbd8e9bc2a8334591b49a2cdd
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-09-03 16:02:37
Source code size: 865 bytes / 46 lines
Pitched / IR pitched: No / No
Views / Downloads: 401 / 985
Referenced in: [show references]