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

17
LINES

< > BotCompany Repo | #1032961 - tok_gettableFields

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

Transpiled version (4739L) is out of date.

svoid tok_gettableFields(LS tok) {
  int i = -1;
  while ((i = jfind(tok, i+1, "gettable <id>")) >= 0) {
    int iModifiers = i+2;
    int iEndOfModifiers = tok_scanModifiers_idx(tok, iModifiers);
    int iType = iEndOfModifiers;
    int iEndOfType = tok_endOfType(tok, iEndOfModifiers);
    S type = joinSubList_cToC(tok, iType, iEndOfType);
    S var = identifierOrQuestionMark(get(tok, iEndOfType));
    printVars(+i, +iModifiers, +iEndOfModifiers, +iType, +iEndOfType, +type, +var);
    tokReplace_reTok(tok, i, i+2,
      join(listMinus(subList(tok, iModifiers, iEndOfModifiers),   "volatile"))
      + tok_formatDollarVars(
        "public $type $var aka $getVar() { ret $var; } ",
          +type, +var, getVar := "get" + firstToUpper(var)));
  }
}

Author comment

Began life as a copy of #1022743

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032961
Snippet name: tok_gettableFields
Eternal ID of this version: #1032961/11
Text MD5: 2970435e60c60a73d1c5f241509a70e3
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-23 06:34:14
Source code size: 771 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 40 / 81
Version history: 10 change(s)
Referenced in: [show references]