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

42
LINES

< > BotCompany Repo | #1025520 // tok_standardBot1

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (2774L) is out of date.

1  
svoid tok_standardBot1(LS tok) {
2  
  int i;
3  
  while ((i = jfind(tok, "standardBot1 <id> {")) >= 0) {
4  
    print("Processing standardBot1");
5  
    int iOpening = indexOf(tok, i, "{");
6  
    S name = tok.get(iOpening-2);
7  
    int iClosing = findEndOfBracketPart(tok, iOpening)-1;
8  
    LS contents = subList(tok, iOpening+1, iClosing);
9  
    
10  
    S allServers = "";
11  
    int j = jfind(contents, "allServers {");
12  
    if (j >= 0) {
13  
      int k = findEndOfBracketPart(contents, j+2);
14  
      allServers = joinSubList(contents, j+4, k-2);
15  
      clearTokens(contents, j, k);
16  
    }
17  
18  
    S init = "";
19  
    j = jfind(contents, "init {");
20  
    if (j >= 0) {
21  
      int k = findEndOfBracketPart(contents, j+2);
22  
      init = joinSubList(contents, j+4, k-2);
23  
      clearTokens(contents, j, k);
24  
    }
25  
    
26  
    replaceTokens_reTok(tok, i, iClosing+1,
27  
      [[ cmodule2 ]] + name + [[ extends DynTalkBot2<]] + name + [[.ByServer> {
28  
        void init {
29  
          super.init();
30  
          makeByServer = () -> new ByServer;
31  
          useAGIBlueForDropPunctuation = false;
32  
          preprocessAtSelfToMyName = false;
33  
          ]] + init + [[
34  
        }
35  
        
36  
        ]] + allServers + [[
37  
38  
        class ByServer extends DynTalkBot2.ByServer { ]]
39  
        + join(contents)
40  
        + "} }");
41  
  }
42  
}

Author comment

Began life as a copy of #1025378

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025520
Snippet name: tok_standardBot1
Eternal ID of this version: #1025520/9
Text MD5: b19c1670eb5cde0819967f967936c0ef
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-26 17:02:00
Source code size: 1298 bytes / 42 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 257
Version history: 8 change(s)
Referenced in: [show references]