static S jreplaceStart(S s, S in, S out) { ret jreplaceStart(s, in, out, null); } static S jreplaceStart(S s, S in, S out, O condition) { L tok = javaTok(s); jreplaceStart(tok, in, out, condition); ret join(tok); } // leaves tok properly tokenized // returns true iff anything was replaced static boolean jreplaceStart(L tok, S in, S out) { ret jreplaceStart(tok, in, out, false, false, null); } static boolean jreplaceStart(L tok, S in, S out, O condition) { ret jreplaceStart(tok, in, out, false, false, condition); } static boolean jreplaceStart(L tok, S in, S out, boolean ignoreCase, boolean reTok, O condition) { L tokin = javaTok(in); jfind_preprocess(tokin); int i = findCodeTokens(tok, 1, ignoreCase, toStringArray(codeTokensOnly(tokin)), condition); // TODO: opt if (i != 1) false; L subList = tok.subList(i-1, i+l(tokin)-1); // N to N S expansion = jreplaceExpandRefs(out, subList); int end = i+l(tokin)-2; clearAllTokens(tok, i, end); // C to C tok.set(i, expansion); if (reTok) reTok(tok, i, end); true; }