/*
 * SDK Pullenti Lingvo, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software.
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C#.NET project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Utils = require("./../../../unisharp/Utils");
const Hashtable = require("./../../../unisharp/Hashtable");
const RefOutArgWrapper = require("./../../../unisharp/RefOutArgWrapper");
const StringBuilder = require("./../../../unisharp/StringBuilder");

const InstrToken1Types = require("./../../instrument/internal/InstrToken1Types");
const MetaToken = require("./../../MetaToken");
const NounPhraseParseAttr = require("./../../core/NounPhraseParseAttr");
const ComplexNumCompareType = require("./../../core/ComplexNumCompareType");
const TerminParseAttr = require("./../../core/TerminParseAttr");
const SingleNumValueType = require("./../../core/SingleNumValueType");
const ComplexNumComparer = require("./../../core/ComplexNumComparer");
const TextToken = require("./../../TextToken");
const TerminToken = require("./../../core/TerminToken");
const DecreeTokenItemType = require("./DecreeTokenItemType");
const NounPhraseHelper = require("./../../core/NounPhraseHelper");
const MorphLang = require("./../../../morph/MorphLang");
const BracketParseAttr = require("./../../core/BracketParseAttr");
const DecreeKind = require("./../DecreeKind");
const NumberSpellingType = require("./../../NumberSpellingType");
const DecreeReferent = require("./../DecreeReferent");
const ReferentsEqualType = require("./../../core/ReferentsEqualType");
const Referent = require("./../../Referent");
const DecreeChangeKind = require("./../DecreeChangeKind");
const ReferentToken = require("./../../ReferentToken");
const DecreePartReferent = require("./../DecreePartReferent");
const ConjunctionHelper = require("./../../core/ConjunctionHelper");
const DecreeChangeTokenTyp = require("./DecreeChangeTokenTyp");
const DecreeChangeReferent = require("./../DecreeChangeReferent");
const PartTokenItemType = require("./PartTokenItemType");
const GetTextAttr = require("./../../core/GetTextAttr");
const NumberToken = require("./../../NumberToken");
const TableHelper = require("./../../core/TableHelper");
const MiscHelper = require("./../../core/MiscHelper");
const DecreeChangeValueKind = require("./../DecreeChangeValueKind");
const DecreeChangeValueReferent = require("./../DecreeChangeValueReferent");
const TerminCollection = require("./../../core/TerminCollection");
const BracketHelper = require("./../../core/BracketHelper");
const Termin = require("./../../core/Termin");
const ComplexNumToken = require("./../../core/ComplexNumToken");
const DecreeAnalyzer = require("./../DecreeAnalyzer");

class DecreeChangeToken extends MetaToken {
    
    static attachReferents(dpr, tok0) {
        const PartToken = require("./PartToken");
        const NumberingHelper = require("./../../instrument/internal/NumberingHelper");
        if (dpr === null || tok0 === null) 
            return null;
        let tt0 = tok0.endToken.next;
        if (tt0 !== null && tt0.isCommaAnd && tok0.actKind === DecreeChangeKind.UNDEFINED) 
            tt0 = tt0.next;
        if (tt0 !== null && tt0.isChar(':')) 
            tt0 = tt0.next;
        let toks = null;
        if (tt0 === null) {
        }
        else if (tt0.previous !== null && tt0.previous.isChar(':')) {
            if (tok0.actKind2 === DecreeChangeKind.APPEND || tok0.actKind === DecreeChangeKind.APPEND) 
                toks = DecreeChangeToken.tryAttachList(tt0, true, tok0.indentRegime);
        }
        else {
            if (tt0.isComma && tok0.decree !== null) 
                tt0 = tt0.next;
            toks = DecreeChangeToken.tryAttachList(tt0, false, tok0.indentRegime);
        }
        if (toks === null) 
            toks = new Array();
        toks.splice(0, 0, tok0);
        if ((toks.length === 2 && toks[0].actKind === DecreeChangeKind.UNDEFINED && toks[0].changeVal !== null) && toks[1].actKind === DecreeChangeKind.NEW && toks[1].changeVal !== null) 
            toks[1].actKind = DecreeChangeKind.EXCHANGE;
        if ((((toks.length === 4 && toks[0].changeVal === null && toks[1].changeVal === null) && toks[1].actKind === DecreeChangeKind.NEW && toks[2].typ === DecreeChangeTokenTyp.VALUE) && toks[3].typ === DecreeChangeTokenTyp.VALUE && toks[3].parts === null) && toks[3].newParts === null) {
            toks[1].actKind = DecreeChangeKind.EXCHANGE;
            toks[0].actKind = DecreeChangeKind.EXCHANGE;
        }
        let kinds = new Array();
        for (const tok of toks) {
            if (tok.actKind !== DecreeChangeKind.UNDEFINED && !kinds.includes(tok.actKind)) 
                kinds.push(tok.actKind);
        }
        if ((((kinds.length === 1 && kinds[0] === DecreeChangeKind.EXCHANGE && toks.length === 5) && toks[0].changeVal !== null && toks[2].changeVal !== null) && toks[4].changeVal !== null && toks[2].changeVal.getStringValues("BEGIN").length === 2) && toks[4].changeVal.getStringValues("BEGIN").length === 1) {
            let cv = toks[2].changeVal;
            toks[2].endToken = toks[4].endToken;
            for (let jj = cv.slots.length - 3; jj < cv.slots.length; jj++) {
                toks[0].changeVal.slots.push(cv.slots[jj]);
            }
            cv.slots.splice(cv.slots.length - 3, 3);
            toks[2].changeVal.slots.splice(toks[2].changeVal.slots.length, 0, ...toks[4].changeVal.slots);
            toks.splice(3, 2);
        }
        let res = new Array();
        let dcr = new DecreeChangeReferent();
        if (tok0.realPart !== null && !(dpr instanceof DecreePartReferent)) 
            dcr.addSlot(DecreeChangeReferent.ATTR_OWNER, tok0.realPart, false, 0);
        else {
            dcr.addSlot(DecreeChangeReferent.ATTR_OWNER, dpr, false, 0);
            if (((dpr instanceof DecreePartReferent) && dpr.owner !== null && tok0.decree !== null) && !dpr.owner.canBeEquals(tok0.decree, ReferentsEqualType.WITHINONETEXT)) 
                dcr.addSlot(DecreeChangeReferent.ATTR_OWNER, tok0.decree, false, 0);
        }
        if (tok0.addDecrees !== null) {
            for (const dd of tok0.addDecrees) {
                let pp = Utils.as(dpr, DecreePartReferent);
                if (pp !== null && pp.preamble !== null && pp.slots.length === 2) {
                    let pp2 = new DecreePartReferent();
                    pp2.owner = dd;
                    pp2.preamble = pp.preamble;
                    dcr.addSlot(DecreeChangeReferent.ATTR_OWNER, pp2, false, 0);
                    res.push(new ReferentToken(pp2, null, null));
                    continue;
                }
                dcr.addSlot(DecreeChangeReferent.ATTR_OWNER, dd, false, 0);
            }
        }
        let rt = new ReferentToken(dcr, tok0.beginToken, tok0.endToken);
        res.push(rt);
        let newItems = null;
        let _inTheEnd = false;
        while (true) {
            for (let i = 0; i < toks.length; i++) {
                let tok = toks[i];
                if (tok.inTheEnd) 
                    _inTheEnd = true;
                if (i > 0 && tok.beginToken.previous !== null && tok.beginToken.previous.isChar(';')) 
                    break;
                if ((i > 0 && tok.actKind === DecreeChangeKind.EXPIRE && tok.changeVal === null) && tok.parts === null) {
                    if (dcr.kind !== DecreeChangeKind.UNDEFINED) 
                        break;
                }
                if (tok.typ === DecreeChangeTokenTyp.AFTERVALUE) {
                    if (tok.changeVal !== null) {
                        if (tok.changeVal.isContent) 
                            dcr.locValue = tok.changeVal;
                        else {
                            if (dcr.param !== null && dcr.kind === DecreeChangeKind.APPEND && dcr.value !== null) {
                                dcr = Utils.as(dcr.clone(), DecreeChangeReferent);
                                dcr.param = null;
                                dcr.value = null;
                                dcr.locValue = null;
                                rt = new ReferentToken(dcr, tok.beginToken, tok.endToken);
                                res.push(rt);
                            }
                            dcr.addSlot(DecreeChangeReferent.ATTR_PARAM, tok.changeVal, false, 0);
                        }
                        if (tok.endChar > rt.endChar) 
                            rt.endToken = tok.endToken;
                        res.splice(res.length - 1, 0, new ReferentToken(tok.changeVal, tok.beginToken, tok.endToken));
                    }
                    continue;
                }
                rt.endToken = tok.endToken;
                if (tok.actKind !== DecreeChangeKind.UNDEFINED) {
                    if (dcr.kind !== DecreeChangeKind.UNDEFINED && dcr.kind !== tok.actKind) {
                        if (i > 0) 
                            rt.endToken = toks[i - 1].endToken;
                        break;
                    }
                    dcr.kind = tok.actKind;
                    if (tok.actKind === DecreeChangeKind.EXPIRE || tok.actKind === DecreeChangeKind.EXPIRECHANGES || tok.actKind === DecreeChangeKind.CONFIDENTIAL) 
                        break;
                    if (((tok.actKind === DecreeChangeKind.REMOVE && tok.parts !== null && tok.parts[0].typ === PartTokenItemType.SENTENCE) && (i + 1) === toks.length && tok0.realPart !== null) && tok0.realPart.sentence === null) 
                        tok0.realPart.sentence = tok.parts[0].values[0].toString();
                }
                if (tok.changeVal === null && tok.appExtChanges !== null) {
                    tok.changeVal = new DecreeChangeValueReferent();
                    tok.changeVal.kind = DecreeChangeValueKind.EXTAPPENDIX;
                    tok.changeVal.value = (tok.appExtChanges.values.length === 0 ? "" : tok.appExtChanges.values[0].toString());
                    res.splice(res.length - 1, 0, new ReferentToken(tok.changeVal, tok.appExtChanges.beginToken, tok.appExtChanges.endToken));
                    rt.endToken = tok.endToken;
                }
                if (tok.changeVal !== null) {
                    if (((i + 2) < toks.length) && ((toks[i + 1].actKind === DecreeChangeKind.EXCHANGE || toks[i + 1].actKind === DecreeChangeKind.NEW)) && toks[i + 2].changeVal !== null) {
                        dcr.param = tok.changeVal;
                        let rt11 = new ReferentToken(tok.changeVal, tok.beginToken, tok.endToken);
                        if (tok.parts !== null && tok.parts.length > 0) 
                            rt11.beginToken = tok.parts[tok.parts.length - 1].endToken.next;
                        res.splice(res.length - 1, 0, rt11);
                        dcr.value = toks[i + 2].changeVal;
                        dcr.kind = toks[i + 1].actKind;
                        i += 2;
                        tok = toks[i];
                    }
                    else if ((((i + 3) < toks.length) && tok.changeVal.isContent && toks[i + 1].changeVal !== null) && ((toks[i + 2].actKind === DecreeChangeKind.EXCHANGE || toks[i + 2].actKind === DecreeChangeKind.NEW)) && toks[i + 3].changeVal !== null) {
                        dcr.locValue = tok.changeVal;
                        dcr.param = toks[i + 1].changeVal;
                        let rt11 = new ReferentToken(tok.changeVal, tok.beginToken, tok.endToken);
                        if (tok.parts !== null && tok.parts.length > 0) 
                            rt11.beginToken = tok.parts[tok.parts.length - 1].endToken.next;
                        res.splice(res.length - 1, 0, rt11);
                        rt11 = new ReferentToken(toks[i + 1].changeVal, toks[i + 1].beginToken, toks[i + 1].endToken);
                        res.splice(res.length - 1, 0, rt11);
                        dcr.value = toks[i + 3].changeVal;
                        dcr.kind = toks[i + 2].actKind;
                        i += 3;
                        tok = toks[i];
                    }
                    else if ((((i + 1) < toks.length) && toks[i + 1].changeVal !== null && kinds.length === 1) && kinds[0] === DecreeChangeKind.EXCHANGE) {
                        dcr.param = tok.changeVal;
                        dcr.kind = DecreeChangeKind.EXCHANGE;
                        res.splice(res.length - 1, 0, new ReferentToken(tok.changeVal, tok.beginToken, tok.endToken));
                        dcr.value = toks[i + 1].changeVal;
                        i += 1;
                        tok = toks[i];
                    }
                    else if (tok.changeVal.isContent && dcr.locValue === null) 
                        dcr.locValue = tok.changeVal;
                    else if (dcr.value === null) {
                        dcr.value = tok.changeVal;
                        if (dcr.kind === DecreeChangeKind.UNDEFINED && ((i === (toks.length - 1) || ((i === (toks.length - 2) && toks[i + 1].typ === DecreeChangeTokenTyp.VALUE))))) {
                            let _next = new Array();
                            for (let ttt = toks[toks.length - 1].endToken.next; ttt !== null; ttt = ttt.next) {
                                if (ttt.isCommaAnd) 
                                    continue;
                                let ne = DecreeChangeToken.tryAttach(ttt, null, false, null, false, false, null, false);
                                if (ne === null) 
                                    break;
                                if (ne.typ === DecreeChangeTokenTyp.VALUE && ne.changeVal !== null) {
                                    _next.push(ne);
                                    ttt = ne.endToken;
                                    continue;
                                }
                                if (ne.typ === DecreeChangeTokenTyp.ACTION && ne.actKind === DecreeChangeKind.REMOVE) 
                                    _next.push(ne);
                                break;
                            }
                            if (_next.length > 0 && _next[_next.length - 1].typ === DecreeChangeTokenTyp.ACTION) {
                                dcr.kind = DecreeChangeKind.REMOVE;
                                res.splice(res.length - 1, 0, new ReferentToken(tok.changeVal, tok.beginToken, tok.endToken));
                                if (i < (toks.length - 1)) 
                                    _next.splice(0, 0, toks[i + 1]);
                                for (let k = 0; k < (_next.length - 1); k++) {
                                    let ne = _next[k];
                                    res.push(new ReferentToken(ne.changeVal, ne.beginToken, ne.endToken));
                                    dcr = new DecreeChangeReferent();
                                    dcr.kind = DecreeChangeKind.REMOVE;
                                    dcr.value = ne.changeVal;
                                    dcr.addSlot(DecreeChangeReferent.ATTR_OWNER, dpr, false, 0);
                                    rt = new ReferentToken(dcr, ne.beginToken, ne.endToken);
                                    if (k === (_next.length - 2)) 
                                        rt.endToken = _next[_next.length - 1].endToken;
                                    res.push(rt);
                                }
                                break;
                            }
                        }
                        if (dcr.kind === DecreeChangeKind.UNDEFINED && toks.length === 1) {
                            if (tok.changeVal.value !== null && tok.changeVal.value.endsWith(" исключить")) {
                                dcr.kind = DecreeChangeKind.REMOVE;
                                tok.changeVal.value = tok.changeVal.value.substring(0, 0 + tok.changeVal.value.length - 10);
                                tok.changeVal.endChar = tok.changeVal.endChar - 10;
                            }
                        }
                    }
                    else if ((dcr.value.kind !== DecreeChangeValueKind.TEXT && tok.changeVal.kind === DecreeChangeValueKind.TEXT && tok.changeVal.value !== null) && dcr.value.value === null) 
                        dcr.value.value = tok.changeVal.value;
                    else if (kinds.length === 1 && kinds[0] === DecreeChangeKind.REMOVE) 
                        dcr.addSlot(DecreeChangeReferent.ATTR_VALUE, tok.changeVal, false, 0);
                    else if ((kinds.length === 1 && kinds[0] === DecreeChangeKind.APPEND && dcr.param === null) && tok.actKind === DecreeChangeKind.UNDEFINED) {
                        dcr.param = dcr.value;
                        dcr.value = tok.changeVal;
                    }
                    else if (kinds.length === 0 && dcr.param === null) 
                        dcr.param = tok.changeVal;
                    else if (dcr.value !== null && i === (toks.length - 1)) {
                        if (i > 1 && ((tok.isNewlineBefore || tok.numBefore !== null))) {
                            rt.endToken = toks[i - 1].endToken;
                            break;
                        }
                        else 
                            dcr.kind = DecreeChangeKind.ERROR;
                    }
                    else 
                        dcr.value = tok.changeVal;
                    if (tok.endChar > rt.endChar) 
                        rt.endToken = tok.endToken;
                    res.splice(res.length - 1, 0, new ReferentToken(tok.changeVal, tok.beginToken, tok.endToken));
                    if (dcr.kind === DecreeChangeKind.NEW) 
                        break;
                    if (dcr.kind === DecreeChangeKind.CONSIDER) {
                        if ((i + 2) < toks.length) {
                            if (toks[i + 2].actKind !== DecreeChangeKind.UNDEFINED || toks[i + 1].actKind !== DecreeChangeKind.UNDEFINED) 
                                break;
                            dcr = new DecreeChangeReferent();
                            dcr.addSlot(DecreeChangeReferent.ATTR_OWNER, dpr, false, 0);
                            rt = new ReferentToken(dcr, toks[i + 1].beginToken, toks[i + 1].endToken);
                            res.push(rt);
                            continue;
                        }
                        break;
                    }
                }
                if (dcr.kind === DecreeChangeKind.APPEND && tok.newParts !== null) {
                    for (const np of tok.newParts) {
                        let rank = PartToken._getRank(np.typ);
                        if (rank === 0) 
                            continue;
                        let eqLevVal = null;
                        if (dpr instanceof DecreePartReferent) {
                            if (!dpr.isAllItemsOverThisLevel(np.typ)) {
                                eqLevVal = dpr.getStringValue(PartToken._getAttrNameByTyp(np.typ));
                                if (eqLevVal === null) 
                                    continue;
                            }
                        }
                        dcr.kind = DecreeChangeKind.APPEND;
                        if (newItems === null) 
                            newItems = new Array();
                        let nam = PartToken._getAttrNameByTyp(np.typ);
                        if (nam === null) 
                            continue;
                        if (np.values.length === 0) {
                            if (eqLevVal === null) 
                                newItems.push(nam);
                            else {
                                let n = 0;
                                let wrapn1046 = new RefOutArgWrapper();
                                let inoutres1047 = Utils.tryParseInt(eqLevVal, wrapn1046);
                                n = wrapn1046.value;
                                if (inoutres1047) 
                                    newItems.push((nam + " " + (n + 1)));
                                else 
                                    newItems.push(nam);
                            }
                        }
                        else if (np.values.length === 2 && np.values[0].endToken.next.isHiphen) {
                            let vv = NumberingHelper.createDiap(np.values[0].value, np.values[1].value);
                            if (vv !== null) {
                                for (const v of vv) {
                                    newItems.push((nam + " " + v));
                                }
                            }
                        }
                        if (newItems.length === 0) {
                            for (const v of np.values) {
                                newItems.push((nam + " " + v.value + "///" + v.sourceValue));
                            }
                        }
                    }
                }
            }
            if (dcr.param !== null && dcr.value !== null && dcr.kind === DecreeChangeKind.UNDEFINED) 
                dcr.kind = DecreeChangeKind.ERROR;
            if (!dcr.checkCorrect()) 
                return null;
            if (newItems !== null && dcr.value !== null && dcr.kind === DecreeChangeKind.APPEND) {
                for (const v of newItems) {
                    let vvv = v;
                    let src = null;
                    let ii = vvv.indexOf("///");
                    if (ii > 0) {
                        vvv = vvv.substring(0, 0 + ii);
                        src = v.substring(ii + 3);
                    }
                    dcr.value.addSlot(DecreeChangeValueReferent.ATTR_NEWITEM, vvv, false, 0).tag = src;
                }
            }
            newItems = null;
            if (rt.endToken.next === null) 
                break;
            if (!rt.endToken.next.isCommaAnd) 
                break;
            let tt2 = rt.endToken.next.next;
            if (tt2 === null) 
                break;
            if (tt2.isValue("А", null)) 
                tt2 = tt2.next;
            toks = DecreeChangeToken.tryAttachList(tt2, false, false);
            if (toks === null) 
                break;
            let dts1 = new DecreeChangeReferent();
            for (const o of dcr.owners) {
                dts1.addSlot(DecreeChangeReferent.ATTR_OWNER, o, false, 0);
            }
            rt = new ReferentToken(dts1, toks[0].beginToken, toks[0].endToken);
            res.push(rt);
            dcr = dts1;
        }
        return res;
    }
    
    static splitValue(rtVal, own) {
        const InstrToken1 = require("./../../instrument/internal/InstrToken1");
        let res = new Array();
        for (let t = rtVal.beginToken; t !== null && (t.endChar < rtVal.endChar); t = t.next) {
            if (rtVal.beginToken === t && BracketHelper.isBracket(t, true)) 
                t = t.next;
            let line = InstrToken1.parse(t, true, null, 0, null, false, 0, false, false);
            if (line === null) 
                break;
            let t1 = line.endToken;
            if ((t1.endChar + 1) >= rtVal.endChar) {
                line.endToken = rtVal.endToken;
                for (; t1 !== null; t1 = t1.previous) {
                    if (t1.isCharOf(".;")) {
                    }
                    else if (BracketHelper.canBeEndOfSequence(t1, false, null, false)) {
                        t1 = t1.previous;
                        break;
                    }
                    else 
                        break;
                }
            }
            let v = new DecreeChangeValueReferent();
            v.kind = DecreeChangeValueKind.TEXT;
            v.value = MiscHelper.getTextValue(t, t1, GetTextAttr.of((GetTextAttr.KEEPQUOTES.value()) | (GetTextAttr.KEEPREGISTER.value())));
            v.beginChar = rtVal.referent.beginChar;
            v.endChar = rtVal.referent.endChar;
            let rr = new ReferentToken(v, t, line.endToken);
            res.push(rr);
            t = line.endToken;
        }
        if (res.length > 0) {
            let rr = res[res.length - 1];
            if (rr.endToken.isCharOf(";.,")) 
                rr.endToken = rr.endToken.previous;
        }
        return res;
    }
    
    static _tryParseText(xx1, abzacRegime, wordRegime = false, defPart = null) {
        const DecreeToken = require("./DecreeToken");
        const InstrToken1 = require("./../../instrument/internal/InstrToken1");
        const NumberingHelper = require("./../../instrument/internal/NumberingHelper");
        let res = DecreeChangeToken._new1048(xx1, xx1, DecreeChangeTokenTyp.VALUE);
        res.changeVal = DecreeChangeValueReferent._new1049(DecreeChangeValueKind.TEXT);
        let t0 = xx1;
        res.changeVal.beginChar = xx1.beginChar;
        if (BracketHelper.isBracket(xx1, true)) {
            res.changeVal.beginChar = xx1.endChar + 1;
            t0 = xx1.next;
            if (xx1.isChar('<') && t0 !== null && t0.isChar('<')) {
                res.changeVal.beginChar = t0.endChar + 1;
                t0 = t0.next;
            }
        }
        else if (xx1.isTableControlChar && BracketHelper.isBracket(xx1.next, true) && xx1.next.next !== null) {
            res.changeVal.beginChar = xx1.next.endChar + 1;
            t0 = xx1.next.next;
        }
        let clauseLast = null;
        let pstack = new Hashtable();
        let nls = 0;
        let lastNums = new Hashtable();
        let ln = ComplexNumToken.tryParse(xx1.next, null, false, false);
        if (ln !== null) 
            lastNums.put(ln.signature, ln);
        for (let tt = t0; tt !== null; tt = tt.next) {
            let stop = false;
            let isDoubt = false;
            let seqNum = -1;
            if (tt.tag instanceof NumberToken) {
                if (tt.tag.beginChar < res.beginChar) 
                    stop = true;
            }
            if (!tt.isNewlineAfter && !tt.next.isChar(String.fromCharCode(0x1E))) {
                if (tt === t0) {
                    let part0 = DecreeChangeToken._tryParsePart(tt, false);
                    if (part0 !== null && part0.values.length === 1) {
                        pstack.put(part0.typ, part0.values[0].value);
                        tt = part0.endToken;
                        continue;
                    }
                }
                if (tt !== null && tt.isChar(String.fromCharCode(0x1E))) {
                    let rows = TableHelper.tryParseRows(tt, 0, true, false);
                    if (rows !== null && rows.length >= 1) {
                        for (let tt33 = tt.next; tt33 !== null && tt33.endChar <= rows[rows.length - 1].endChar; tt33 = tt33.next) {
                            if (tt33.tag instanceof NumberToken) {
                                if (tt33.tag.beginChar < res.beginChar) {
                                    stop = true;
                                    tt = tt33;
                                    break;
                                }
                            }
                        }
                        if (!stop) {
                            tt = rows[rows.length - 1].endToken.previous;
                            continue;
                        }
                    }
                }
                if (tt.isCharOf(";.") || ((tt.isValue("ИСКЛЮЧИТЬ", null) && wordRegime))) {
                    if (DecreeChangeToken._checkEndBracket(tt.previous)) {
                        if (!tt.isNewlineAfter && tt.next !== null && tt.next.isChar('<')) 
                            continue;
                        isDoubt = true;
                        if (((tt.next instanceof TextToken) && tt.next.lengthChar === 1 && tt.next.next !== null) && tt.next.next.isChar(')')) 
                            stop = true;
                        else if ((tt.next instanceof NumberToken) && tt.next.next !== null && tt.next.next.isCharOf(").")) 
                            stop = true;
                        else {
                            let part0 = DecreeChangeToken._tryParsePart(tt.next, false);
                            if (part0 !== null && part0.values.length === 1) {
                                if (part0.isNewlineAfter && part0.morph._case.isNominative && !tt.next.chars.isAllLower) 
                                    stop = true;
                                else {
                                    let tok1 = DecreeChangeToken.M_TERMS.tryParse(part0.endToken.next, TerminParseAttr.NO);
                                    if (tok1 !== null) 
                                        stop = true;
                                }
                            }
                        }
                        if (tt.isValue("ИСКЛЮЧИТЬ", null)) {
                            tt = tt.previous;
                            stop = true;
                        }
                        if (!stop) {
                            if (DecreeChangeToken._canBeChangeToken(tt.next, 0, false, false)) 
                                stop = true;
                        }
                        if (!stop) 
                            continue;
                    }
                    else if (DecreeChangeToken._canBeChangeToken(tt.next, 0, true, false)) 
                        stop = true;
                    else 
                        continue;
                }
                else if ((tt.isCommaAnd && BracketHelper.canBeEndOfSequence(tt.previous, true, null, false) && !xx1.isNewlineBefore) && nls === 0) {
                    let nn = DecreeChangeToken.tryAttach(tt.next, null, true, null, false, false, null, false);
                    if (nn !== null || DecreeChangeToken.M_TERMS.tryParse(tt.next, TerminParseAttr.NO) !== null) {
                        stop = true;
                        tt = tt.previous;
                    }
                    else if (tt.next !== null) {
                        let ok = false;
                        if (tt.next.isValue("ПОСЛЕДНИЙ", null) || tt.next.isValue("ПРЕДПОСЛЕДНИЙ", null) || (((tt.next instanceof NumberToken) && tt.next.morph._class.isAdjective))) 
                            ok = true;
                        if (ok) {
                            stop = true;
                            tt = tt.previous;
                        }
                    }
                }
                else if (BracketHelper.canBeEndOfSequence(tt, true, null, false)) {
                    if (tt.isWhitespaceAfter) {{
                                if (DecreeChangeToken._canBeChangeToken(tt.next, 0, false, true)) 
                                    stop = true;
                                else 
                                    continue;
                            }
                    }
                    else if (tt.next.isCharOf(";.") && ((tt.previous.isTableControlChar || DecreeChangeToken._canBeChangeToken(tt.next, 0, false, false)))) 
                        stop = true;
                    else 
                        continue;
                }
                else if (tt.isComma && tt.isNewlineAfter && DecreeChangeToken._canBeChangeToken(tt.next, 0, true, false)) 
                    stop = true;
                else {
                    if (tt === t0) {
                        let nnn = ComplexNumToken.tryParse(tt, null, false, false);
                        if (nnn !== null && !lastNums.containsKey(nnn.signature)) 
                            lastNums.put(nnn.signature, nnn);
                    }
                    continue;
                }
            }
            else {
                if (tt.next !== null && tt.next.isValue2("АДМИНИСТРАТИВНАЯ", "ПРОЦЕДУРА")) {
                }
                if (tt.next instanceof ReferentToken) {
                }
                if (tt.next !== null && tt.next.isChar(String.fromCharCode(0x1E))) {
                    let rows = TableHelper.tryParseRows(tt.next, 0, true, false);
                    if (rows !== null && rows.length > 1) {
                        for (let tt33 = tt.next; tt33 !== null && tt33.endChar <= rows[rows.length - 1].endChar; tt33 = tt33.next) {
                            if (tt33.tag instanceof NumberToken) {
                                if (tt33.tag.beginChar < res.beginChar) {
                                    stop = true;
                                    tt = tt33.previous;
                                    break;
                                }
                            }
                        }
                        if (!stop) {
                            tt = rows[rows.length - 1].endToken.previous;
                            continue;
                        }
                    }
                    let tt2 = tt.next;
                    for (; tt2 !== null; tt2 = tt2.next) {
                        if (!tt2.isTableControlChar) 
                            break;
                    }
                    if (tt2 !== null) {
                        if (tt2.getReferent() !== null && tt2.getReferent().typeName === "PERSON") {
                            if (tt2.isNewlineAfter || tt2.next.isTableControlChar) 
                                stop = true;
                        }
                    }
                }
                if (tt.next !== null && tt.next.isTableControlChar && !stop) 
                    continue;
                let strict = true;
                if (DecreeChangeToken._checkEndBracket(tt)) 
                    strict = false;
                else if (tt.isCharOf(";.") && DecreeChangeToken._checkEndBracket(tt.previous)) 
                    strict = false;
                if (DecreeChangeToken._canBeChangeToken(tt.next, 0, strict, true)) 
                    stop = true;
                nls++;
                let nnn = ComplexNumToken.tryParse(tt.next, null, true, false);
                if (nnn === null && BracketHelper.isBracket(tt.next, false) && (tt.next.next instanceof NumberToken)) 
                    nnn = ComplexNumToken.tryParse(tt.next.next, null, true, false);
                if ((nnn !== null && nnn.beginToken === nnn.endToken && nnn.nums[0].vals[0].typ === SingleNumValueType.LETTER) && nnn.suffix === null) 
                    nnn = null;
                if (nnn !== null) {
                    if (nnn.getSourceText() === "27<5>.") {
                    }
                    seqNum = 0;
                    let nnn0 = null;
                    let wrapnnn01050 = new RefOutArgWrapper();
                    let inoutres1051 = lastNums.tryGetValue(nnn.signature, wrapnnn01050);
                    nnn0 = wrapnnn01050.value;
                    if (inoutres1051) {
                        let cmp = new ComplexNumComparer();
                        cmp.process(nnn0, nnn);
                        if (cmp.typ === ComplexNumCompareType.LESS && ((cmp.delta === 1 || cmp.delta === 2))) 
                            seqNum = 1;
                        lastNums.put(nnn.signature, nnn);
                        if (seqNum === 1) {
                            if (DecreeChangeToken._canBeChangeToken(nnn.beginToken, 0, true, false)) 
                                stop = true;
                            else {
                                let tok2 = DecreeChangeToken.tryAttach(tt.next, null, false, null, false, false, null, false);
                                if (tok2 === null) 
                                    continue;
                            }
                        }
                    }
                    else 
                        lastNums.put(nnn.signature, nnn);
                    if (tt.isCharOf(".;") && tt.next !== null && seqNum !== 1) {
                        let next1 = DecreeChangeToken.tryAttach(tt.next, null, false, null, false, false, null, false);
                        if (next1 !== null) {
                            if (next1.actKind !== DecreeChangeKind.UNDEFINED) 
                                stop = true;
                            else if (next1.typ !== DecreeChangeTokenTyp.UNDEFINED && next1.parts !== null && seqNum !== 1) 
                                stop = true;
                            else if (next1.decree !== null && next1.endToken.isChar(':')) 
                                stop = true;
                            else {
                                let next2 = DecreeChangeToken.tryAttach(next1.endToken.next, null, false, null, false, false, null, false);
                                if (next2 !== null && next2.actKind !== DecreeChangeKind.UNDEFINED) 
                                    stop = true;
                            }
                        }
                        else if (seqNum !== 1) {
                            let tt2 = nnn.endToken.next;
                            if (tt2 !== null && tt2.isValue("В", null) && DecreeToken.isKeyword(tt2.next, false) !== null) 
                                stop = true;
                        }
                    }
                    else if ((tt.isComma && tt.next !== null && seqNum !== 1) && BracketHelper.canBeEndOfSequence(tt.previous, true, null, false)) {
                        let next1 = DecreeChangeToken.tryAttach(tt.next, null, false, null, false, false, null, false);
                        if (next1 !== null) {
                            if (next1.actKind !== DecreeChangeKind.UNDEFINED) 
                                stop = true;
                            else if (next1.typ !== DecreeChangeTokenTyp.UNDEFINED && next1.parts !== null && seqNum !== 1) 
                                stop = true;
                            else if (next1.decree !== null && next1.endToken.isChar(':')) 
                                stop = true;
                        }
                    }
                    if (tt.isComma && DecreeChangeToken._canBeChangeToken(tt.next, 0, true, false)) 
                        stop = true;
                }
                if (tt.next === null) {
                }
                else {
                    let r = tt.next.getReferent();
                    if (r !== null && tt.next.isNewlineAfter) {
                        if (r.typeName === "PERSON") 
                            stop = true;
                    }
                }
            }
            if (stop) {
            }
            let part = DecreeChangeToken._tryParsePart(tt.next, false);
            if ((part !== null && part.values.length === 1 && tt.isNewlineAfter) && part.morph._case.isNominative && !tt.next.chars.isAllLower) {
                if (defPart !== null && defPart.toString() === part.toString()) {
                    tt = part.endToken;
                    continue;
                }
                if (defPart !== null && defPart.values.length === 2 && (defPart.values[0].intValue < defPart.values[1].intValue)) {
                    if (part.values[0].intValue >= defPart.values[0].intValue && part.values[0].intValue <= defPart.values[1].intValue) {
                        tt = part.endToken;
                        continue;
                    }
                }
                if (tt !== tt.next && pstack.length === 0) 
                    stop = true;
                else if (!pstack.containsKey(part.typ)) 
                    pstack.put(part.typ, part.values[0].value);
                else {
                    let n0 = 0;
                    let n1 = 0;
                    pstack.put(part.typ, part.values[0].value);
                }
            }
            let instr = InstrToken1.parse(tt.next, true, null, 0, null, false, 0, false, false);
            if (instr !== null && instr.typ === InstrToken1Types.APPENDIX) {
            }
            if (tt.next === null) {
                if (pstack.length > 0) 
                    stop = true;
                else if (DecreeChangeToken._checkEndBracket(tt) || tt.isCharOf(";.")) 
                    stop = true;
            }
            else if (instr !== null && instr.numbers.length > 0 && !stop) {
                if (isDoubt) 
                    stop = true;
                else if (abzacRegime && !BracketHelper.isBracket(xx1, true)) 
                    stop = true;
                else if (!tt.isCharOf(":")) {
                    let nn = DecreeChangeToken.tryAttach(tt.next, null, false, null, false, false, null, false);
                    if (nn !== null && nn.parts !== null) {
                        if (nn.endToken.isNewlineAfter || nn.actKind !== DecreeChangeKind.UNDEFINED) 
                            stop = true;
                        else {
                            let nnn = DecreeChangeToken.tryAttach(nn.endToken.next, null, false, null, false, false, null, false);
                            if (nnn !== null) {
                                if (nnn.changeVal !== null || nnn.actKind !== DecreeChangeKind.UNDEFINED) 
                                    stop = true;
                            }
                        }
                    }
                }
            }
            let hasNext = false;
            if (tt.next === null) {
            }
            else if (tt.next.isValue("ПОСЛЕ", null)) {
            }
            else {
                isDoubt = true;
                let pt = DecreeChangeToken._tryParsePart(tt.next, false);
                if (pt !== null && pt.typ === PartTokenItemType.CLAUSE && ((pt.isNewlineAfter || ((pt.endToken.next !== null && pt.endToken.next.isChar('.')))))) {
                    isDoubt = false;
                    if (clauseLast !== null && instr !== null && NumberingHelper.calcDelta(clauseLast, instr, true) === 1) 
                        isDoubt = true;
                }
            }
            if (instr !== null && instr.typ === InstrToken1Types.CLAUSE) 
                clauseLast = instr;
            if (isDoubt && instr !== null && !stop) {
                for (let ttt = tt; ttt !== null && ttt.endChar <= instr.endChar; ttt = ttt.next) {
                    if (ttt.isValue("УТРАТИТЬ", "ВТРАТИТИ") && ttt.next !== null && ttt.next.isValue("СИЛА", "ЧИННІСТЬ")) {
                        isDoubt = false;
                        break;
                    }
                }
                if ((instr.numEndToken !== null && instr.numEndToken.next !== null && instr.numEndToken.next.isValue("В", null)) && instr.endToken.isChar(':')) {
                    if (DecreeChangeToken._canBeChangeToken(instr.beginToken, 0, false, false)) 
                        isDoubt = false;
                    else 
                        continue;
                }
            }
            if (BracketHelper.isBracket(tt.next, true)) {
                if (tt.next.isNewlineAfter) {
                    tt = tt.next;
                    stop = true;
                }
                else if (tt.next.next !== null && tt.next.next.isCharOf(":.;") && tt.next.next.isNewlineAfter) {
                    tt = tt.next.next;
                    stop = true;
                }
            }
            res.endToken = tt;
            let tt1 = tt;
            let hcou = 0;
            let tt3 = null;
            for (tt3 = tt.next; tt3 !== null; tt3 = tt3.next) {
                if (tt3.isHiphen || tt3.isChar('_')) 
                    hcou++;
                else 
                    break;
            }
            if (hcou > 4) {
                if (tt3 === null) 
                    stop = true;
                else if (DecreeToken.isKeyword(tt3, false) !== null) 
                    stop = true;
                else if (tt3.getReferent() !== null && ((tt3.getReferent().typeName === "PERSON" || tt3.getReferent().typeName === "PERSONPROPERTY"))) 
                    stop = true;
            }
            if (tt1.next !== null && tt1.next.isValue("СТАТЬЯ", null) && !tt1.next.chars.isAllLower) {
                let pt = DecreeChangeToken._tryParsePart(tt1.next, false);
                if (pt !== null && pt.isNewlineAfter) {
                    let chr = DecreeChangeToken.tryAttach(pt.endToken.next, null, false, null, false, false, null, false);
                    if (chr !== null && ((chr.typ === DecreeChangeTokenTyp.STARTMULTU || chr.typ === DecreeChangeTokenTyp.STARTSINGLE))) 
                        stop = true;
                }
            }
            let tok = DecreeChangeToken.M_TERMS.tryParse(tt1.next, TerminParseAttr.NO);
            if (tok !== null) {
                if (tok.endToken === tt1.next && tt1.next.morph.containsAttr("к.ф.", null)) {
                }
                else if ((tok.termin.tag instanceof DecreeChangeKind) && !tt1.next.getMorphClassInDictionary().isAdjective) 
                    stop = true;
            }
            else {
            }
            if (tt1.next !== null) {
                if (tt1.next.getReferent() !== null && ((tt1.next.getReferent().typeName === "PERSON" || tt1.next.getReferent().typeName === "PERSONPROPERTY"))) {
                    if (tt1.next.beginToken.chars.isAllLower) {
                    }
                    else if (tt1.next.lengthChar < 10) {
                    }
                    else 
                        stop = true;
                }
            }
            if (tt1.isCharOf(";.") && tt1.isNewlineAfter && seqNum === 0) {
                if (DecreeChangeToken._checkEndBracket(tt1.previous)) 
                    stop = true;
            }
            if (stop) {
                let brClose = false;
                for (let ttt = tt1; ttt !== null; ttt = ttt.previous) {
                    if (!ttt.isTableControlChar) {
                        if (ttt.isCharOf(";.") && BracketHelper.isBracket(ttt.previous, true)) 
                            tt1 = ttt;
                        break;
                    }
                }
                if (tt1.isCharOf(";.") && BracketHelper.isBracket(tt1.previous, true)) {
                    if (DecreeChangeToken._findPrevBracket(tt1.previous, t0.next) !== null) {
                    }
                    else {
                        res.endToken = tt1.previous;
                        tt1 = tt1.previous.previous;
                        brClose = true;
                        if (tt1.isChar('>') && tt1.next.isChar('>')) 
                            tt1 = tt1.previous;
                    }
                }
                else if (tt1.isCharOf(";")) {
                    if (tt1.previous.isChar('.')) 
                        res.endToken = (tt1 = tt1.previous);
                }
                if (!brClose && BracketHelper.canBeEndOfSequence(tt1, true, null, false)) {
                    if (DecreeChangeToken._findPrevBracket(tt1, t0.next) !== null) {
                        if (tt1.next !== null && tt1.next.isChar('.') && !tt1.isNewlineAfter) {
                            if (tt1.next.next !== null && tt1.next.next.isChar(';')) 
                                tt1 = tt1.next;
                        }
                    }
                    else {
                        tt1 = tt1.previous;
                        brClose = true;
                        if (tt1.isChar('>') && tt1.next.isChar('>')) 
                            tt1 = tt1.previous;
                    }
                }
                if (tt1 === null || t0.beginChar > tt1.beginChar) 
                    return null;
                res.changeVal.value = new MetaToken(t0, tt1).getSourceText();
                if (tt1.next === null) 
                    res.changeVal.endChar = tt1.endChar;
                else 
                    res.changeVal.endChar = tt1.next.beginChar - 1;
                return res;
            }
            if (tt.isChar(')')) {
                for (let tt2 = tt.previous; tt2 !== null; tt2 = tt2.previous) {
                    if (tt2.isChar('(') && tt2.previous !== null && tt2.previous.endChar > res.beginChar) {
                        tt1 = tt2.previous;
                        break;
                    }
                    else if (tt2.isNewlineAfter) 
                        break;
                }
            }
            let closePoint = false;
            if (tt1.isCharOf(";.")) {
                closePoint = true;
                tt1 = res.endToken = tt1.previous;
            }
            if (tt1.isCharOf(";.")) {
                closePoint = true;
                tt1 = res.endToken = tt1.previous;
            }
            let closeBr = false;
            if (BracketHelper.isBracket(tt1, true) && !tt1.isCharOf("]>") && DecreeChangeToken._findPrevBracket(tt1, t0.next) === null) {
                closeBr = true;
                tt1 = tt1.previous;
            }
            else if (DecreeChangeToken._checkEndBracket(tt1)) {
            }
            else if (tt1.next === null) {
            }
            else if (hasNext && tt1.isTableControlChar) {
            }
            else 
                continue;
            if (isDoubt) {
                if (tt.isCharOf("<>[]")) 
                    continue;
                if (!closePoint || !closeBr) 
                    continue;
                if (!BracketHelper.canBeStartOfSequence(t0.previous, true, false)) 
                    continue;
                let brs = new Array();
                brs.push(t0.previous);
                for (let ttt = t0; ttt !== null && ttt.endChar <= tt1.next.endChar; ttt = ttt.next) {
                    if (!BracketHelper.isBracket(ttt, false)) 
                        continue;
                    if (brs.length > 0 && BracketHelper.canBeEndOfSequence(ttt, false, brs[0], false)) 
                        brs.splice(0, 1);
                    else 
                        brs.splice(0, 0, ttt);
                }
                if (brs.length > 0) {
                    if ((instr !== null && instr.typ === InstrToken1Types.APPENDIX && closeBr) && closePoint) {
                    }
                    else 
                        continue;
                }
            }
            if (tt1.beginChar > xx1.endChar) {
                for (; tt1.next !== null; tt1 = tt1.next) {
                    if (!tt1.next.isTableControlChar) 
                        break;
                }
                res.changeVal.value = new MetaToken(t0, tt1).getSourceText();
                if (tt1.next === null) 
                    res.changeVal.endChar = tt1.endChar;
                else 
                    res.changeVal.endChar = tt1.next.beginChar - 1;
                if (res.endChar < tt1.endChar) 
                    res.endToken = tt1;
                if (tt1.next !== null && BracketHelper.isBracket(tt1.next, true)) {
                    if (tt1.next.next !== null && tt1.next.next.isCharOf(";.")) 
                        res.endToken = tt1.next.next;
                    else if (tt1.next.isNewlineAfter) 
                        res.endToken = tt1.next;
                }
                return res;
            }
            break;
        }
        return null;
    }
    
    static _checkEndBracket(t) {
        if (BracketHelper.isBracket(t, true)) {
            if (t.isChar('>') && t.previous !== null && t.previous.isChar('>')) 
                return true;
            return !t.isCharOf(">]");
        }
        if (t instanceof MetaToken) {
            if (BracketHelper.isBracket(t.endToken, true)) 
                return !t.endToken.isCharOf(">]");
            if (t.endToken instanceof MetaToken) {
                if (BracketHelper.isBracket(t.endToken.endToken, true)) 
                    return !t.endToken.endToken.isCharOf(">]");
            }
        }
        return false;
    }
    
    static _findPrevBracket(t, minT) {
        if (t === null || !t.isCharOf("»\"") || t.previous === null) 
            return null;
        if (t.isChar('"') && t.previous.isCharOf(";.\"")) 
            return null;
        let cou = 30;
        for (let tt = t.previous; tt !== null && cou > 0 && ((minT === null || tt.beginChar > minT.endChar)); tt = tt.previous,cou--) {
            if (tt.isTableControlChar) 
                break;
            if (tt.isChar('»')) 
                break;
            if (tt.isChar('«')) 
                return tt;
            if (tt.isChar('"') && t.isChar('"')) {
                if (tt.next.isCharOf(".;,-") || tt.isWhitespaceAfter) 
                    return null;
                return tt;
            }
        }
        return null;
    }
    
    static _tryParsePart(t, onlyTyp = false) {
        const PartToken = require("./PartToken");
        if (t === null) 
            return null;
        if (t.isValue("УКАЗАННЫЙ", null)) 
            t = t.next;
        let pt = PartToken.tryAttach(t, null, false, false);
        if (pt !== null && pt.typ === PartTokenItemType.PREFIX) 
            return null;
        if (pt === null && onlyTyp) 
            pt = PartToken.tryAttach(t, null, false, true);
        if ((pt !== null && pt.typ === PartTokenItemType.TABLECOLUMN && pt.beginToken === pt.endToken) && !onlyTyp) {
            let pt1 = DecreeChangeToken._tryParseSpecialPart0(t, onlyTyp);
            if (pt1 !== null) 
                return pt1;
        }
        if (pt === null) 
            pt = DecreeChangeToken._tryParseSpecialPart0(t, onlyTyp);
        return pt;
    }
    
    static _tryParsePartList(t) {
        const PartToken = require("./PartToken");
        if (t === null) 
            return null;
        let t0 = t;
        if (t.isValue("УКАЗАННЫЙ", null)) 
            t = t.next;
        let res = PartToken.tryAttachList(t, false, 40);
        if ((res !== null && res.length === 1 && res[0].typ === PartTokenItemType.TABLECOLUMN) && res[0].beginToken === res[0].endToken) {
            let pt0 = DecreeChangeToken._tryParseSpecialPart0(res[res.length - 1].endToken.next, false);
            if (pt0 !== null) 
                res = null;
        }
        if (res !== null) {
            let tt2 = res[res.length - 1].endToken.next;
            if (tt2 !== null && tt2.isChar('.')) 
                tt2 = tt2.next;
            let pt0 = DecreeChangeToken._tryParseSpecialPart0(tt2, false);
            if (pt0 !== null) {
                res.push(pt0);
                let res1 = PartToken.tryAttachList(pt0.endToken.next, false, 40);
                if (res1 !== null) {
                    if (pt0.typ === PartTokenItemType.PREFIX) 
                        res.splice(res.length - 1, 1);
                    res.splice(res.length, 0, ...res1);
                }
            }
            if (res.length >= 1 && res[res.length - 1].typ === PartTokenItemType.SENTENCE && res[res.length - 1].values.length === 0) {
                if (res.length === 1) 
                    return null;
                res.splice(res.length - 1, 1);
            }
            return res;
        }
        let pt = DecreeChangeToken._tryParsePart(t, false);
        if (pt === null && t0 !== t && (t0 instanceof TextToken)) {
            pt = PartToken.tryAttach(t, null, false, true);
            if (pt !== null) 
                pt.beginToken = t;
        }
        else if ((pt !== null && !t.chars.isAllLower && ((pt.isNewlineBefore || ((pt.beginToken.previous !== null && pt.beginToken.previous.isTableControlChar))))) && pt.endToken.next !== null && pt.endToken.next.isChar('.')) 
            return null;
        if (pt === null) 
            return res;
        res = new Array();
        res.push(pt);
        if (pt.whitespacesAfterCount < 3) {
            let res1 = PartToken.tryAttachList(pt.endToken.next, false, 40);
            if (res1 !== null && !res1[0].morph._case.isInstrumental) 
                res.splice(res.length, 0, ...res1);
        }
        return res;
    }
    
    static _tryParseSpecialPart0(t, onlyTyp = false) {
        const PartToken = require("./PartToken");
        if (t === null) 
            return null;
        if (t.isValue("СЛЕДУЮЩИЙ", null) || t.isValue("НОВЫЙ", null) || t.isValue("К", null)) {
            if (t.next !== null) 
                t = t.next;
        }
        let t0 = t;
        if (t.isValue2("ГРИФ", "УТВЕРЖДЕНИЯ")) {
            let res = PartToken._new1052(t0, t.next, PartTokenItemType.FREETEXT, t);
            res.values.push(PartToken.PartValue._new1053(t0, t.next, "гриф утверждения"));
            return res;
        }
        if (t.isValue2("ПОДСТРОЧНЫЙ", "ТЕКСТ")) {
            let res = PartToken._new1052(t0, t.next, PartTokenItemType.FREETEXT, t);
            res.values.push(PartToken.PartValue._new1053(t0, t.next, "подстрочный текст"));
            return res;
        }
        if (t.isValue2("НУМЕРАЦИОННЫЙ", "ЗАГОЛОВОК")) {
            let res = PartToken._new1056(t0, t.next, PartTokenItemType.FREETEXT, t.next.morph, t);
            res.values.push(PartToken.PartValue._new1053(t0, t.next, "нумерационный заголовок"));
            return res;
        }
        if (t.isValue2("ТИПОВОЙ", "ДОГОВОР") || t.isValue3("УСЛОВИЕ", "ТИПОВОЙ", "ДОГОВОР")) {
            for (let tt = t.next.next; tt !== null; tt = tt.next) {
                if (MiscHelper.canBeStartOfSentence(tt) || tt.isNewlineBefore || tt.isChar(';')) 
                    break;
                if (tt.isValue("УТВЕРЖДЕННЫЙ", null)) {
                    let npt = NounPhraseHelper.tryParse(tt.next, NounPhraseParseAttr.NO, 0, null);
                    if (npt !== null && npt.morph._case.isInstrumental) {
                        let pp = PartToken.tryAttach(tt.next, null, false, false);
                        if (pp !== null && pp.typ === PartTokenItemType.APPENDIX && pp.values.length > 0) 
                            return PartToken._new1058(t0, tt, PartTokenItemType.PREFIX);
                        tt = npt.endToken;
                        if (tt.next !== null && tt.next.isValue("К", null)) {
                            npt = NounPhraseHelper.tryParse(tt.next.next, NounPhraseParseAttr.NO, 0, null);
                            if (npt !== null) 
                                tt = npt.endToken;
                        }
                        if (tt.next !== null && tt.next.isComma) 
                            tt = tt.next;
                        return PartToken._new1058(t0, tt, PartTokenItemType.PREFIX);
                    }
                }
            }
            return null;
        }
        if (t.next === null) 
            return null;
        let _typ = PartTokenItemType.FREETEXT;
        if (t.isValue("ПОЗИЦИЯ", null)) {
            if ((t.next !== null && t.next.isComma && t.next.next !== null) && ((t.next.next.isValue("КЛАССИФИЦИРУЕМЫЙ", null) || t.next.next.isValue("КАСАЮЩИЙСЯ", null)))) 
                t = t.next.next;
            else if (t.next !== null && t.next.isValue("ПАСПОРТ", null)) 
                t = t.next;
            else if (onlyTyp) 
                return PartToken._new1060(t, t, PartTokenItemType.FREETEXT, t.morph);
            else 
                return null;
        }
        else if (t.isValue("ГРАФИК", null) && t.chars.isCapitalUpper) 
            t = t.next;
        else if (t.isValue("ГРУППА", null)) 
            t = t.next;
        else if (t.isValue3("ПРИОРИТЕТЫ", "И", "ЦЕЛИ")) {
            t = t.next.next.next.next;
            _typ = PartTokenItemType.CHAPTER;
        }
        else if (t.isValue("СТОЛБЕЦ", null)) {
            if ((t.next !== null && t.next.isComma && t.next.next !== null) && ((t.next.next.isValue("КЛАССИФИЦИРУЕМЫЙ", null) || t.next.next.isValue("КАСАЮЩИЙСЯ", null)))) 
                t = t.next.next;
            else 
                return null;
        }
        else if (t.isValue2("УЧЕБНЫЙ", "ПРЕДМЕТ")) 
            t = t.next.next;
        else 
            return null;
        let t1 = t.previous;
        let cr = 0;
        let ok = false;
        let t11 = t1;
        if (t11.kit.miscData.containsKey("specpart")) {
        }
        else {
            t11.kit.miscData.put("specpart", null);
            for (; t !== null && (cr < 4); t = t.next) {
                if (t.isNewlineBefore) 
                    cr++;
                if (t.isChar(':') && t.isNewlineAfter) {
                    ok = true;
                    break;
                }
                if (t.isValue("КОД", null)) {
                }
                else if (DecreeChangeToken._canBeChangeToken(t, 0, true, false)) {
                    ok = true;
                    break;
                }
                if (t.isValue("В", null)) 
                    continue;
                let br = BracketHelper.tryParse(t, BracketParseAttr.NO, 100);
                if (br !== null) {
                    t1 = (t = br.endToken);
                    continue;
                }
                if ((t instanceof TextToken) && t.lengthChar === 1) 
                    continue;
                t1 = t;
            }
            t11.kit.miscData.remove("specpart");
        }
        if (ok) {
            if (t1 === t11 && !onlyTyp && !(t1 instanceof ReferentToken)) 
                return null;
            let res = PartToken._new1060(t0, t1, _typ, t0.morph);
            res.values.push(PartToken.PartValue._new1053(t0, t1, MiscHelper.getTextValue(t0, t1, GetTextAttr.of((GetTextAttr.KEEPREGISTER.value()) | (GetTextAttr.KEEPQUOTES.value()) | (GetTextAttr.FIRSTNOUNGROUPTONOMINATIVE.value())))));
            return res;
        }
        return null;
    }
    
    constructor(b, e) {
        super(b, e, null);
        this.typ = DecreeChangeTokenTyp.UNDEFINED;
        this.decree = null;
        this.addDecrees = null;
        this.decreeTok = null;
        this.parts = null;
        this.addParts = null;
        this.newParts = null;
        this.appExtChanges = null;
        this.realPart = null;
        this.addRealParts = null;
        this.inPart = null;
        this.changeVal = null;
        this.hasText = false;
        this.ignorable = false;
        this.inTheEnd = false;
        this.hasAnafor = false;
        this.hasChangeKeyword = false;
        this.actKind = DecreeChangeKind.UNDEFINED;
        this.actKind2 = DecreeChangeKind.UNDEFINED;
        this.partTyp = PartTokenItemType.UNDEFINED;
        this.alias = null;
        this.numBefore = null;
    }
    
    get indentRegime() {
        const PartToken = require("./PartToken");
        if (this.newParts !== null) {
            if (this.newParts.length === 1 && PartToken._getRank(this.newParts[0].typ) >= PartToken._getRank(PartTokenItemType.ITEM)) {
                if (this.newParts[0].values.length > 1) 
                    return false;
                return true;
            }
            return false;
        }
        if (((this.actKind !== DecreeChangeKind.APPEND && this.parts !== null && this.parts.length > 0) && !this.parts[0].delimAfter && this.parts[0].values.length <= 1) && PartToken._getRank(this.parts[0].typ) >= PartToken._getRank(PartTokenItemType.ITEM)) 
            return true;
        return false;
    }
    
    toString() {
        let tmp = new StringBuilder();
        if (this.numBefore !== null) 
            tmp.append(this.numBefore).append(" ");
        tmp.append(this.typ.toString());
        if (this.actKind !== DecreeChangeKind.UNDEFINED) 
            tmp.append(" Kind=").append(this.actKind.toString());
        if (this.actKind2 !== DecreeChangeKind.UNDEFINED) 
            tmp.append(" Kind2=").append(this.actKind2.toString());
        if (this.hasText) 
            tmp.append(" HasText");
        if (this.ignorable) 
            tmp.append(" Ignorable");
        if (this.inTheEnd) 
            tmp.append(" InTheEnd");
        if (this.hasAnafor) 
            tmp.append(" HasAnafor");
        if (this.inPart !== null) 
            tmp.append(" InPart");
        if (this.hasChangeKeyword) 
            tmp.append(" HasChangeKeyword");
        if (this.appExtChanges !== null) 
            tmp.append(" ExtChanges=").append(this.appExtChanges);
        if (this.parts !== null) {
            for (const p of this.parts) {
                tmp.append(" ").append(p);
            }
        }
        if (this.realPart !== null) 
            tmp.append(" RealPart=").append(this.realPart.toString());
        if (this.newParts !== null) {
            for (const p of this.newParts) {
                tmp.append(" New=").append(p);
            }
        }
        if (this.partTyp !== PartTokenItemType.UNDEFINED) 
            tmp.append(" PTyp=").append(this.partTyp.toString());
        if (this.decreeTok !== null) 
            tmp.append(" DecTok=").append(this.decreeTok.toString());
        if (this.decree !== null) 
            tmp.append(" Ref=").append(this.decree.toStringEx(true, null, 0));
        if (this.changeVal !== null) 
            tmp.append(" ChangeVal=").append(this.changeVal.toStringEx(true, null, 0));
        if (this.indentRegime) 
            tmp.append(" IndentRegime!");
        return tmp.toString();
    }
    
    get isStart() {
        return this.typ === DecreeChangeTokenTyp.STARTSINGLE || this.typ === DecreeChangeTokenTyp.STARTMULTU || this.typ === DecreeChangeTokenTyp.SINGLE;
    }
    
    _skipDecreeDummy() {
        const DecreeToken = require("./DecreeToken");
        let ignoreDecree = false;
        let errs = 0;
        for (let tt = this.endToken.next; tt !== null; tt = tt.next) {
            if (tt.isCommaAnd) 
                continue;
            if (this.parts !== null) 
                break;
            if (tt.getReferent() instanceof DecreeReferent) 
                continue;
            if (tt.isChar('(') && tt.next !== null) {
                let dr = Utils.as(tt.next.getReferent(), DecreeReferent);
                if (dr !== null && dr.kind === DecreeKind.PUBLISHER) 
                    this.endToken = tt.previous;
                else {
                    let pp = Utils.as(tt.next.getReferent(), DecreePartReferent);
                    if (pp !== null && pp.owner !== null && pp.owner.kind === DecreeKind.PUBLISHER) 
                        this.endToken = tt.previous;
                }
            }
            break;
        }
        for (let tt = this.endToken.next; tt !== null && (errs < 4); tt = tt.next) {
            if (tt.isCommaAnd || tt.isTableControlChar) 
                continue;
            let tt2 = MiscHelper.checkImage(tt);
            if (tt2 !== null) {
                tt = tt2;
                continue;
            }
            if (tt.isValue2("С", "ИЗМЕНЕНИЕ")) {
                errs = 0;
                tt = tt.next.next;
                if (tt === null) 
                    break;
                if (tt.isComma) 
                    tt = tt.next;
                if (tt !== null && tt.isValue("ВНЕСЕННЫЙ", null)) {
                    tt = tt.next;
                    ignoreDecree = true;
                }
                if (tt === null) 
                    break;
                continue;
            }
            if (tt.isValue("СОГЛАСНО", null)) 
                break;
            if (BracketHelper.canBeStartOfSequence(tt, true, false)) {
                let br = BracketHelper.tryParse(tt, BracketParseAttr.NO, 100);
                if (br !== null && br.endToken.next !== null) {
                    let ali = DecreeAnalyzer._checkAliasAfter(br.endToken.next);
                    if (ali !== null) {
                        this.alias = ali;
                        this.endToken = ali.endToken;
                        return;
                    }
                }
            }
            let li = DecreeChangeToken._tryParsePartList(tt);
            if (li !== null && li.length > 0) {
                if (!ignoreDecree) 
                    break;
                if (li[0].morph._case.isInstrumental) 
                    break;
                this.endToken = (tt = li[li.length - 1].endToken);
                errs = 0;
                continue;
            }
            if (tt.isChar('(')) {
                errs = 0;
                let br = BracketHelper.tryParse(tt, BracketParseAttr.CANBEMANYLINES, 3000);
                if (br !== null) {
                    this.endToken = (tt = br.endToken);
                    continue;
                }
                let cou = 5000;
                for (let ttt = tt.next; ttt !== null && cou > 0; ttt = ttt.next,cou--) {
                    if (ttt.isChar(')')) {
                        this.endToken = (tt = ttt);
                        break;
                    }
                    tt2 = MiscHelper.checkImage(ttt);
                    if (tt2 !== null) {
                        ttt = tt2;
                        continue;
                    }
                    if (DecreeChangeToken._canBeChangeToken(ttt, 0, false, false)) {
                        this.endToken = (tt = ttt.previous);
                        break;
                    }
                    let ttt2 = MiscHelper.checkImage(ttt);
                    if (ttt2 !== null) {
                        ttt = ttt2;
                        continue;
                    }
                    let dr = Utils.as(ttt.getReferent(), DecreeReferent);
                    if (dr !== null) {
                        if (dr.kind === DecreeKind.PUBLISHER) 
                            continue;
                    }
                    if (ttt instanceof ReferentToken) 
                        continue;
                    if ((ttt instanceof NumberToken) || (ttt.lengthChar < 5)) 
                        continue;
                    let pt = DecreeToken.tryAttach(ttt, null, false);
                    if (pt !== null) {
                        ttt = pt.endToken;
                        continue;
                    }
                    break;
                }
            }
            if (tt.isChar(')')) {
                this.endToken = tt;
                errs = 0;
                continue;
            }
            if (tt.getReferent() instanceof DecreeReferent) {
                errs = 0;
                if (!ignoreDecree) {
                    if (tt.previous.isAnd && tt.next !== null && tt.next.isChar('(')) {
                        if (this.addDecrees === null) 
                            this.addDecrees = new Array();
                        this.addDecrees.push(Utils.as(tt.getReferent(), DecreeReferent));
                    }
                    else 
                        break;
                }
                this.endToken = tt;
                continue;
            }
            if (tt.isNewlineBefore) 
                break;
            if (tt.isCharOf(":;,")) 
                break;
            if (DecreeChangeToken._canBeChangeToken(tt, 0, false, false)) 
                break;
            if (tt.lengthChar > 1) 
                errs++;
        }
    }
    
    static tryAttach(t, main = null, ignoreNewlines = false, changeStack = null, isInEdition = false, abzacRegime = false, defPart = null, nlBefore = false) {
        const DecreeToken = require("./DecreeToken");
        const PartToken = require("./PartToken");
        const InstrToken1 = require("./../../instrument/internal/InstrToken1");
        if (t === null) 
            return null;
        let tt = t;
        let _numBefore = null;
        let _isNewlineBefore = t.isNewlineBefore;
        if ((!_isNewlineBefore && t.previous !== null && t.previous.isChar(':')) && t.whitespacesBeforeCount > 0) 
            _isNewlineBefore = true;
        if ((t.previous !== null && ((t.previous.isCharOf(";.") || t.previous.isCommaAnd)) && t.previous.previous !== null) && (t.previous.previous.getReferent() instanceof DecreeChangeReferent)) 
            _isNewlineBefore = true;
        else if (t.previous !== null && (t.previous.getReferent() instanceof DecreeChangeReferent)) 
            _isNewlineBefore = true;
        if ((!_isNewlineBefore && t.previous !== null && t.previous.isTableControlChar) && ((t.previous.isNewlineBefore || main !== null))) 
            _isNewlineBefore = true;
        if ((_isNewlineBefore && t.previous !== null && t.previous.isValue("РЕДАКЦИЯ", null)) && ((BracketHelper.canBeStartOfSequence(t, true, false) || t.isNewlineBefore))) 
            _isNewlineBefore = false;
        if (nlBefore) 
            _isNewlineBefore = true;
        if (_isNewlineBefore && !ignoreNewlines) {
            for (tt = t; tt !== null; tt = tt.next) {
                if (tt.isChar('[')) {
                    let ii = MiscHelper.checkImage(tt);
                    if (ii !== null && !ii.isNewlineAfter && ii.next !== null) {
                        tt = ii;
                        continue;
                    }
                }
                if (t === tt) {
                    _numBefore = ComplexNumToken.tryParse(t, null, false, false);
                    if (_numBefore !== null) {
                        let pp = PartToken.tryAttach(t, null, false, false);
                        if (pp !== null) 
                            _numBefore = null;
                        else if (_numBefore.endToken.next !== null && _numBefore.endToken.next.isHiphen) {
                        }
                        else {
                            tt = _numBefore.endToken;
                            continue;
                        }
                    }
                }
                if ((tt === t && (tt instanceof TextToken) && ((tt.term === "СТАТЬЯ" || tt.term === "СТАТТЯ"))) && (tt.next instanceof NumberToken)) {
                    let tt1 = tt.next.next;
                    if (tt1 !== null && tt1.isChar('.')) {
                        tt1 = tt1.next;
                        if (tt1 !== null && !tt1.isNewlineBefore && tt1.isValue("ВНЕСТИ", "УНЕСТИ")) 
                            continue;
                        if (tt1 !== null && tt1.isNewlineBefore) 
                            return null;
                        tt = tt1;
                    }
                    break;
                }
                else if (tt === t && DecreeChangeToken._tryParsePart(tt, false) !== null) {
                    if ((tt instanceof NumberToken) && tt.next !== null && tt.next.isChar(')')) 
                        tt = tt.next.next;
                    break;
                }
                else if ((tt instanceof NumberToken) && tt.typ === NumberSpellingType.DIGIT) {
                }
                else if (tt.isHiphen || tt.isChar(')')) {
                }
                else if ((tt instanceof TextToken) && !tt.chars.isLetter && !tt.isWhitespaceBefore) {
                }
                else if (((tt instanceof TextToken) && tt.lengthChar === 1 && (tt.next instanceof TextToken)) && !tt.next.chars.isLetter) {
                    if (BracketHelper.canBeStartOfSequence(tt, true, false) && tt.previous !== null && tt.previous.isValue("ДОПОЛНИТЬ", null)) {
                        ignoreNewlines = true;
                        break;
                    }
                }
                else 
                    break;
            }
        }
        if (tt === null) 
            return null;
        let res = null;
        let te1 = null;
        let hasChange = false;
        if ((tt instanceof TextToken) && t.isNewlineBefore && !ignoreNewlines) {
            if (tt.isValue("ИЗЛОЖИТЬ", null)) {
            }
            let enter = false;
            if (tt.isValue("ВНЕСТИ", "УНЕСТИ") && ((((tt.next !== null && tt.next.isValue("В", "ДО"))) || tt.term === "ВНЕСТИ" || tt.term === "УНЕСТИ"))) {
                te1 = tt;
                if (tt.next !== null && tt.next.isValue("В", "ДО")) 
                    te1 = tt.next;
                enter = true;
            }
            else if (tt.isValue("ИЗМЕНЕНИЕ", null) && tt.next !== null && tt.next.isComma) {
                hasChange = true;
                for (let ttt = tt.next.next; ttt !== null; ttt = ttt.next) {
                    if (ttt.isValue("КОТОРЫЙ", null)) 
                        continue;
                    if (ttt.isValue("ВНОСИТЬСЯ", null) || ttt.isValue("ВНОСИМЫЙ", null)) 
                        continue;
                    if (ttt.isValue("В", "ДО")) {
                        te1 = ttt;
                        break;
                    }
                    break;
                }
            }
        }
        if (te1 !== null) {
            res = DecreeChangeToken._new1063(tt, te1, DecreeChangeTokenTyp.STARTMULTU, true, _numBefore);
            for (tt = te1.next; tt !== null; tt = tt.next) {
                if (tt.isNewlineBefore) {
                    if (MiscHelper.canBeStartOfSentence(tt)) 
                        break;
                }
                if (tt.isChar(':') && tt.whitespacesAfterCount > 0) {
                    res.endToken = tt;
                    break;
                }
                if (tt.getReferent() instanceof DecreeReferent) {
                    let dr = Utils.as(tt.getReferent(), DecreeReferent);
                    if (dr.kind === DecreeKind.PUBLISHER) {
                        res.endToken = tt;
                        continue;
                    }
                    if (res.decree === null) {
                        if (dr.kind === DecreeKind.PROJECT) 
                            return null;
                        res.decree = dr;
                    }
                    else {
                        if (res.addDecrees === null) 
                            res.addDecrees = new Array();
                        res.addDecrees.push(dr);
                    }
                    res.endToken = tt;
                    res._skipDecreeDummy();
                    tt = res.endToken;
                    continue;
                }
                if (tt.isValue2("СОГЛАСНО", "ПРИЛОЖЕНИЕ")) {
                    res.appExtChanges = PartToken.tryAttach(tt.next, null, false, false);
                    if (res.appExtChanges !== null) {
                        if (res.appExtChanges.endToken.next !== null && res.appExtChanges.endToken.next.isValue("К", null)) {
                            let npt = NounPhraseHelper.tryParse(res.appExtChanges.endToken.next, NounPhraseParseAttr.of((NounPhraseParseAttr.REFERENTCANBENOUN.value()) | (NounPhraseParseAttr.PARSEPREPOSITION.value())), 0, null);
                            if (npt !== null) {
                                res.endToken = (tt = npt.endToken);
                                hasChange = true;
                                continue;
                            }
                        }
                        res.endToken = (tt = res.appExtChanges.endToken);
                        hasChange = true;
                        continue;
                    }
                }
                if ((tt.getReferent() instanceof DecreePartReferent) && res.realPart === null) {
                    res.realPart = Utils.as(tt.getReferent(), DecreePartReferent);
                    res.endToken = tt;
                    continue;
                }
                let li = DecreeChangeToken._tryParsePartList(tt);
                if (li !== null && li.length > 0) {
                    if (res.parts !== null) 
                        break;
                    res.parts = li;
                    tt = res.endToken = li[li.length - 1].endToken;
                    if (res.decree === null && li[li.length - 1].decree !== null) {
                        res.decree = li[li.length - 1].decree;
                        res.endToken = li[li.length - 1].endToken;
                        res._skipDecreeDummy();
                        tt = res.endToken;
                    }
                    continue;
                }
                if (tt.isChar('(')) {
                    let br = BracketHelper.tryParse(tt, BracketParseAttr.CANBEMANYLINES, 100);
                    if (br !== null) {
                        tt = br.endToken;
                        continue;
                    }
                }
                if (tt.isNewlineBefore) 
                    break;
                res.endToken = tt;
                if (tt.isCommaAnd && tt.next !== null && (tt.next.getReferent() instanceof DecreeReferent)) 
                    continue;
                if (tt.isChar(',') && hasChange) {
                    if (tt.next === null) 
                        break;
                    tt = tt.next;
                    let ok = false;
                    for (let ttt = tt; ttt !== null; ttt = ttt.next) {
                        if (tt.isValue("ИЗЛОЖИТЬ", null)) 
                            res.actKind = DecreeChangeKind.NEW;
                        if (ttt.isValue2("СОГЛАСНО", "ПРИЛОЖЕНИЕ")) {
                            tt = ttt.previous;
                            ok = true;
                            break;
                        }
                        if (ttt.isNewlineBefore) 
                            break;
                    }
                    if (ok) 
                        continue;
                    res.typ = DecreeChangeTokenTyp.STARTSINGLE;
                    if (tt.isValue("ИЗЛОЖИТЬ", null)) {
                        if (tt.next !== null && tt.next.isValue("ОН", null)) 
                            tt = tt.next;
                        if (tt.isValue2("СОГЛАСНО", "ПРИЛОЖЕНИЕ")) {
                            tt = tt.previous;
                            continue;
                        }
                        let li2 = DecreeChangeToken._tryParsePartList(tt.next);
                        if (li2 !== null && li2.length === 1) {
                            if (res.parts !== null) {
                                li2[0].beginToken = li2[0].endToken = res.parts[res.parts.length - 1].endToken;
                                res.parts.push(li2[0]);
                            }
                            else {
                                res.parts = new Array();
                                res.parts.push(li2[0]);
                                tt = li2[0].endToken;
                            }
                        }
                    }
                    break;
                }
                if (tt.isValue("ИЗМЕНЕНИЕ", "ЗМІНА") || tt.isValue("ДОПОЛНЕНИЕ", "ДОДАТОК") || tt.isValue("ВНЕСТИ", null)) 
                    hasChange = true;
                else if (tt.isValue("СЛЕДУЮЩИЙ", "НАСТУПНИЙ")) {
                }
                else if (tt.isValue("ТАКОЙ", "ТАКИЙ")) {
                }
                else if (tt.isValue2("С", "ИЗМЕНЕНИЕ")) {
                    tt = tt.next;
                    if (tt.next !== null && tt.next.isComma) 
                        tt = tt.next;
                }
            }
            if (!hasChange && !res.hasChangeKeyword) 
                return null;
            if (res.decree === null && res.parts === null && res.realPart === null) 
                return null;
            tt = res.endToken.next;
            res.hasChangeKeyword = true;
            if (res.typ === DecreeChangeTokenTyp.STARTSINGLE && res.parts === null && tt !== null) {
                if ((tt.isValue("ИЗЛОЖИВ", "ВИКЛАВШИ") || tt.isValue("ДОПОЛНИВ", "ДОПОВНИВШИ") || tt.isValue("ИСКЛЮЧИВ", "ВИКЛЮЧИВШИ")) || tt.isValue("ЗАМЕНИВ", "ЗАМІНИВШИ")) {
                    tt = tt.next;
                    if (tt !== null && tt.morph._class.isPreposition) 
                        tt = tt.next;
                    res.parts = DecreeChangeToken._tryParsePartList(tt);
                    if (res.parts !== null) {
                        tt = res.endToken.next;
                        if (tt.isValue("ДОПОЛНИВ", "ДОПОВНИВШИ")) 
                            res.actKind = DecreeChangeKind.APPEND;
                        else if (tt.isValue("ИСКЛЮЧИВ", "ВИКЛЮЧИВШИ")) 
                            res.actKind = DecreeChangeKind.REMOVE;
                        else if (tt.isValue("ИЗЛОЖИВ", "ВИКЛАВШИ")) 
                            res.actKind = DecreeChangeKind.NEW;
                        else if (tt.isValue("ЗАМЕНИВ", "ЗАМІНИВШИ")) 
                            res.actKind = DecreeChangeKind.EXCHANGE;
                        res.endToken = res.parts[res.parts.length - 1].endToken;
                        if (res.actKind === DecreeChangeKind.APPEND) {
                            let pp = DecreeChangeToken._tryParsePartList(res.endToken.next);
                            if (pp !== null && pp.length === 1) {
                                res.newParts = pp;
                                res.endToken = pp[0].endToken;
                            }
                        }
                    }
                }
            }
            return res;
        }
        let ttExpire = null;
        let isSuspend = false;
        let isRollback = false;
        if (!ignoreNewlines && _isNewlineBefore) {
            for (let tt2 = tt; tt2 !== null; tt2 = tt2.next) {
                if (tt2 !== tt && tt2.isNewlineBefore) 
                    break;
                if (tt2.getReferent() !== null) 
                    continue;
                if (tt2.isChar('(')) {
                    let br = BracketHelper.tryParse(tt2, BracketParseAttr.NO, 100);
                    if (br !== null) {
                        tt2 = br.endToken;
                        continue;
                    }
                }
                let dt = DecreeToken.tryAttach(tt2, null, false);
                if (dt !== null && dt.typ === DecreeTokenItemType.TYP) {
                    tt2 = dt.endToken;
                    continue;
                }
                let mc = tt2.getMorphClassInDictionary();
                if (mc.isPreposition || ((mc.isAdjective && !mc.isVerb)) || mc.isPronoun) 
                    continue;
                if (tt2.isCommaAnd) 
                    continue;
                if (tt2.isValue("МОМЕНТ", null) || tt2.isValue("ДЕНЬ", null)) 
                    continue;
                if (tt2.isValue3("ВСТУПЛЕНИЕ", "В", "СИЛУ")) {
                    tt2 = tt2.next.next;
                    continue;
                }
                if ((tt2.isValue("ПРИЗНАТЬ", "ВИЗНАТИ") || tt2.isValue("ПРИЗНАВАЕМЫЙ", null) || tt2.isValue("СЧИТАТЬ", "ВВАЖАТИ")) || tt2.isValue("ПЕРЕЧЕНЬ", null)) {
                    let tt3 = tt2.next;
                    if (tt3 !== null && tt3.isComma) 
                        tt3 = tt3.next;
                    if (tt3 === null) 
                        continue;
                    if (tt3.isValue("УТРАТИТЬ", "ВТРАТИТИ")) {
                        if (tt3.next !== null && tt3.next.isValue("СИЛА", "ЧИННІСТЬ")) {
                            ttExpire = tt3.next;
                            if (ttExpire.next !== null && ttExpire.next.isValue("ИЗМЕНЕНИЕ", null)) {
                                ttExpire = ttExpire.next;
                                isRollback = true;
                            }
                            break;
                        }
                    }
                }
                if (tt.isValue("ПРИОСТАНОВИТЬ", null) && tt.next !== null) {
                    if (tt.next.isValue("ДЕЙСТВИЕ", null) || tt.next.isValue("С", null)) {
                        ttExpire = tt.next;
                        isSuspend = true;
                        break;
                    }
                }
                break;
            }
        }
        if (ttExpire !== null) {
            res = DecreeChangeToken._new1064(tt, ttExpire, DecreeChangeTokenTyp.ACTION, (isRollback ? DecreeChangeKind.EXPIRECHANGES : (isSuspend ? DecreeChangeKind.SUSPEND : DecreeChangeKind.EXPIRE)), _numBefore);
            let dayAfter = false;
            for (; tt !== null; tt = tt.next) {
                if (tt.isChar(':') && tt.endChar > ttExpire.endChar) {
                    res.typ = DecreeChangeTokenTyp.STARTMULTU;
                    if (tt.endChar > res.endChar) 
                        res.endToken = tt;
                    break;
                }
                if (tt.isValue2("ДЕНЬ", "ВВЕДЕНИЯ")) 
                    dayAfter = true;
                if (tt.getReferent() instanceof DecreeReferent) {
                    if (!dayAfter) {
                        if (res.decree !== null) {
                            if (!res.decree.canBeEquals(tt.getReferent(), ReferentsEqualType.WITHINONETEXT)) {
                                if (res.actKind !== DecreeChangeKind.EXPIRECHANGES) 
                                    break;
                            }
                        }
                        if (tt.previous !== null && tt.previous.isValue("СОГЛАСНО", null)) {
                        }
                        else {
                            res.typ = DecreeChangeTokenTyp.STARTSINGLE;
                            if (res.decree === null) 
                                res.decree = Utils.as(tt.getReferent(), DecreeReferent);
                        }
                    }
                    if (tt.endChar > res.endChar) 
                        res.endToken = tt;
                    res._skipDecreeDummy();
                    tt = res.endToken;
                    continue;
                }
                let li = DecreeChangeToken._tryParsePartList(tt);
                if (li !== null && li.length > 0 && !tt.isValue("СИЛА", null)) {
                    if (!dayAfter) {
                        if (res.parts !== null) 
                            break;
                        if (tt.previous !== null && tt.previous.isValue("СОГЛАСНО", null)) {
                        }
                        else if (tt.isValue("СОГЛАСНО", null)) {
                        }
                        else {
                            res.typ = DecreeChangeTokenTyp.STARTSINGLE;
                            res.parts = li;
                        }
                    }
                    tt = li[li.length - 1].endToken;
                    if (tt.endChar > res.endChar) 
                        res.endToken = tt;
                    res._skipDecreeDummy();
                    continue;
                }
                if (tt.isValue2("В", "ЧАСТИ")) {
                    tt = tt.next;
                    continue;
                }
                if (tt.isChar(')')) {
                    res.endToken = tt;
                    continue;
                }
                if (tt.isComma || tt.isValue("КАСАЮЩИЙСЯ", null)) 
                    continue;
                if (res.actKind === DecreeChangeKind.EXPIRECHANGES) {
                    if (tt.isValue("КОТОРЫЙ", null) || tt.isValue("ВНОСИТЬСЯ", null) || tt.isValue("В", null)) 
                        continue;
                }
                if (tt.isChar('(')) {
                    if (tt.next !== null && tt.next.isValue2("В", "ЧАСТИ")) {
                        tt = tt.next.next;
                        continue;
                    }
                    let br = BracketHelper.tryParse(tt, BracketParseAttr.NO, 100);
                    if (br !== null) {
                        tt = br.endToken;
                        continue;
                    }
                }
                let npt = NounPhraseHelper.tryParse(tt, NounPhraseParseAttr.NO, 0, null);
                if (npt !== null) {
                    if (npt.endToken.isValue("АКТ", null) || npt.endToken.isValue("ПОЛОЖЕНИЕ", null)) {
                        tt = npt.endToken;
                        if (tt.endChar > res.endChar) 
                            res.endToken = tt;
                        continue;
                    }
                }
                let r = tt.getReferent();
                if (r !== null && r.typeName === "ORGANIZATION") {
                    if (tt.endChar > res.endChar) 
                        res.endToken = tt;
                    continue;
                }
                if (tt.isNewlineBefore && tt.beginChar > ttExpire.beginChar) {
                    res.typ = DecreeChangeTokenTyp.STARTMULTU;
                    break;
                }
                if (tt.isValue("ПОЗИЦИЯ", null) && tt.next !== null && tt.next.isChar(':')) {
                    let d = DecreeChangeToken._tryParseText(tt.next.next, false, false, null);
                    if (d !== null) {
                        res.actKind = DecreeChangeKind.REMOVE;
                        res.changeVal = d.changeVal;
                        res.typ = DecreeChangeTokenTyp.ACTION;
                        tt = res.endToken = d.endToken;
                        break;
                    }
                }
            }
            return res;
        }
        if ((!ignoreNewlines && ((_isNewlineBefore || tt === t)) && tt.isValue("УТРАТИТЬ", "ВТРАТИТИ")) && tt.next !== null && tt.next.isValue("СИЛА", "ЧИННІСТЬ")) {
            res = DecreeChangeToken._new1048(tt, tt.next, DecreeChangeTokenTyp.UNDEFINED);
            for (tt = tt.next; tt !== null; tt = tt.next) {
                res.endToken = tt;
                if (tt.isNewlineAfter) 
                    break;
            }
            return res;
        }
        if (!ignoreNewlines && _isNewlineBefore && !tt.isValue2("В", "КОНЦЕ")) {
            if (tt.isValue("СТРОКУ", null)) {
            }
            res = DecreeChangeToken._new1066(tt, tt, DecreeChangeTokenTyp.STARTSINGLE, _numBefore);
            let izlogit = null;
            let specRegime = false;
            let falseTableRow = false;
            let aboutChanges = false;
            for (; tt !== null; tt = tt.next) {
                if (tt !== res.beginToken && tt.isNewlineBefore) {
                    if (res.decree === null && (tt.getReferent() instanceof DecreeReferent)) {
                    }
                    else 
                        break;
                }
                if (tt.isValue("В", null) || tt.isValue("B", null)) {
                    if (tt !== res.beginToken || !(tt instanceof TextToken)) 
                        continue;
                    if (tt.next !== null && tt.next.isValue("ТЕКСТ", null)) {
                        res.endToken = (tt = tt.next);
                        res.hasText = true;
                    }
                    if (tt.next !== null && tt.next.isValue("УКАЗАННЫЙ", null)) {
                        let ppp = PartToken.tryAttach(tt.next.next, null, false, false);
                        if (ppp !== null) {
                            tt = tt.next;
                            continue;
                        }
                        ppp = PartToken.tryAttach(tt.next.next, null, false, true);
                        if (ppp !== null) {
                            res.endToken = (tt = ppp.endToken);
                            continue;
                        }
                    }
                    if (tt.next !== null && tt.next.isValue("СООТВЕТСТВИЕ", null)) 
                        return null;
                    let prr = DecreeChangeToken._tryParsePart(tt.next, false);
                    if (prr !== null) 
                        continue;
                    if (tt.next !== null && (tt.next.getReferent() instanceof DecreePartReferent)) {
                        res.realPart = Utils.as(tt.next.getReferent(), DecreePartReferent);
                        tt = tt.next;
                        res.endToken = tt;
                        continue;
                    }
                    let hasKeyword = DecreeToken.isKeyword(tt.next, false) !== null;
                    for (let tt2 = tt.next; tt2 !== null; tt2 = tt2.next) {
                        if (tt2.isCharOf(":;") || tt2.isNewlineBefore) 
                            break;
                        let br = BracketHelper.tryParse(tt2, BracketParseAttr.NO, 100);
                        if (br !== null) {
                            tt2 = br.endToken;
                            continue;
                        }
                        let pt = PartToken.tryAttach(tt2, null, false, false);
                        if (pt !== null && pt.typ === PartTokenItemType.APPENDIX) {
                            if (res.parts === null) {
                                res.parts = new Array();
                                res.parts.push(pt);
                                tt2 = pt.endToken;
                                continue;
                            }
                        }
                        if (tt2.isValue("УТВЕРЖДЕННЫЙ", null) && (tt2.next instanceof ReferentToken) && (tt2.next.getReferent() instanceof DecreeReferent)) {
                            tt = tt2;
                            break;
                        }
                        if ((tt2.getReferent() instanceof DecreeReferent) && hasKeyword) {
                            tt = tt2.previous;
                            break;
                        }
                    }
                    continue;
                }
                if (tt.isValue2("К", "ОН")) {
                    res.endToken = (tt = tt.next);
                    continue;
                }
                if (tt.isValue("К", null) || tt.isValue("K", null)) {
                    if (tt === res.beginToken && tt.previous !== null && tt.previous.isValue("ПРИЛОЖЕНИЕ", null)) 
                        return null;
                    continue;
                }
                if (tt === t && t.isNewlineBefore && t.isValue3("О", "ВНЕСЕНИЕ", "ИЗМЕНЕНИЙ")) {
                    aboutChanges = true;
                    tt = tt.next.next;
                    if (tt.next !== null && tt.next.isValue("В", null)) 
                        tt = tt.next;
                    continue;
                }
                if (tt.isValue("ИЗ", null)) 
                    continue;
                if (((tt.isValue("ПЕРЕЧЕНЬ", "ПЕРЕЛІК") || tt.isValue("СПИСОК", null))) && tt.next !== null && tt.next.isValue("ИЗМЕНЕНИЕ", "ЗМІНА")) {
                    if (tt === t) 
                        res.endToken = tt.next;
                    tt = tt.next.next;
                    res.typ = DecreeChangeTokenTyp.STARTMULTU;
                    for (; tt !== null && tt.next !== null; tt = tt.next) {
                        if ((tt.next.isComma || tt.next.isValue("КОТОРЫЙ", null) || tt.next.isValue("ВНОСИТЬ", null)) || tt.next.isValue("ВНОСИМЫЙ", null)) 
                            res.endToken = tt;
                        else 
                            break;
                    }
                    if (tt.isNewlineBefore) 
                        return res;
                    continue;
                }
                if (tt.isValue("ИЗМЕНЕНИЕ", null) && tt === t) {
                    res.typ = DecreeChangeTokenTyp.STARTMULTU;
                    res.hasChangeKeyword = true;
                    for (; tt !== null && tt.next !== null; tt = tt.next) {
                        if ((tt.next.isComma || tt.next.isValue("КОТОРЫЙ", null) || tt.next.isValue("ВНОСИТЬ", null)) || tt.next.isValue("ВНОСИМЫЙ", null)) 
                            res.endToken = tt;
                        else 
                            break;
                    }
                    continue;
                }
                if (tt.isValue("ТЕКСТ", null)) {
                    let pt = DecreeChangeToken._tryParsePart(tt.next, true);
                    if (pt !== null && pt.endToken.next !== null && pt.endToken.next.isValue("СЧИТАТЬ", "ВВАЖАТИ")) {
                        res.endToken = pt.endToken;
                        if (changeStack !== null && changeStack.length > 0) 
                            res.realPart = changeStack[0];
                        res.actKind = DecreeChangeKind.CONSIDER;
                        res.partTyp = pt.typ;
                        res.hasText = true;
                        return res;
                    }
                }
                if (tt.isValue2("И", "ТЕКСТ")) {
                    res.hasText = true;
                    res.endToken = (tt = tt.next);
                    continue;
                }
                if (tt.isValue3("ПО", "ВСЕМУ", "ТЕКСТУ")) {
                    res.hasText = true;
                    res.endToken = (tt = tt.next.next);
                    continue;
                }
                if (res.parts === null && tt.isValue("ДОПОЛНИТЬ", "ДОПОВНИТИ") && tt.next !== null) {
                    res.actKind = DecreeChangeKind.APPEND;
                    if (tt.next.getReferent() instanceof DecreeReferent) 
                        continue;
                    tt = tt.next;
                    let tt1 = DecreeToken.isKeyword(tt, false);
                    let pp = DecreeChangeToken._tryParsePart(tt, true);
                    if (tt1 === null || pp !== null) {
                        tt1 = tt;
                        if (pp !== null && !pp.morph._case.isInstrumental) {
                            let ok = pp.values.length > 0 || pp.name !== null;
                            if (!ok) {
                                if (pp.typ === PartTokenItemType.NAME || pp.typ === PartTokenItemType.PREAMBLE || pp.typ === PartTokenItemType.FREETEXT) 
                                    ok = true;
                            }
                            if (ok) {
                                if (res.parts === null) {
                                    res.parts = new Array();
                                    res.parts.push(pp);
                                }
                            }
                            tt1 = pp.endToken.next;
                        }
                    }
                    else if (tt1.morph._case.isInstrumental) 
                        tt1 = tt;
                    else 
                        tt1 = tt1.next;
                    if (tt1 !== null && tt1.isValue("НОВЫЙ", "НОВИЙ")) 
                        tt1 = tt1.next;
                    if ((tt1 instanceof TextToken) && tt1.morph._case.isInstrumental && tt1.term !== "СТАТЬЮ") {
                        let pt = DecreeChangeToken._tryParsePart(tt1, true);
                        if (pt !== null && pt.values.length === 0 && tt1.isValue("СТРОКА", null)) {
                            if (BracketHelper.isBracket(tt1.next, false)) {
                                pt = null;
                                falseTableRow = true;
                            }
                            else if (tt1.next !== null && tt1.next.isChar(':') && BracketHelper.isBracket(tt1.next.next, false)) {
                                pt = null;
                                falseTableRow = true;
                            }
                        }
                        if (pt !== null && pt.typ !== PartTokenItemType.PREFIX) {
                            res.partTyp = pt.typ;
                            tt = res.endToken = pt.endToken;
                            if (res.newParts === null) 
                                res.newParts = new Array();
                            res.newParts.push(pt);
                            if (tt.next !== null && tt.next.isAnd) {
                                pt = DecreeChangeToken._tryParsePart(tt.next.next, true);
                                if (pt !== null) {
                                    res.newParts.push(pt);
                                    tt = res.endToken = pt.endToken;
                                }
                            }
                        }
                        if (!falseTableRow) 
                            continue;
                    }
                }
                if (tt.isValue("ДОПОЛНИТЬ", "ДОПОВНИТИ") && tt.next !== null && tt.next.isChar(':')) {
                    res.actKind2 = DecreeChangeKind.APPEND;
                    res.endToken = tt.next;
                    return res;
                }
                if (res.actKind === DecreeChangeKind.UNDEFINED && tt.isValue("ИСКЛЮЧИТЬ", null) && !tt.morph.containsAttr("п.вр.", null)) {
                    res.endToken = tt;
                    res.actKind = DecreeChangeKind.REMOVE;
                    continue;
                }
                if (tt.getReferent() instanceof DecreePartReferent) {
                    if (res.realPart === null) 
                        res.realPart = Utils.as(tt.getReferent(), DecreePartReferent);
                    else {
                        if (res.addRealParts === null) 
                            res.addRealParts = new Array();
                        res.addRealParts.push(Utils.as(tt.getReferent(), DecreePartReferent));
                    }
                    res.endToken = tt;
                    continue;
                }
                if (tt.isChar('(')) {
                    let ali = DecreeAnalyzer._checkAliasAfter(tt);
                    if (ali !== null) {
                        res.alias = ali;
                        res.endToken = (tt = ali.endToken);
                        continue;
                    }
                }
                let li = DecreeChangeToken._tryParsePartList(tt);
                if (li !== null && li[li.length - 1].endToken.next !== null && li[li.length - 1].endToken.next.isTableControlChar) {
                    let li2 = DecreeChangeToken._tryParsePartList(li[li.length - 1].endToken.next.next);
                    if (li2 !== null) 
                        li.splice(li.length, 0, ...li2);
                }
                if (li === null && tt.isValue("ПРИМЕЧАНИЕ", "ПРИМІТКА")) {
                    li = new Array();
                    li.push(PartToken._new1058(tt, tt, PartTokenItemType.NOTICE));
                }
                if (li === null) {
                    if ((tt.isValue("ЧАСТЬ", null) || tt.isValue("ПУНКТ", null) || tt.isValue("ПОДПУНКТ", null)) || tt.isValue("АБЗАЦ", null)) {
                        li = DecreeChangeToken._tryParsePartList(tt.next);
                        if (li !== null) 
                            res.inPart = tt;
                    }
                }
                if (li !== null && li.length > 0) {
                    if (li[0].typ === PartTokenItemType.PREFIX) 
                        li = null;
                    else if (li[0].typ === PartTokenItemType.TABLE && li[0].values.length === 0 && main === null) 
                        li = null;
                    else if (res.changeVal !== null) 
                        li = null;
                }
                if (li !== null && li.length > 0) {
                    if (res.decree === null && li[li.length - 1].decree !== null) {
                        res.decree = li[li.length - 1].decree;
                        res.endToken = li[li.length - 1].endToken;
                        res._skipDecreeDummy();
                        tt = li[li.length - 1].endToken = res.endToken;
                    }
                    if (li[li.length - 1].isConfidential) 
                        res.actKind = DecreeChangeKind.CONFIDENTIAL;
                    if (res.parts !== null && res.parts.length === 1) {
                        if (((res.parts[0].typ === PartTokenItemType.NAME && res.hasText)) || res.parts[0].typ === PartTokenItemType.FREETEXT) {
                            res.parts.splice(res.parts.length, 0, ...li);
                            res.endToken = (tt = li[li.length - 1].endToken);
                            continue;
                        }
                    }
                    if ((li.length === 1 && li[0].morph._case.isInstrumental && !li[0].morph._case.isAccusative) && res.newParts === null) {
                        res.newParts = new Array();
                        res.newParts.push(li[0]);
                        res.endToken = (tt = li[0].endToken);
                        continue;
                    }
                    if (li.length === 1 && PartToken._getRank(li[0].typ) > 0 && tt === t) {
                        if (li[0].isNewlineAfter) 
                            return null;
                        if (li[0].endToken.next !== null && li[0].endToken.next.isChar('.')) 
                            return null;
                    }
                    if (((li[li.length - 1].typ === PartTokenItemType.TABLE || li[li.length - 1].typ === PartTokenItemType.FORM)) && li[li.length - 1].name === null) {
                        let tt0 = li[li.length - 1].endToken.next;
                        let tt1 = null;
                        for (let ttt2 = tt0; ttt2 !== null; ttt2 = ttt2.next) {
                            if (ttt2.isComma) 
                                continue;
                            if (ttt2.isNewlineBefore && ttt2 !== tt0) {
                                if (ttt2.chars.isAllLower && !DecreeChangeToken._canBeChangeToken(ttt2, 0, false, false)) {
                                }
                                else 
                                    break;
                            }
                            if (ttt2.isCharOf(":;")) 
                                break;
                            if (ttt2 === tt0 && ttt2.isChar('(')) 
                                break;
                            if (ttt2.getReferent() instanceof DecreeReferent) 
                                break;
                            if (DecreeChangeToken.M_TERMS.tryParse(ttt2, TerminParseAttr.NO) !== null) {
                                if (ttt2.isValue("КОД", null)) {
                                }
                                else 
                                    break;
                            }
                            let ptt = DecreeChangeToken._tryParsePart(ttt2, false);
                            if (ptt !== null && ptt.typ !== PartTokenItemType.PREFIX) 
                                break;
                            let mc = ttt2.getMorphClassInDictionary();
                            if (!mc.isPreposition) 
                                tt1 = ttt2;
                        }
                        if (tt1 !== null) {
                            li[li.length - 1].endToken = tt1;
                            li[li.length - 1].name = new MetaToken(tt0, tt1);
                            tt1 = tt1.next;
                            if (tt1 !== null && tt1.isComma) 
                                tt1 = tt1.next;
                            if (tt1 !== null && tt1.isValue("В", null)) {
                                li[li.length - 1].endToken = tt1;
                                tt1 = tt1.next;
                            }
                            if (tt1 === null) 
                                break;
                            let pp = DecreeChangeToken._tryParsePartList(tt1);
                            if (pp !== null && pp.length > 0) 
                                li.splice(li.length, 0, ...pp);
                        }
                    }
                    if (res.actKind !== DecreeChangeKind.APPEND) {
                        if (res.parts !== null) {
                            if (res.parts.length === 1 && ((res.parts[0].typ === PartTokenItemType.APPENDIX || res.parts[0].typ === PartTokenItemType.DOCPART))) {
                                if (li.length > 1 && PartToken._getRank(li[0].typ) > PartToken._getRank(li[li.length - 1].typ)) 
                                    res.parts.splice(0, 0, ...li);
                                else 
                                    res.parts.splice(res.parts.length, 0, ...li);
                            }
                            else if (tt.previous === null) 
                                break;
                            else if (tt.previous.isChar('(')) {
                                res.parts.splice(res.parts.length, 0, ...li);
                                res.endToken = (tt = li[li.length - 1].endToken);
                                if (tt.next !== null && tt.next.isChar(')')) 
                                    res.endToken = (tt = tt.next);
                                continue;
                            }
                            else {
                                if (tt.previous.isCommaAnd) {
                                }
                                else if (tt.previous.isValue("В", null) && tt.previous.previous !== null && tt.previous.previous.isCommaAnd) {
                                }
                                else 
                                    break;
                                if (res.addParts === null) 
                                    res.addParts = new Array();
                                res.addParts.push(li);
                            }
                        }
                        else {
                            res.parts = li;
                            let ttt1 = li[li.length - 1].endToken;
                            if (ttt1.next !== null && ttt1.next.isValue("ПОСЛЕ", null)) {
                                let sss = DecreeChangeToken._tryParsePart(ttt1.next.next, false);
                                if (sss !== null) {
                                    li.push(sss);
                                    ttt1 = sss.endToken;
                                }
                            }
                            for (; ttt1 !== null; ttt1 = ttt1.next) {
                                if (ttt1.isNewlineBefore || ttt1.isTableControlChar) 
                                    break;
                                let pp = DecreeChangeToken._tryParsePart(ttt1, false);
                                if (pp !== null && pp.typ !== PartTokenItemType.PREFIX) 
                                    break;
                                if (ttt1.isValue3("ВСТУПАТЬ", "В", "СИЛУ")) {
                                    res.ignorable = true;
                                    break;
                                }
                                if (((ttt1.isValue3("ИЗЛОЖИТЬ", "В", "СЛЕДУЮЩЕЙ") || ttt1.isValue3("ПРИНЯТЬ", "В", "СЛЕДУЮЩЕЙ") || ttt1.isValue3("ИЗЛОЖИТЬ", "В", "НОВОЙ")) || ttt1.isValue3("ИЗЛОЖИТЬ", "В", "РЕДАКЦИИ") || ttt1.isValue3("В", "СЛЕДУЮЩЕЙ", "РЕДАКЦИИ")) || ttt1.isValue3("В", "РЕДАКЦИИ", "ПРИЛОЖЕНИЯ")) {
                                    izlogit = ttt1.previous;
                                    break;
                                }
                                if (DecreeChangeToken.M_TERMS.tryParse(ttt1, TerminParseAttr.NO) !== null) 
                                    break;
                                if (ttt1.isChar('(') && res.decree === null) {
                                    let app = PartToken.tryAttach(ttt1.next, null, false, false);
                                    if (app !== null && app.typ === PartTokenItemType.APPENDIX) {
                                        if ((app.endToken.next !== null && app.endToken.next.isValue("К", null) && (app.endToken.next.next instanceof ReferentToken)) && (app.endToken.next.next.getReferent() instanceof DecreeReferent)) {
                                            app.name = new MetaToken(li[li.length - 1].endToken.next, ttt1.previous);
                                            res.parts.push(app);
                                            res.decree = Utils.as(app.endToken.next.next.getReferent(), DecreeReferent);
                                            ttt1 = app.endToken.next.next;
                                            if (ttt1.next !== null && ttt1.next.isChar(')')) 
                                                ttt1 = ttt1.next;
                                            res.endToken = (tt = ttt1);
                                        }
                                    }
                                }
                            }
                            if (res.decree !== null) 
                                continue;
                        }
                    }
                    else if (li.length === 1 && li[0].morph !== null && li[0].morph._case.isInstrumental) {
                        if (res.newParts === null) 
                            res.newParts = new Array();
                        res.newParts.push(li[0]);
                    }
                    else if (res.parts === null) 
                        res.parts = li;
                    tt = res.endToken = li[li.length - 1].endToken;
                    continue;
                }
                if (tt.morph._class.isNoun && changeStack !== null && changeStack.length > 0) {
                    let pa = DecreeChangeToken._tryParsePart(tt, true);
                    if (pa !== null && pa.typ === PartTokenItemType.TABLEROW && tt.next !== null) {
                        if (tt.next.isCharOf(":") || BracketHelper.isBracket(tt.next, true)) 
                            pa = null;
                    }
                    if (pa !== null) {
                        if (changeStack[0].getStringValue(PartToken._getAttrNameByTyp(pa.typ)) !== null) {
                            res.realPart = changeStack[0];
                            res.endToken = tt;
                            continue;
                        }
                    }
                }
                if (res.actKind === DecreeChangeKind.APPEND) {
                    let pa = DecreeChangeToken._tryParsePart(tt, true);
                    if (pa !== null && tt.isValue("СТРОКА", null) && falseTableRow) 
                        pa = null;
                    if (pa !== null && pa.typ !== PartTokenItemType.PREFIX) {
                        if (res.newParts === null) 
                            res.newParts = new Array();
                        res.newParts.push(pa);
                        res.endToken = pa.endToken;
                        continue;
                    }
                }
                if (tt.getReferent() instanceof DecreeReferent) {
                    let ki = tt.getReferent().kind;
                    if (ki === DecreeKind.PUBLISHER) 
                        continue;
                    if (tt.morph._case.isInstrumental) {
                        if (tt.isNewlineBefore) 
                            return null;
                    }
                    if (res.decree === null) 
                        res.decree = Utils.as(tt.getReferent(), DecreeReferent);
                    else if ((Utils.as(tt.getReferent(), DecreeReferent)) !== res.decree) {
                        if (res.addDecrees === null) 
                            res.addDecrees = new Array();
                        res.addDecrees.push(Utils.as(tt.getReferent(), DecreeReferent));
                    }
                    res.endToken = tt;
                    res._skipDecreeDummy();
                    tt = res.endToken;
                    if (tt.whitespacesAfterCount < 3) {
                        li = DecreeChangeToken._tryParsePartList(tt.next);
                        if (li !== null && !li[0].morph._case.isInstrumental) {
                            if (res.parts === null) 
                                res.parts = li;
                            else 
                                res.parts.splice(res.parts.length, 0, ...li);
                            PartToken.sort(res.parts);
                            tt = res.endToken = li[li.length - 1].endToken;
                        }
                    }
                    continue;
                }
                let pt0 = DecreeChangeToken._tryParsePart(tt, true);
                if (pt0 !== null && (pt0.typ === PartTokenItemType.APPENDIX) && pt0.typ !== PartTokenItemType.PREFIX) {
                    if (res.beginToken === tt && pt0.isNewlineAfter) 
                        return null;
                    tt = res.endToken = pt0.endToken;
                    res.partTyp = pt0.typ;
                    if (pt0.typ === PartTokenItemType.APPENDIX && res.parts === null) {
                        res.parts = new Array();
                        res.parts.push(pt0);
                    }
                    continue;
                }
                if (res.changeVal === null && !isInEdition) {
                    let res1 = null;
                    if (tt.isChar(':') && !BracketHelper.canBeStartOfSequence(tt.next, true, false)) 
                        res1 = null;
                    else if (tt.kit.level <= 1 && !tt.isChar('<')) {
                        tt.kit.level++;
                        res1 = DecreeChangeToken.tryAttach(tt, main, true, null, false, false, (res.newParts !== null && res.newParts.length === 1 ? res.newParts[0] : null), false);
                        tt.kit.level--;
                    }
                    if (res1 !== null && res1.typ === DecreeChangeTokenTyp.VALUE && res1.changeVal !== null) {
                        res.changeVal = res1.changeVal;
                        res.inTheEnd = res1.inTheEnd;
                        if (res.actKind === DecreeChangeKind.UNDEFINED) 
                            res.actKind = res1.actKind;
                        tt = res.endToken = res1.endToken;
                        if (tt.next !== null && tt.next.isValue("К", null)) 
                            tt = tt.next;
                        continue;
                    }
                    if (res1 !== null && res1.actKind === DecreeChangeKind.CONSIDER) 
                        izlogit = null;
                    if (tt.isValue("ПОСЛЕ", "ПІСЛЯ")) {
                        let pts0 = DecreeChangeToken._tryParsePartList(tt.next);
                        let _inPart = null;
                        if (pts0 === null && tt.next !== null) {
                            if ((tt.next.isValue("ЧАСТЬ", null) || tt.next.isValue("ПУНКТ", null) || tt.next.isValue("ПОДПУНКТ", null)) || tt.next.isValue("АБЗАЦ", null)) {
                                pts0 = DecreeChangeToken._tryParsePartList(tt.next.next);
                                if (pts0 !== null) 
                                    _inPart = tt.next;
                            }
                        }
                        if (pts0 !== null && pts0.length > 0 && pts0[0].typ !== PartTokenItemType.PREFIX) {
                            let tt2 = pts0[pts0.length - 1].endToken.next;
                            while (tt2 !== null && ((tt2.isValue("НОВЫЙ", null) || tt2.isValue("ДОПОЛНИТЬ", null)))) {
                                tt2 = tt2.next;
                            }
                            let pt2 = DecreeChangeToken._tryParsePart(tt2, true);
                            if (pt2 !== null && pt2.typ === pts0[0].typ) {
                                if (pt2.values.length > 0) {
                                    res.parts = pts0;
                                    res.newParts = new Array();
                                    res.newParts.push(pt2);
                                    res.actKind = DecreeChangeKind.APPEND;
                                    tt = res.endToken = pt2.endToken;
                                    continue;
                                }
                                let pts1 = PartToken.tryAttachList(tt.next, false, 40);
                                if (pts1 !== null && pts1[0].addValue(1)) {
                                    res.parts = pts0;
                                    res.newParts = pts1;
                                    res.actKind = DecreeChangeKind.APPEND;
                                    tt = res.endToken = pt2.endToken;
                                    continue;
                                }
                            }
                            if (res.parts === null) {
                                res.parts = pts0;
                                res.inPart = _inPart;
                            }
                            tt = res.endToken = pts0[pts0.length - 1].endToken;
                            continue;
                        }
                    }{
                            pt0 = DecreeChangeToken._tryParsePart(tt, true);
                            if ((pt0 !== null && pt0.typ !== PartTokenItemType.PREFIX && res.newParts === null) && pt0.morph._case.isInstrumental) {
                                res.newParts = new Array();
                                res.newParts.push(pt0);
                                tt = res.endToken = pt0.endToken;
                                continue;
                            }
                        }
                    if (tt.isValue("ТЕКСТ", null) && tt.previous !== null && tt.previous.isValue("В", "У")) 
                        continue;
                    if (tt.isValue2("ПО", "ТЕКСТУ")) {
                        tt = tt.next;
                        continue;
                    }
                    if (tt.isValue("ИЗМЕНЕНИЕ", "ЗМІНА")) {
                        res.endToken = tt;
                        continue;
                    }
                    if (tt.isValue("ВМЕСТО", null)) {
                        res.endToken = tt;
                        continue;
                    }
                    if (tt.isValue("УКАЗАННЫЙ", null) || tt.isValue("ВЫШЕУКАЗАННЫЙ", null)) {
                        let npt = NounPhraseHelper.tryParse(tt, NounPhraseParseAttr.NO, 0, null);
                        if (npt !== null) {
                            res.endToken = (tt = npt.endToken);
                            continue;
                        }
                    }
                    if (tt.isChar(':') && tt.next !== null && tt.next.next !== null) {
                        if ((tt.next instanceof NumberToken) || (tt.next.lengthChar === 1)) {
                            if (tt.next.next.isCharOf(".)")) 
                                break;
                        }
                    }
                }
                if (tt !== t && (res.parts !== null) && res.decree === null) {
                    let dts = DecreeToken.tryAttachList(tt, null, 10, false);
                    if (dts !== null && dts.length > 0 && dts[0].typ === DecreeTokenItemType.TYP) {
                        tt = res.endToken = dts[dts.length - 1].endToken;
                        if (main !== null && res.decree === null && res.decreeTok === null) {
                            let dec = null;
                            for (const v of main.owners) {
                                if (v instanceof DecreeReferent) {
                                    dec = Utils.as(v, DecreeReferent);
                                    break;
                                }
                                else if (v instanceof DecreePartReferent) {
                                    dec = v.owner;
                                    if (dec !== null) 
                                        break;
                                }
                            }
                            if (dec !== null && dec.typ0 === dts[0].value) {
                                res.decree = dec;
                                res.decreeTok = dts[0];
                            }
                        }
                        if (!tt.isNewlineAfter) {
                            li = DecreeChangeToken._tryParsePartList(tt.next);
                            if (li !== null && !li[0].morph._case.isInstrumental) {
                                if (res.parts === null) 
                                    res.parts = li;
                                else 
                                    res.parts.splice(res.parts.length, 0, ...li);
                                PartToken.sort(res.parts);
                                tt = res.endToken = li[li.length - 1].endToken;
                            }
                        }
                        continue;
                    }
                }
                if (tt === res.beginToken && main !== null) {
                    let npt = NounPhraseHelper.tryParse(tt, NounPhraseParseAttr.NO, 0, null);
                    if (npt !== null) {
                        let tt1 = npt.endToken.next;
                        if ((tt1 !== null && ((tt1.isValue("ИЗЛОЖИТЬ", "ВИКЛАСТИ") || tt1.isValue("ПРИНЯТЬ", null))) && tt1.next !== null) && tt1.next.isValue("В", null)) {
                            let pt = PartToken._new1058(tt, npt.endToken, PartTokenItemType.APPENDIX);
                            pt.name = npt;
                            res.parts = new Array();
                            res.parts.push(pt);
                            res.endToken = pt.endToken;
                            break;
                        }
                    }
                }
                let ttt = DecreeToken.isKeyword(tt, false);
                if (ttt !== null && res.parts === null) {
                    let ttt0 = ttt;
                    for (; ttt !== null; ttt = ttt.next) {
                        if (MiscHelper.canBeStartOfSentence(ttt)) 
                            break;
                        if (ttt.isChar('(') && ttt.next !== null && ttt.next.isValue("ПРИЛОЖЕНИЕ", "ДОДАТОК")) {
                            if (ttt.isNewlineBefore) 
                                break;
                            let br = BracketHelper.tryParse(ttt, BracketParseAttr.NO, 100);
                            if (br === null) 
                                break;
                            let pt = DecreeChangeToken._tryParsePart(ttt.next, true);
                            if (pt !== null) {
                                res.parts = new Array();
                                res.parts.push(pt);
                                tt = res.endToken = br.endToken;
                                break;
                            }
                        }
                        if (ttt.isValue3("В", "СЛЕДУЮЩЕЙ", "РЕДАКЦИИ") || ttt.isValue3("В", "РЕДАКЦИИ", "ПРИЛОЖЕНИЕ")) {
                            let pt = new PartToken(tt, ttt.previous);
                            pt.typ = PartTokenItemType.CHAPTER;
                            pt.name = new MetaToken(tt, ttt.previous);
                            res.parts = new Array();
                            res.parts.push(pt);
                            tt = res.endToken = ttt.previous;
                            break;
                        }
                    }
                    if (res.parts !== null) 
                        continue;
                    if (res.actKind === DecreeChangeKind.APPEND) {
                        tt = res.endToken = ttt0;
                        continue;
                    }
                    tt = ttt0;
                    if (tt.isValue("НОРМА", null)) {
                        let npt = NounPhraseHelper.tryParse(tt.next, NounPhraseParseAttr.NO, 0, null);
                        if (npt !== null && npt.morph._case.isGenitive) {
                            res.endToken = (tt = npt.endToken);
                            continue;
                        }
                    }
                    continue;
                }
                if (specRegime) {
                    res.endToken = tt;
                    continue;
                }
                if (tt.isCharOf(".-") && !tt.isNewlineAfter) {
                    res.endToken = tt;
                    continue;
                }
                if (tt.isComma && res.decree !== null) 
                    continue;
                if (tt.isValue("ИЗЛОЖИТЬ", null) || tt.isValue("ПРИНЯТЬ", null)) {
                    if (res.parts === null) {
                        res.actKind = DecreeChangeKind.NEW;
                        if (tt.next !== null && tt.next.getMorphClassInDictionary().isPronoun) {
                            tt = tt.next;
                            res.hasAnafor = true;
                        }
                        res.endToken = tt;
                        continue;
                    }
                }
                if (tt.next !== null) {
                    let tt2 = tt.next;
                    if (tt.isValue("СОГЛАСНО", null)) 
                        tt2 = tt;
                    if (tt2 !== null && tt2.isValue2("В", "РЕДАКЦИИ")) 
                        tt2 = tt2.next.next;
                    if (tt2 !== null && tt2.isValue3("В", "НОВОЙ", "РЕДАКЦИИ")) 
                        tt2 = tt2.next.next.next;
                    if (tt2 !== null && ((tt2.isValue2("СОГЛАСНО", "ПРИЛОЖЕНИЮ") || ((tt2.isValue("ПРИЛОЖЕНИЯ", null) && ((res.actKind === DecreeChangeKind.NEW || tt.isValue("ИЗЛОЖИТЬ", null)))))))) {
                        let ppp = DecreeChangeToken._tryParsePart(tt2.next, true);
                        if (ppp === null) 
                            ppp = DecreeChangeToken._tryParsePart(tt2, true);
                        if (ppp !== null && ppp.typ === PartTokenItemType.APPENDIX) {
                            res.appExtChanges = ppp;
                            if (res.actKind === DecreeChangeKind.UNDEFINED) 
                                res.actKind = DecreeChangeKind.NEW;
                            res.endToken = (tt = ppp.endToken);
                            if (tt.next !== null && tt.next.isValue("К", null)) {
                                let npt = NounPhraseHelper.tryParse(tt.next.next, NounPhraseParseAttr.NO, 0, null);
                                if (npt !== null) 
                                    res.endToken = (tt = npt.endToken);
                            }
                            else if (tt.isValue("К", null)) {
                                let npt = NounPhraseHelper.tryParse(tt.next, NounPhraseParseAttr.NO, 0, null);
                                if (npt !== null) 
                                    res.endToken = (tt = npt.endToken);
                            }
                            continue;
                        }
                    }
                }
                if (izlogit !== null && izlogit.endChar > tt.endChar) {
                    res.endToken = (tt = izlogit);
                    izlogit = null;
                    continue;
                }
                if (tt.isCommaAnd && res.parts !== null) {
                    li = DecreeChangeToken._tryParsePartList(tt.next);
                    if (li !== null && li.length > 0 && li[0].typ !== PartTokenItemType.PREFIX) {
                        let tt2 = li[li.length - 1].endToken.next;
                        if (tt2 !== null && (tt2.getReferent() instanceof DecreeReferent) && res.decree !== null) {
                        }
                        else {
                            res.parts[res.parts.length - 1].delimAfter = true;
                            res.parts.splice(res.parts.length, 0, ...li);
                            res.endToken = (tt = li[li.length - 1].endToken);
                            continue;
                        }
                    }
                }
                if (tt.isCommaAnd) 
                    continue;
                if (tt.previous !== null && tt.previous.isValue("К", null) && res.parts !== null) {
                    let tt2 = DecreeToken.isKeyword(tt, false);
                    if (tt2 !== null && tt2.next !== null) {
                        li = DecreeChangeToken._tryParsePartList(tt2.next);
                        if (li !== null) {
                            res.parts.splice(res.parts.length, 0, ...li);
                            tt = res.endToken = li[li.length - 1].endToken;
                            continue;
                        }
                    }
                }
                if (tt.isChar('<')) {
                }
                let npt1 = NounPhraseHelper.tryParse(tt, NounPhraseParseAttr.PARSEPREPOSITION, 0, null);
                if (npt1 !== null) {
                    if ((npt1.endToken.isValue("ПРИОРИТЕТ", null) || npt1.endToken.isValue("СФЕРА", null) || npt1.endToken.isValue("РЕАЛИЗАЦИЯ", null)) || npt1.endToken.isValue("СПИСОК", null) || npt1.endToken.isValue("ВОПРОС", null)) {
                        res.endToken = (tt = npt1.endToken);
                        if (tt.next !== null && (tt.next.getReferent() instanceof DecreeReferent)) 
                            res.endToken = (tt = tt.next);
                        if (BracketHelper.canBeEndOfSequence(tt.next, false, null, false)) 
                            res.endToken = (tt = tt.next);
                        continue;
                    }
                }
                if (tt.isTableControlChar) 
                    continue;
                break;
            }
            if (res.decree !== null && aboutChanges && res.isNewlineAfter) {
                let tt2 = res.endToken.next;
                if (tt2 !== null && tt2.isValue3("В", "СООТВЕТСТВИИ", "С")) {
                    for (tt2 = tt2.next.next.next; tt2 !== null; tt2 = tt2.next) {
                        if (tt2.isCommaAnd) 
                            continue;
                        if (tt2.getReferent() instanceof DecreeReferent) 
                            continue;
                        let li = DecreeChangeToken._tryParsePartList(tt2);
                        if (li !== null && li.length > 0) {
                            tt2 = li[li.length - 1].endToken;
                            continue;
                        }
                        if (tt2.isValue("ПРИКАЗЫВАЮ", null)) {
                            res.endToken = tt2;
                            res.hasChangeKeyword = true;
                            return res;
                        }
                    }
                }
            }
            if (((res.ignorable || res.parts !== null || res.decree !== null) || res.realPart !== null || res.actKind !== DecreeChangeKind.UNDEFINED) || res.changeVal !== null) {
                if (res.endToken.next !== null && res.endToken.next.isChar(':')) {
                    let nl = res.endToken.next.isNewlineAfter;
                    if (!nl) {
                        let pl = DecreeChangeToken._tryParsePart(res.endToken.next.next, false);
                        if (pl !== null) 
                            nl = true;
                    }
                    if (nl) {
                        res.typ = DecreeChangeTokenTyp.SINGLE;
                        res.endToken = res.endToken.next;
                    }
                }
                return res;
            }
            if (res.beginToken === tt) {
                let tok1 = DecreeChangeToken.M_TERMS.tryParse(tt, TerminParseAttr.NO);
                if (tok1 !== null) {
                }
                else if (tt.isValue("ПОСЛЕ", null)) {
                }
                else 
                    return null;
            }
            else 
                return null;
        }
        for (; tt !== null; tt = tt.next) {
            if (tt.isValue("В", null) && tt.next !== null && tt.next.getMorphClassInDictionary().isPronoun) 
                tt = tt.next;
            else if (tt.isValue("СЛЕДУЮЩИЙ", null)) {
            }
            else 
                break;
        }
        if (tt === null) 
            return null;
        let tok = DecreeChangeToken.M_TERMS.tryParse(tt, TerminParseAttr.NO);
        if (tt.morph._class.isAdjective && (((tt instanceof NumberToken) || tt.isValue("ПОСЛЕДНИЙ", "ОСТАННІЙ") || tt.isValue("ПРЕДПОСЛЕДНИЙ", "ПЕРЕДОСТАННІЙ")))) {
            let tt2 = tt.next;
            for (; tt2 !== null; tt2 = tt2.next) {
                if ((tt2 instanceof NumberToken) || tt2.isCommaAnd) {
                }
                else 
                    break;
            }
            tok = DecreeChangeToken.M_TERMS.tryParse(tt2, TerminParseAttr.NO);
            if (tok !== null && (tok.termin.tag instanceof DecreeChangeValueKind)) {
            }
            else 
                tok = null;
        }
        let afterValue = false;
        if (tok === null && tt.isValue("ПОСЛЕ", null) && BracketHelper.canBeStartOfSequence(tt.next, true, false)) {
            tok = new TerminToken(tt, tt);
            tok.termin = Termin._new96("СЛОВО", DecreeChangeValueKind.WORDS);
            afterValue = true;
        }
        if (tok === null && tt.isValue2("ПОСЛЕ", "АБЗАЦА") && BracketHelper.canBeStartOfSequence(tt.next.next, true, false)) {
            tok = new TerminToken(tt, tt.next);
            tok.termin = Termin._new96("СЛОВО", DecreeChangeValueKind.WORDS);
            afterValue = true;
        }
        if (tok === null && tt.isValue("ПРЕДЛОЖЕНИЕ", null) && BracketHelper.canBeStartOfSequence(tt.next, true, false)) 
            tok = TerminToken._new568(tt, tt, DecreeChangeToken.m_Words);
        if (tok === null && BracketHelper.canBeStartOfSequence(tt, true, false) && tt.previous !== null) {
            if ((tt.previous.isValue("ПРЕДЛОЖЕНИЕ", null) || (tt.previous.getReferent() instanceof DecreePartReferent) || tt.isNewlineBefore) || tt.previous.isCharOf(".)")) 
                tok = TerminToken._new568(tt.previous, tt.previous, DecreeChangeToken.m_Words);
        }
        if ((tok === null && tt.isValue("ПРЕДЛОЖЕНИЕ", null) && tt.next !== null) && tt.next.isChar(':') && BracketHelper.canBeStartOfSequence(tt.next.next, true, false)) 
            tok = TerminToken._new568(tt, tt.next, DecreeChangeToken.m_Words);
        if (tok === null && tt.isValue3("РАЗДЕЛ", "СЛЕДУЮЩЕГО", "СОДЕРЖАНИЯ")) 
            tok = TerminToken._new568(tt, tt.next.next, DecreeChangeToken.m_Words);
        if (tok === null && BracketHelper.canBeStartOfSequence(tt, true, false) && tt.previous !== null) {
            if (tt.previous.isValue("ДОПОЛНИТЬ", null) || tt.previous.isValue("ЗАМЕНИТЬ", null) || tt.previous.isValue("ИСКЮЧИТЬ", null)) 
                tok = TerminToken._new568(tt.previous, tt.previous, DecreeChangeToken.m_Words);
        }
        if (tok !== null) {
            if (tok.termin.tag instanceof DecreeChangeKind) {
                res = DecreeChangeToken._new1076(tt, tok.endToken, DecreeChangeTokenTyp.ACTION, DecreeChangeKind.of(tok.termin.tag));
                if (((res.actKind === DecreeChangeKind.APPEND || res.actKind === DecreeChangeKind.CONSIDER)) && tok.endToken.next !== null && tok.endToken.next.morph._case.isInstrumental) {
                    let tt4 = tok.endToken.next;
                    while (tt4 !== null && ((tt4.isValue("СЛЕДУЮЩИЙ", null) || tt4.isValue("НОВЫЙ", null)))) {
                        tt4 = tt4.next;
                    }
                    let pt = DecreeChangeToken._tryParsePart(tt4, true);
                    if (pt !== null && pt.typ !== PartTokenItemType.PREFIX) {
                        if (res.actKind === DecreeChangeKind.APPEND) {
                            res.partTyp = pt.typ;
                            if (res.newParts === null) 
                                res.newParts = new Array();
                            res.newParts.push(pt);
                        }
                        else if (res.actKind === DecreeChangeKind.CONSIDER) {
                            res.changeVal = new DecreeChangeValueReferent();
                            res.changeVal.value = pt.getSourceText();
                            let pt2 = DecreeChangeToken._tryParsePart(pt.endToken.next, false);
                            if (pt2 !== null && pt2.morph._case.isGenitive) {
                                res.changeVal.value = (pt.getSourceText() + " " + pt2.getSourceText());
                                pt = pt2;
                            }
                        }
                        tt = res.endToken = pt.endToken;
                        if (tt.next !== null && tt.next.isAnd && res.actKind === DecreeChangeKind.APPEND) {
                            pt = DecreeChangeToken._tryParsePart(tt.next.next, true);
                            if (pt !== null) {
                                res.newParts.push(pt);
                                tt = res.endToken = pt.endToken;
                            }
                        }
                    }
                }
                if (res.actKind === DecreeChangeKind.CONSIDER && (tok.endToken.next instanceof NumberToken) && (tok.whitespacesAfterCount < 3)) {
                    for (let tt3 = res.endToken.next; tt3 !== null; tt3 = tt3.next) {
                        if (tt3 instanceof NumberToken) {
                            res.endToken = tt3;
                            continue;
                        }
                        if (tt3.isCommaAnd) 
                            continue;
                        let pp = DecreeChangeToken._tryParsePart(tt3, true);
                        if (pp !== null && pp.endToken === tt3) {
                            res.endToken = tt3;
                            continue;
                        }
                        break;
                    }
                    res.changeVal = new DecreeChangeValueReferent();
                    res.changeVal.value = MiscHelper.getTextValue(tok.endToken.next, res.endToken, GetTextAttr.KEEPREGISTER);
                }
                if (res.endToken.next !== null && res.endToken.next.isValue("СООТВЕТСТВЕННО", null)) 
                    res.endToken = res.endToken.next;
                if (res.actKind === DecreeChangeKind.REMOVE && (res.whitespacesAfterCount < 3)) {
                    let pp = PartToken.tryAttach(res.endToken.next, null, true, false);
                    if (pp !== null && pp.typ === PartTokenItemType.SENTENCE) {
                        res.parts = new Array();
                        res.parts.push(pp);
                        res.endToken = pp.endToken;
                    }
                }
                return res;
            }
            if (tok.termin.tag instanceof DecreeChangeValueKind) {
                res = DecreeChangeToken._new1048(tt, (tok.endChar > tt.beginChar ? tok.endToken : tt), DecreeChangeTokenTyp.VALUE);
                res.changeVal = new DecreeChangeValueReferent();
                res.changeVal.kind = DecreeChangeValueKind.of(tok.termin.tag);
                if (tt.previous !== null && tt.previous.isValue("В", null)) 
                    res.changeVal.isContent = true;
                if (afterValue) 
                    res.typ = DecreeChangeTokenTyp.AFTERVALUE;
                if (res.changeVal.kind === DecreeChangeValueKind.WORDS && ((typeof tok.termin.tag2 === 'string' || tok.termin.tag2 instanceof String))) {
                    res.changeVal.value = Utils.asString(tok.termin.tag2);
                    res.changeVal.beginChar = tok.beginChar;
                    res.changeVal.endChar = tok.endChar;
                    return res;
                }
                tt = tok.endToken.next;
                if (tt === null) 
                    return null;
                if (tt !== null && ((tt.isValue("ИЗЛОЖИТЬ", "ВИКЛАСТИ") || tt.isValue("ПРИНЯТЬ", null))) && res.actKind === DecreeChangeKind.UNDEFINED) {
                    res.actKind = DecreeChangeKind.NEW;
                    tt = tt.next;
                    if (tt !== null && tt.isValue("В", null)) 
                        tt = tt.next;
                }
                if ((tt !== null && ((tt.isValue("СЛЕДУЮЩИЙ", "НАСТУПНИЙ") || tt.isValue("ТАКОЙ", "ТАКИЙ"))) && tt.next !== null) && ((tt.next.isValue("СОДЕРЖАНИЕ", "ЗМІСТ") || tt.next.isValue("СОДЕРЖИМОЕ", "ВМІСТ") || tt.next.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ")))) 
                    tt = tt.next.next;
                else if (tt !== null && tt.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ")) 
                    tt = tt.next;
                if (tt !== null && tt.isChar(':')) 
                    tt = tt.next;
                if (tt !== null) 
                    res.changeVal.beginChar = tt.beginChar;
                if (res.beginToken.isValue("СЛОВО", null) && (tt instanceof TextToken) && tt.lengthChar > 1) {
                    let _next = DecreeChangeToken.tryAttach(tt.next, null, true, null, false, false, null, false);
                    if (_next !== null) {
                        if (_next.actKind === DecreeChangeKind.REMOVE || _next.actKind === DecreeChangeKind.EXCHANGE || _next.actKind === DecreeChangeKind.APPEND) {
                            res.changeVal.value = tt.getSourceText();
                            res.endToken = tt;
                            res.changeVal.beginChar = tt.beginChar;
                            res.changeVal.endChar = tt.endChar;
                            return res;
                        }
                    }
                }
                if (tt.isChar('<') && (tt.next instanceof TextToken)) {
                    if (tt.next.chars.isLatinLetter || tt.next.isChar('/')) 
                        return null;
                }
                if (tt.isChar('«') && tt.next !== null && tt.next.isChar('»')) {
                    res.changeVal.value = "";
                    res.endToken = tt.next;
                    res.changeVal.beginChar = tt.endChar + 1;
                    res.changeVal.endChar = tt.next.beginChar - 1;
                    return res;
                }
                let canBeStart = false;
                if (BracketHelper.canBeStartOfSequence(tt, true, true)) 
                    canBeStart = true;
                else if (BracketHelper.isBracket(tt, true) && !tt.isWhitespaceAfter) 
                    canBeStart = true;
                else if ((tt instanceof MetaToken) && BracketHelper.canBeStartOfSequence(tt.beginToken, true, false)) 
                    canBeStart = true;
                else if (tt !== null && tt.isNewlineBefore && tt.isValue("ПРИЛОЖЕНИЕ", "ДОДАТОК")) {
                    if ((tt.previous !== null && tt.previous.isChar(':') && tt.previous.previous !== null) && tt.previous.previous.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ")) 
                        canBeStart = true;
                }
                else if (t.previous !== null && ((t.previous.isValue("ДОПОЛНИТЬ", null) || t.previous.isValue("ЗАМЕНИТЬ", null) || t.previous.isValue("ПОСЛЕ", null)))) 
                    canBeStart = true;
                else if (tt.isChar(String.fromCharCode(0x1E))) 
                    canBeStart = true;
                else if (tt.next !== null) {
                    let cou = 0;
                    for (let tt2 = tt.next; tt2 !== null && (cou < 10); tt2 = tt2.next,cou++) {
                        if (tt2.isChar('»')) {
                            res.changeVal.value = new MetaToken(tt, tt2.previous).getSourceText();
                            res.endToken = tt2;
                            res.changeVal.endChar = tt2.beginChar - 1;
                            return res;
                        }
                        else if ((tt2.isValue("ИСКЛЮЧИТЬ", null) || tt2.isValue("ДОПОЛНИТЬ", null) || tt2.isValue("ЗАМЕНИТЬ", null)) || tt2.isValue("УДАЛИТЬ", null)) 
                            canBeStart = true;
                    }
                }
                if (canBeStart) {
                    let ttt = tt;
                    if (BracketHelper.isBracket(tt, true)) {
                        ttt = tt.next;
                        res.changeVal.beginChar = ttt.beginChar;
                        if (tt.isChar('<') && ttt.isChar('<') && ttt.next !== null) {
                            ttt = ttt.next;
                            res.changeVal.beginChar = ttt.endChar + 1;
                        }
                    }
                    else if ((tt.isTableControlChar && tt.next !== null && BracketHelper.isBracket(tt.next, true)) && tt.next.next !== null) {
                        ttt = tt.next.next;
                        res.changeVal.beginChar = ttt.beginChar;
                    }
                    else {
                        let img = MiscHelper.checkImage(tt);
                        if (img !== null && BracketHelper.canBeStartOfSequence(img.next, true, false) && img.next.next !== null) {
                            ttt = img.next.next;
                            res.changeVal.beginChar = ttt.beginChar;
                        }
                    }
                    let ttt00 = ttt;
                    for (; ttt !== null; ttt = ttt.next) {
                        let stop = false;
                        if (ttt.isCharOf(".;") && !BracketHelper.isBracket(ttt.next, true)) {
                            stop = ttt.isNewlineAfter;
                            if ((!stop && ttt.next !== null && ttt.next.isTableControlChar) && ttt.next.isNewlineAfter) 
                                stop = true;
                            if (!stop && BracketHelper.isBracket(ttt.previous, false)) {
                                let num = ComplexNumToken.tryParse(ttt.next, null, false, false);
                                if (num !== null) 
                                    stop = true;
                            }
                            if (stop) 
                                ttt = ttt.previous;
                        }
                        else if (ttt.isComma && ttt.isNewlineAfter) {
                            if (DecreeChangeToken._canBeChangeToken(ttt.next, 0, true, true)) 
                                stop = true;
                        }
                        if (ttt.tag instanceof NumberToken) {
                            if (ttt.tag.beginChar < res.beginChar) 
                                stop = true;
                        }
                        if (ttt.isChar(String.fromCharCode(0x1E)) && !stop) {
                            let rows = TableHelper.tryParseRows(ttt, 0, true, false);
                            if (rows !== null) {
                                for (let tt3 = ttt.next; tt3 !== null && tt3.endChar <= rows[rows.length - 1].endChar; tt3 = tt3.next) {
                                    if (tt3.tag instanceof NumberToken) {
                                        if (tt3.tag.beginChar < res.beginChar) {
                                            stop = true;
                                            ttt = tt3.previous;
                                            if (ttt.isTableControlChar && ttt.previous !== null) 
                                                ttt = ttt.previous;
                                            break;
                                        }
                                    }
                                }
                                if (!stop) {
                                    for (let jj = rows.length - 1; jj > 0; jj--) {
                                        if (DecreeChangeToken._canBeChangeToken(rows[jj].beginToken, 0, false, false)) {
                                            rows.splice(jj, rows.length - jj);
                                            stop = true;
                                            break;
                                        }
                                    }
                                    ttt = rows[rows.length - 1].endToken;
                                    if (ttt.isNewlineAfter || stop) 
                                        stop = true;
                                    else 
                                        continue;
                                }
                            }
                        }
                        if (ttt.next !== null) {
                            if (ttt.next.isValue2("ДОПОЛНИТЬ", "СЛОВАМИ")) 
                                stop = true;
                            else if (ttt.next.isValue("УДАЛИТЬ", null) || ttt.next.isValue("ИСКЛЮЧИТЬ", null)) {
                                if (ttt.next.next === null || tt.next.isNewlineAfter) 
                                    stop = true;
                                else if (ttt.next.next.isCharOf(";")) 
                                    stop = true;
                                else if (ttt.next.next.isCharOf(".,") && tt.next.next.isNewlineAfter) 
                                    stop = true;
                            }
                        }
                        let img = MiscHelper.checkImage(ttt);
                        if (img !== null) 
                            ttt = img;
                        if (!stop && ((ttt.isNewlineBefore || ttt.previous.isChar(String.fromCharCode(0x1F))))) {
                            if (DecreeChangeToken._canBeChangeToken(ttt, 0, true, true)) {
                                ttt = ttt.previous;
                                stop = true;
                            }
                        }
                        if (!stop) {
                            let li = DecreeChangeToken._tryParsePartList(ttt);
                            if (li !== null) {
                                let ttt11 = li[li.length - 1].endToken;
                                if (DecreeChangeToken._checkEndBracket(ttt11)) {
                                    if (ttt11.previous.beginChar > ttt.beginChar) 
                                        ttt = ttt11.previous;
                                }
                                else 
                                    ttt = ttt11;
                                continue;
                            }
                        }
                        if (ttt.isNewlineAfter) {
                            img = MiscHelper.checkImage(ttt.next);
                            if (img !== null) {
                                if (img.isNewlineAfter || BracketHelper.isBracket(img.next, true)) {
                                    ttt = img;
                                    continue;
                                }
                            }
                            if (DecreeChangeToken._canBeChangeToken(ttt.next, 0, true, true)) 
                                stop = true;
                        }
                        if (DecreeChangeToken._checkEndBracket(ttt) || ttt.isChar(']')) {
                            if (DecreeChangeToken._canBeChangeToken(ttt.next, 0, false, false)) 
                                stop = true;
                        }
                        else if (!stop) 
                            continue;
                        if (ttt.next === null || stop) {
                        }
                        else if (ttt.isNewlineAfter) {
                            if (ttt.next.isCommaAnd && ttt.next.next !== null) {
                                if (BracketHelper.canBeStartOfSequence(ttt.next.next, true, false) || (ttt.next.next.getReferent() instanceof DecreeReferent)) 
                                    continue;
                            }
                            let li = InstrToken1.parse(ttt.next, true, null, 0, null, false, 0, false, false);
                            if (li !== null && li.endToken.isCharOf(";.,") && BracketHelper.canBeEndOfSequence(li.endToken.previous, true, null, false)) 
                                continue;
                            if (li !== null && BracketHelper.canBeEndOfSequence(li.endToken, true, null, false)) 
                                continue;
                        }
                        else if (ttt.next.isValue("СООТВЕТСТВЕННО", null) || ttt.next.isValue2("В", "СООТВЕТСТВУЮЩИЙ")) {
                        }
                        else if (ttt.next.isCharOf(".;") && ((ttt.next.isNewlineAfter || DecreeChangeToken.tryAttach(ttt.next.next, main, false, changeStack, true, false, null, false) !== null || DecreeChangeToken._tryParsePart(ttt.next.next, false) !== null))) {
                        }
                        else if (ttt.next.isCommaAnd && DecreeChangeToken.tryAttach(ttt.next.next, main, false, changeStack, true, false, null, false) !== null) {
                        }
                        else if (ttt.next.isComma && ttt.next.next !== null && ttt.next.next.isValue("А", null)) {
                            let conj = ConjunctionHelper.tryParse(ttt.next.next);
                            if (conj !== null && DecreeChangeToken.tryAttach(conj.endToken.next, main, false, changeStack, true, false, null, false) !== null) {
                            }
                            else 
                                continue;
                        }
                        else if (DecreeChangeToken.tryAttach(ttt.next, main, false, changeStack, true, false, null, false) !== null || DecreeChangeToken.M_TERMS.tryParse(ttt.next, TerminParseAttr.NO) !== null) {
                        }
                        else if ((ttt.next.isValue("ДОБАВИТЬ", null) || ttt.next.isValue("ДОПОЛНИТЬ", null) || ttt.next.isValue("ЗАМЕНИТЬ", null)) || ttt.next.isValue("УДАЛИТЬ", null)) {
                        }
                        else 
                            continue;
                        let ttt1 = ttt;
                        if (BracketHelper.isBracket(ttt, true) && !ttt.isCharOf("]>")) {
                            if (DecreeChangeToken._findPrevBracket(ttt, tt.next) === null) 
                                ttt1 = ttt.previous;
                        }
                        else if (ttt.isCharOf(";.") && BracketHelper.isBracket(ttt.previous, true) && !ttt.previous.isCharOf("]>")) {
                            if (DecreeChangeToken._findPrevBracket(ttt.previous, tt.next) === null) 
                                ttt1 = ttt.previous.previous;
                        }
                        let ttt0 = ttt00;
                        if (ttt0.beginChar > ttt1.beginChar) {
                        }
                        if (BracketHelper.isBracket(tt, true) && tt.next.beginChar <= ttt1.beginChar) {
                            ttt0 = tt.next;
                            if (ttt0 !== null && tt.isChar('<')) {
                                if (ttt0.isChar('<')) 
                                    ttt0 = ttt0.next;
                                else if (!tt.isWhitespaceAfter && (ttt0 instanceof TextToken) && ttt0.chars.isLatinLetter) 
                                    continue;
                            }
                        }
                        else if ((tt.isTableControlChar && tt.next !== null && BracketHelper.isBracket(tt.next, true)) && tt.next.next !== null) 
                            ttt0 = tt.next.next;
                        if ((ttt1.isChar('>') && ttt1.previous !== null && ttt1.previous.isChar('>')) && ttt1.previous.previous !== null && ttt1.previous.previous.beginChar >= ttt0.beginChar) 
                            ttt1 = ttt1.previous.previous;
                        if (ttt0.beginChar > ttt1.beginChar) 
                            return null;
                        let val = new MetaToken(ttt0, ttt1).getSourceText();
                        res.endToken = ttt;
                        res.changeVal.endChar = ttt1.endChar;
                        if ((ttt === tt && (ttt instanceof MetaToken) && BracketHelper.isBracket(ttt.beginToken, true)) && BracketHelper.isBracket(ttt.endToken, true)) {
                            val = val.substring(1, 1 + val.length - 2);
                            res.changeVal.endChar = res.changeVal.endChar - 1;
                        }
                        else if ((tt instanceof MetaToken) && BracketHelper.isBracket(tt.beginToken, true)) 
                            val = val.substring(1, 1 + val.length - 1);
                        res.changeVal.value = val;
                        if (BracketHelper.isBracket(res.endToken.next, true)) {
                            if (res.endToken.next.isNewlineAfter || res.endToken.next.next.isCharOf(";.")) 
                                res.endToken = res.endToken.next;
                        }
                        if (res.endToken.next !== null) {
                            if (res.endToken.next.isValue("СООТВЕТСТВЕННО", null)) 
                                res.endToken = res.endToken.next;
                        }
                        if (BracketHelper.canBeStartOfSequence(tt, true, false) && BracketHelper.canBeEndOfSequence(ttt, true, null, false)) {
                            let vals = null;
                            let bes = null;
                            let pp = null;
                            let pp0 = tt.next;
                            for (pp = tt.next; pp !== null && pp.endChar <= ttt.endChar; pp = pp.next) {
                                let li = DecreeChangeToken._tryParsePartList(pp);
                                if (li !== null) {
                                    pp = li[li.length - 1].endToken;
                                    continue;
                                }
                                if (((BracketHelper.canBeEndOfSequence(pp, false, null, false) && pp.next !== null && pp.next.isCommaAnd) && !pp.isChar('>') && BracketHelper.canBeStartOfSequence(pp.next.next, true, false)) && (pp.next.next.endChar < ttt.beginChar) && !pp.next.next.isChar('<')) {
                                    if (vals === null) 
                                        vals = new Array();
                                    if (bes === null) 
                                        bes = new Hashtable();
                                    vals.push(new MetaToken(pp0, pp.previous).getSourceText());
                                    bes.put(pp0.beginChar, pp.previous.endChar);
                                    pp = pp.next.next;
                                    pp0 = pp.next;
                                }
                            }
                            if (vals !== null) {
                                if (pp0 !== null && (pp0.endChar < ttt.beginChar)) {
                                    vals.push(new MetaToken(pp0, ttt.previous).getSourceText());
                                    bes.put(pp0.beginChar, ttt.previous.endChar);
                                }
                                let ki = res.changeVal.kind;
                                res.changeVal = new DecreeChangeValueReferent();
                                res.changeVal.kind = ki;
                                let i = 0;
                                for (const kp of bes.entries) {
                                    res.changeVal.addSlot(DecreeChangeReferent.ATTR_VALUE, vals[i], false, 0);
                                    i++;
                                    res.changeVal.addSlot("BEGIN", kp.key.toString(), false, 0);
                                    res.changeVal.addSlot("END", kp.value.toString(), false, 0);
                                }
                            }
                        }
                        break;
                    }
                    if (canBeStart) {
                        if (res.changeVal.value === null) {
                            if (tt.kit.level <= 1 && !tt.isChar('<')) {
                                tt.kit.level++;
                                let txt = DecreeChangeToken._tryParseText(tt, abzacRegime, false, null);
                                tt.kit.level--;
                                if (txt !== null) {
                                    txt.beginToken = res.beginToken;
                                    txt.changeVal.isContent = res.changeVal.isContent;
                                    res = txt;
                                }
                            }
                        }
                        else if (res.isNewlineAfter || ((res.endToken.next !== null && res.endToken.next.isCharOf(";,.") && res.endToken.next.isNewlineAfter))) {
                            let crlf = 0;
                            for (let t3 = tt; t3 !== null && (t3.endChar < res.endChar); t3 = t3.next) {
                                if (t3.isNewlineAfter) 
                                    crlf++;
                            }
                            if (res.lengthChar > 200 || crlf > 1) {
                                if (tt.kit.level <= 1 && !tt.isChar('<')) {
                                    tt.kit.level++;
                                    let txt = DecreeChangeToken._tryParseText(tt, abzacRegime, false, null);
                                    tt.kit.level--;
                                    if (txt !== null && ((res.changeVal.endChar + 3) < txt.endChar)) {
                                        txt.beginToken = res.beginToken;
                                        txt.changeVal.isContent = res.changeVal.isContent;
                                        res = txt;
                                    }
                                }
                            }
                        }
                    }
                    if (res.changeVal.value === null) 
                        return null;
                    if (res.changeVal.kind === DecreeChangeValueKind.WORDS) {
                        tok = DecreeChangeToken.M_TERMS.tryParse(res.endToken.next, TerminParseAttr.NO);
                        if (tok !== null && (tok.termin.tag instanceof DecreeChangeValueKind) && (DecreeChangeValueKind.of(tok.termin.tag)) === DecreeChangeValueKind.ROBUSTWORDS) {
                            res.changeVal.kind = DecreeChangeValueKind.ROBUSTWORDS;
                            res.endToken = tok.endToken;
                            if (res.endToken.next !== null) {
                                if (res.endToken.next.isValue2("И", "ЧИСЛЕ") || res.endToken.next.isValue2("И", "ПАДЕЖЕ")) 
                                    res.endToken = res.endToken.next.next;
                            }
                        }
                    }
                }
                if (res.changeVal.value === null) 
                    return null;
                return res;
            }
        }
        let isNexChange = 0;
        if (t !== null && t.isValue("В", "У") && t.next !== null) {
            t = t.next;
            if (t.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ") && t.next !== null) {
                isNexChange = 1;
                t = t.next;
            }
        }
        if (((t.isValue("СЛЕДУЮЩИЙ", "НАСТУПНИЙ") || tt.isValue("ТАКОЙ", "ТАКИЙ"))) && t.next !== null && ((t.next.isValue("СОДЕРЖАНИЕ", "ЗМІСТ") || t.next.isValue("СОДЕРЖИМОЕ", "ВМІСТ") || t.next.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ")))) {
            isNexChange = 2;
            t = t.next.next;
        }
        if (t === null) 
            return null;
        if (t.next !== null && ((t.isChar(':') || ((t.isChar('.') && BracketHelper.isBracket(t.next, true)))))) {
            if (t.previous !== null && t.previous.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ")) 
                isNexChange++;
            tt = (t = t.next);
            if (isNexChange > 0) 
                isNexChange++;
        }
        else if (t.previous !== null && t.previous.isValue("РЕДАКЦИЯ", null) && ((BracketHelper.canBeStartOfSequence(t, true, false) || t.isNewlineBefore))) 
            isNexChange++;
        if ((t === tt && t.previous !== null && t.previous.isChar(':')) && BracketHelper.isBracket(t, false) && !t.isChar('(')) 
            isNexChange = 1;
        let xx1 = t;
        while (xx1 !== null && xx1.isTableControlChar) {
            xx1 = xx1.next;
        }
        if (((isNexChange > 0 && (((MiscHelper.checkImage(xx1) !== null || BracketHelper.isBracket(xx1, true) || abzacRegime) || ComplexNumToken.tryParse(xx1, null, false, false) !== null)))) || ((isNexChange > 1 && t.isValue("ПРИЛОЖЕНИЕ", "ДОДАТОК")))) {
            if (isInEdition) {
                res = DecreeChangeToken._new1048(t, xx1, DecreeChangeTokenTyp.VALUE);
                res.changeVal = DecreeChangeValueReferent._new1049(DecreeChangeValueKind.TEXT);
                return res;
            }
            res = DecreeChangeToken._tryParseText(xx1, abzacRegime, false, defPart);
            if (res === null) 
                return null;
            res.beginToken = t;
            return res;
        }
        if (tt.isValue("ПОСЛЕ", "ПІСЛЯ")) {
            let pt = DecreeChangeToken._tryParsePartList(tt.next);
            if (pt !== null && pt.length > 0) {
                let tt2 = pt[pt.length - 1].endToken.next;
                while (tt2 !== null && ((tt2.isValue("НОВЫЙ", null) || tt2.isValue("ДОПОЛНИТЬ", null)))) {
                    tt2 = tt2.next;
                }
                let pt2 = DecreeChangeToken._tryParsePart(tt2, true);
                if (pt2 !== null && pt2.typ === pt[0].typ) {
                    if (pt2.values.length > 0) {
                        res = new DecreeChangeToken(tt, pt2.endToken);
                        res.parts = pt;
                        res.actKind = DecreeChangeKind.APPEND;
                        res.newParts = new Array();
                        res.newParts.push(pt2);
                        return res;
                    }
                    let pt1 = DecreeChangeToken._tryParsePartList(tt.next);
                    if (pt1[0].addValue(1)) {
                        res = new DecreeChangeToken(tt, pt2.endToken);
                        res.parts = pt;
                        res.actKind = DecreeChangeKind.APPEND;
                        res.newParts = new Array();
                        res.newParts.splice(res.newParts.length, 0, ...pt1);
                        return res;
                    }
                }
            }
            res = DecreeChangeToken.tryAttach(tt.next, null, false, null, false, false, null, false);
            if (res !== null && res.typ === DecreeChangeTokenTyp.VALUE) {
                res.typ = DecreeChangeTokenTyp.AFTERVALUE;
                res.beginToken = tt;
                return res;
            }
        }
        if (tt.isValue2("В", "КОНЦЕ")) {
            let pts = DecreeChangeToken._tryParsePartList(tt.next.next);
            if (pts !== null && pts.length > 0) {
                res = DecreeChangeToken.tryAttach(pts[pts.length - 1].endToken.next, null, false, null, false, false, null, false);
                if (res !== null && res.parts === null) {
                    res.beginToken = tt;
                    res.inTheEnd = true;
                    if (res.changeVal !== null) 
                        res.changeVal.addSlot("POSITION", "end", false, 0);
                    res.parts = pts;
                    return res;
                }
            }
        }
        return null;
    }
    
    static _canBeChangeToken(t, lev = 0, strict = false, inBrackets = false) {
        const DecreeToken = require("./DecreeToken");
        const PartToken = require("./PartToken");
        const InstrToken1 = require("./../../instrument/internal/InstrToken1");
        if (lev > 10) 
            return false;
        let t0 = t;
        for (; t !== null; t = t.next) {
            let tt = MiscHelper.checkImage(t);
            if (tt !== null) {
                t = tt;
                continue;
            }
            if (!t.isCharOf(";.,") && !t.isTableControlChar) {
                if (((t instanceof TextToken) && t.lengthChar === 1 && !t.chars.isLetter) && !BracketHelper.isBracket(t, false)) 
                    continue;
                break;
            }
        }
        if (t === null) 
            return false;
        if (DecreeChangeToken.M_TERMS.tryParse(t, TerminParseAttr.NO) !== null) {
            if ((t.isValue("СЧИТАТЬСЯ", null) || t.isValue("ПРИНЯТЬ", null) || t.isValue("ДАТА", null)) || t.isValue("КОД", null) || t.isValue("ЧИСЛО", null)) 
                return false;
            if (t.isValue("СЧИТАТЬ", null)) {
                if (PartToken.tryAttach(t.next, null, false, false) !== null) 
                    return true;
            }
            if (t.getMorphClassInDictionary().isAdjective) 
                return false;
            let tok = DecreeChangeToken.M_TERMS.tryParse(t, TerminParseAttr.NO);
            if (strict) {
                if (DecreeChangeToken.M_TERMS.tryParse(tok.endToken.next, TerminParseAttr.NO) !== null) 
                    return true;
                if (DecreeChangeToken._tryParsePart(tok.endToken.next, true) !== null) 
                    return true;
            }
            if (tok.termin.tag instanceof DecreeChangeValueKind) {
                let ki = DecreeChangeValueKind.of(tok.termin.tag);
                if (ki === DecreeChangeValueKind.DEFINITION || ((((ki === DecreeChangeValueKind.WORDS || ki === DecreeChangeValueKind.NUMBERS)) && tok.termin.tag2 === null))) {
                    if (BracketHelper.isBracket(tok.endToken.next, true)) 
                        return true;
                    if (tok.endToken.next instanceof MetaToken) {
                        if (BracketHelper.isBracket(tok.endToken.next.beginToken, true)) 
                            return true;
                    }
                    return false;
                }
            }
            if (tok.termin.tag instanceof DecreeChangeKind) 
                return true;
            if (strict) 
                return false;
            return true;
        }
        if ((t instanceof TextToken) && t.term === "СТ") 
            return false;
        let ps = DecreeChangeToken._tryParsePartList(t);
        let tt1 = null;
        if (ps !== null && ps.length > 0) {
            if ((ps.length === 1 && strict && ps[0].typ === PartTokenItemType.FREETEXT) && ps[0].tag === null) 
                ps = null;
            else 
                tt1 = ps[ps.length - 1].endToken.next;
        }
        if (tt1 !== null) {
            let doubt = 0;
            for (; tt1 !== null; tt1 = tt1.next) {
                if (tt1.isTableControlChar || tt1.isCharOf(".,")) 
                    continue;
                if (tt1.isChar('»') && inBrackets) 
                    break;
                if (tt1.isChar('«')) 
                    inBrackets = false;
                if (tt1.isChar(':') && tt1.isNewlineAfter) {
                    if (DecreeChangeToken._canBeChangeToken(tt1.next, lev + 1, doubt > 0, false)) 
                        return true;
                }
                let ps2 = DecreeChangeToken._tryParsePartList(tt1);
                if (ps2 !== null && ps2.length > 0) {
                    tt1 = ps2[ps2.length - 1].endToken;
                    continue;
                }
                if (tt1.getReferent() instanceof DecreeReferent) {
                    doubt = 0;
                    continue;
                }
                if (tt1 !== null && tt1.isChar('(')) {
                    let br = BracketHelper.tryParse(tt1, BracketParseAttr.NO, 100);
                    if (br !== null) {
                        tt1 = br.endToken;
                        continue;
                    }
                }
                if (tt1 === null) 
                    return false;
                let tok = DecreeChangeToken.M_TERMS.tryParse(tt1, TerminParseAttr.NO);
                if (tok !== null) {
                    if (tok.termin.tag instanceof DecreeChangeKind) {
                        if (!tt1.getMorphClassInDictionary().isAdjective) 
                            return true;
                    }
                    if (tt1.isValue("СЛОВО", null) && BracketHelper.canBeStartOfSequence(tt1.next, true, false)) {
                        if (doubt === 0) 
                            return true;
                        let br = BracketHelper.tryParse(tt1.next, BracketParseAttr.NO, 100);
                        if (br !== null) {
                            tt1 = br.endToken;
                            continue;
                        }
                    }
                }
                if (tt1.isValue("ПОСЛЕ", null) && doubt === 0) 
                    return true;
                if (tt1.isNewlineBefore) 
                    break;
                if (tt1.isValue("УТВЕРЖДЕННЫЙ", null)) 
                    break;
                if (tt1.lengthChar > 1) 
                    doubt++;
            }
            return false;
        }
        let num = ComplexNumToken.tryParse(t, null, false, false);
        if (num !== null) {
            if (num.suffix === null) 
                return false;
            if (DecreeChangeToken._canBeChangeToken(num.endToken.next, lev + 1, false, false)) 
                return true;
            let tt2 = num.endToken.next;
            let vv = false;
            if (tt2 !== null && ((tt2.isValue("В", null) || tt2.isValue("B", null)))) {
                tt2 = tt2.next;
                vv = true;
            }
            if (DecreeToken.isKeyword(tt2, false) !== null) {
                let line = InstrToken1.parse(t, true, null, 0, null, false, 0, false, false);
                if (line !== null && line.endToken.isChar(':')) {
                    if (line.endToken.previous.isValue("СОДЕРЖАНИЕ", null) || line.endToken.previous.isValue("РЕДАКЦИЯ", null)) 
                        return true;
                    if (vv) {
                        if (line.endToken.previous.getReferent() instanceof DecreeReferent) 
                            return true;
                        let dt = DecreeToken.tryAttach(line.endToken.previous, null, false);
                        if (dt !== null && dt.typ === DecreeTokenItemType.TYP) 
                            return true;
                    }
                }
            }
            if (((tt2 !== null && tt2.isValue("УСТАНОВИТЬ", null) && tt2.next !== null) && tt2.next.isComma && tt2.next.next !== null) && tt2.next.next.isValue("ЧТО", null)) 
                tt2 = tt2.next.next.next;
            if (tt2 === null) 
                return false;
            if (tt2.isValue2("КОНТРОЛЬ", "ЗА")) 
                return true;
            if (tt2.isValue("НАСТОЯЩИЙ", null)) {
                let dt = DecreeToken.tryAttach(tt2.next, null, false);
                if (dt !== null && dt.typ === DecreeTokenItemType.TYP) {
                    if (dt.endToken.next !== null && dt.endToken.next.isValue("ВСТУПАТЬ", null)) 
                        return true;
                }
            }
            if (strict) 
                return false;
        }
        else if (t.isValue("В", null) || t.isValue("B", null)) {
            if (strict && !t.isNewlineBefore) 
                return false;
            if (DecreeChangeToken._canBeChangeToken(t.next, lev + 1, false, false)) 
                return true;
        }
        else if (t.isValue("ПОСЛЕ", null)) {
            if (DecreeChangeToken._canBeChangeToken(t.next, lev + 1, false, false)) 
                return true;
        }
        if (t0.isNewlineBefore && num !== null && lev === 0) {
            let line = InstrToken1.parse(t, true, null, 0, null, false, 0, false, false);
            if (line !== null) 
                return DecreeChangeToken._canBeChangeToken(line.endToken.next, lev + 1, strict, false);
        }
        if (t.isValue("ВНЕСТИ", null) || t.isValue2("СЛЕДУЮЩИЕ", "ИЗМЕНЕНИЯ")) 
            return true;
        if (t.isValue("ИЗМЕНЕНИЕ", null)) {
            if (t.previous !== null && t.previous.isValue("ВНЕСЕНИЕ", null)) {
            }
            else if (t.next !== null && t.next.isValue("СОГЛАСНО", null)) 
                return true;
        }
        return false;
    }
    
    static tryAttachList(t, ignoreNewline = false, abzacRegime = false) {
        if (t === null) 
            return null;
        if (t.isNewlineBefore && !ignoreNewline) {
            if (ComplexNumToken.tryParse(t, null, false, false) !== null || t.isValue("В", null) || t.isValue("B", null)) 
                return null;
            if (!DecreeChangeToken._canBeChangeToken(t, 0, false, false)) 
                return null;
        }
        let d0 = DecreeChangeToken.tryAttach(t, null, false, null, false, abzacRegime, null, false);
        if (d0 === null && t.isTableControlChar) {
            for (let tt = t.next; tt !== null; tt = tt.next) {
                if (!tt.isTableControlChar) {
                    d0 = DecreeChangeToken.tryAttach(tt, null, false, null, false, abzacRegime, null, false);
                    break;
                }
            }
        }
        if ((d0 === null && t.previous !== null && t.previous.isChar(':')) && BracketHelper.isBracket(t, true)) 
            d0 = DecreeChangeToken._tryParseText(t, abzacRegime, false, null);
        if (d0 === null || d0.typ === DecreeChangeTokenTyp.UNDEFINED) {
            let cou = 0;
            for (let tt2 = t.next; tt2 !== null && (cou < 20); tt2 = tt2.next,cou++) {
                if (tt2.isNewlineBefore || MiscHelper.canBeStartOfSentence(tt2)) 
                    break;
                let d1 = DecreeChangeToken.tryAttach(tt2, null, false, null, false, false, null, false);
                if (d1 !== null && d1.typ === DecreeChangeTokenTyp.ACTION && d1.actKind === DecreeChangeKind.EXPIRE) {
                    d0 = d1;
                    break;
                }
            }
            if (d0 === null) 
                return null;
        }
        let res = new Array();
        res.push(d0);
        t = d0.endToken.next;
        if (d0.indentRegime) 
            abzacRegime = true;
        else if (d0.newParts !== null) 
            abzacRegime = false;
        for (; t !== null; t = t.next) {
            let d = DecreeChangeToken.tryAttach(t, null, false, null, false, abzacRegime, null, false);
            if (t.isNewlineBefore) {
                if ((t.isValue("ПРИЛОЖЕНИЕ", "ДОДАТОК") && t.previous !== null && t.previous.isChar(':')) && t.previous.previous !== null && t.previous.previous.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ")) {
                }
                else if (t.previous !== null && ((t.previous.isChar(':') || t.previous.isValue("РЕДАКЦИЯ", "РЕДАКЦІЯ"))) && ((BracketHelper.canBeStartOfSequence(t, true, false) || t.isChar(String.fromCharCode(0x1E))))) 
                    d = null;
                else if (d0.actKind === DecreeChangeKind.EXCHANGE && t.isValue("НА", null)) {
                }
                else if (d !== null && d.changeVal !== null) {
                }
                else if ((d !== null && d.typ === DecreeChangeTokenTyp.STARTSINGLE && d.changeVal !== null) && ((t.morph._case.isInstrumental || ((d.parts === null && d.decree === null))))) {
                    let num = ComplexNumToken.tryParse(t, null, false, false);
                    if (num !== null) 
                        break;
                    d.typ = DecreeChangeTokenTyp.VALUE;
                }
                else if (t.isAnd) {
                }
                else 
                    break;
            }
            if (d === null && t.isChar('.') && !t.isNewlineAfter) {
                if (res[res.length - 1].changeVal !== null) 
                    break;
                continue;
            }
            if (d === null && t.previous.isValue("НА", null) && BracketHelper.canBeStartOfSequence(t, true, false)) 
                d = DecreeChangeToken._tryParseText(t, abzacRegime, false, null);
            if (d === null && t.isValue("ПОЗИЦИЯ", null) && ((res[res.length - 1].actKind === DecreeChangeKind.EXPIRE || res[res.length - 1].actKind === DecreeChangeKind.REMOVE))) {
                let tt2 = t.next;
                if (tt2 !== null && tt2.isChar(':')) 
                    tt2 = tt2.next;
                d = DecreeChangeToken._tryParseText(tt2, abzacRegime, false, null);
                if (d !== null) 
                    res[res.length - 1].actKind = DecreeChangeKind.REMOVE;
            }
            if (d === null && t.isAnd) {
                let dd = DecreeChangeToken.tryAttach(t.next, null, false, null, false, abzacRegime, null, false);
                if (dd !== null && dd.typ === DecreeChangeTokenTyp.AFTERVALUE && res[res.length - 1].typ === dd.typ) 
                    d = dd;
                else if (dd === null && BracketHelper.isBracket(t.next, true)) 
                    d = DecreeChangeToken._tryParseText(t.next, abzacRegime, false, null);
            }
            if (d === null) {
                if (t.isValue("НОВЫЙ", "НОВИЙ")) 
                    continue;
                if (t.isValue("НА", null)) 
                    continue;
                if (t.isValue2("ПО", "ТЕКСТУ")) {
                    t = t.next;
                    continue;
                }
                if (t.isValue2("К", "ОН")) {
                    t = t.next;
                    continue;
                }
                if (t.isValue("ЭТОТ", null)) {
                    let npt = NounPhraseHelper.tryParse(t, NounPhraseParseAttr.PARSEPRONOUNS, 0, null);
                    if (npt !== null) {
                        t = npt.endToken;
                        continue;
                    }
                }
                if (t.isChar(':') && ((!t.isNewlineAfter || res[res.length - 1].actKind === DecreeChangeKind.NEW))) 
                    continue;
                if ((t instanceof TextToken) && t.term === "ТЕКСТОМ") 
                    continue;
                let pts = DecreeChangeToken._tryParsePartList(t);
                if (pts !== null) {
                    if (DecreeChangeToken.M_TERMS.tryParse(pts[pts.length - 1].endToken.next, TerminParseAttr.NO) !== null) {
                    }
                    else {
                        d = DecreeChangeToken._new1048(pts[0].beginToken, pts[pts.length - 1].endToken, DecreeChangeTokenTyp.UNDEFINED);
                        if (t.previous !== null && t.previous.isValue("НОВЫЙ", "НОВИЙ")) 
                            d.newParts = pts;
                        else 
                            d.parts = pts;
                    }
                }
                else {
                    let pt = DecreeChangeToken._tryParsePart(t, true);
                    if (pt !== null) {
                        d = new DecreeChangeToken(pt.beginToken, pt.endToken);
                        if (t.previous !== null && t.previous.isValue("НОВЫЙ", "НОВИЙ")) {
                            d.newParts = new Array();
                            d.newParts.push(pt);
                        }
                        else 
                            d.partTyp = pt.typ;
                    }
                }
            }
            if (d === null && res[res.length - 1].actKind === DecreeChangeKind.NEW) {
                if (BracketHelper.isBracket(t, true)) 
                    d = DecreeChangeToken._tryParseText(t, abzacRegime, false, null);
                else if (((t.previous.isChar(':') || t.previous.isValue("РЕДАКЦИЯ", null))) && (t instanceof NumberToken)) {
                    let nn = ComplexNumToken.tryParse(t, null, false, false);
                    if (nn !== null && BracketHelper.canBeStartOfSequence(nn.endToken.next, true, false)) {
                        d = DecreeChangeToken._tryParseText(nn.endToken.next, abzacRegime, false, null);
                        if (d !== null && d.changeVal !== null) {
                            d.beginToken = t;
                            d.changeVal.value = (nn.getSourceText() + " " + d.changeVal.value);
                        }
                    }
                }
                else if (t.isChar(String.fromCharCode(0x1E))) {
                    let rows = TableHelper.tryParseRows(t, 0, true, false);
                    if (rows !== null) {
                        d = DecreeChangeToken._new1048(t, rows[rows.length - 1].endToken, DecreeChangeTokenTyp.VALUE);
                        d.changeVal = DecreeChangeValueReferent._new1049(DecreeChangeValueKind.TEXT);
                        d.changeVal.beginChar = t.beginChar;
                        d.changeVal.endChar = d.endChar;
                        d.changeVal.value = d.getSourceText();
                        if (d.endToken.next !== null && BracketHelper.isBracket(d.endToken.next, true)) {
                            if (d.endToken.next.isNewlineAfter) 
                                d.endToken = d.endToken.next;
                            else if (d.endToken.next.next.isCharOf(".;")) 
                                d.endToken = d.endToken.next.next;
                        }
                    }
                }
            }
            if (d === null && res[res.length - 1].actKind === DecreeChangeKind.EXCHANGE) {
                if (t.isValue("НА", null) && t.next !== null) 
                    t = t.next;
                if (BracketHelper.canBeStartOfSequence(t, true, false)) 
                    d = DecreeChangeToken._tryParseText(t, abzacRegime, false, null);
            }
            if (d === null && t.isComma && res[res.length - 1].typ === DecreeChangeTokenTyp.AFTERVALUE) {
                d = DecreeChangeToken.tryAttach(t.next, null, false, null, false, abzacRegime, null, false);
                if (d !== null && d.actKind === DecreeChangeKind.APPEND) {
                }
                else 
                    d = null;
            }
            if (d === null) 
                break;
            if (d.typ === DecreeChangeTokenTyp.STARTMULTU || d.typ === DecreeChangeTokenTyp.SINGLE) 
                break;
            if (d.typ === DecreeChangeTokenTyp.STARTSINGLE) {
                if (d.decree === null && d.changeVal !== null && d.parts === null) 
                    d.typ = DecreeChangeTokenTyp.VALUE;
                else 
                    break;
            }
            res.push(d);
            t = d.endToken;
            if (d.indentRegime) 
                abzacRegime = true;
            else if (d.newParts !== null) 
                abzacRegime = false;
        }
        if ((res.length === 1 && res[0].actKind === DecreeChangeKind.CONSIDER && res[0].endToken.next !== null) && res[0].endToken.next.isCommaAnd && res[0].changeVal === null) {
            let _next = DecreeChangeToken.tryAttachList(res[0].endToken.next.next, true, abzacRegime);
            if ((_next !== null && _next.length === 2 && _next[0].actKind === DecreeChangeKind.NEW) && _next[1].typ === DecreeChangeTokenTyp.VALUE) 
                return _next;
        }
        return res;
    }
    
    static initialize() {
        if (DecreeChangeToken.M_TERMS !== null) 
            return;
        DecreeChangeToken.M_TERMS = new TerminCollection();
        let t = null;
        t = Termin._new96("ИЗЛОЖИТЬ В СЛЕДУЮЩЕЙ РЕДАКЦИИ", DecreeChangeKind.NEW);
        t.addVariant("ПРИНЯТЬ В СЛЕДУЮЩЕЙ РЕДАКЦИИ", false);
        t.addVariant("ИЗЛОЖИВ ЕГО В СЛЕДУЮЩЕЙ РЕДАКЦИИ", false);
        t.addVariant("ИЗЛОЖИТЬ В РЕДАКЦИИ", false);
        t.addVariant("ИЗЛОЖИТЬ", false);
        t.addVariant("ПРИНЯТЬ", false);
        t.addVariant("ИЗЛОЖИТЬ В НОВОЙ РЕДАКЦИИ", false);
        t.addVariant("ЧИТАТЬ В СЛЕДУЮЩЕЙ РЕДАКЦИИ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("ВИКЛАСТИ В НАСТУПНІЙ РЕДАКЦІЇ", MorphLang.UA, DecreeChangeKind.NEW);
        t.addVariant("ВИКЛАВШИ В ТАКІЙ РЕДАКЦІЇ", false);
        t.addVariant("ВИКЛАВШИ ЙОГО В НАСТУПНІЙ РЕДАКЦІЇ", false);
        t.addVariant("ВИКЛАСТИ В РЕДАКЦІЇ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("ПРИЗНАТЬ УТРАТИВШИМ СИЛУ", DecreeChangeKind.EXPIRE);
        t.addVariant("СЧИТАТЬ УТРАТИВШИМ СИЛУ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("ВИЗНАТИ таким, що ВТРАТИВ ЧИННІСТЬ", MorphLang.UA, DecreeChangeKind.EXPIRE);
        t.addVariant("ВВАЖАТИ таким, що ВТРАТИВ ЧИННІСТЬ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("ИСКЛЮЧИТЬ", DecreeChangeKind.REMOVE);
        t.addVariant("ИСКЛЮЧИВ ИЗ НЕГО", false);
        t.addVariant("УДАЛИТЬ", false);
        t.addVariant("УДАЛИВ ИЗ НЕГО", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("ВИКЛЮЧИТИ", MorphLang.UA, DecreeChangeKind.REMOVE);
        t.addVariant("ВИКЛЮЧИВШИ З НЬОГО", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("ПРИОСТАНОВИТЬ ДЕЙСТВИЕ", DecreeChangeKind.SUSPEND);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("СЧИТАТЬ", DecreeChangeKind.CONSIDER);
        t.addVariant("СЧИТАТЬ СООТВЕТСТВЕННО", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("ВВАЖАТИ", MorphLang.UA, DecreeChangeKind.CONSIDER);
        t.addVariant("ВВАЖАТИ ВІДПОВІДНО", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("ЗАМЕНИТЬ", DecreeChangeKind.EXCHANGE);
        t.addVariant("ЗАМЕНИВ В НЕМ", false);
        t.addVariant("ИСКЛЮЧИТЬ ЗАМЕНИТЬ", false);
        t.addVariant("ИСКЛЮЧИТЬ И ЗАМЕНИТЬ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("ЗАМІНИТИ", MorphLang.UA, DecreeChangeKind.EXCHANGE);
        t.addVariant("ЗАМІНИВШИ В НЬОМУ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("ДОПОЛНИТЬ", DecreeChangeKind.APPEND);
        t.addVariant("ДОПОЛНИВ ЕГО", false);
        t.addVariant("ДОБАВИТЬ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("ДОПОВНИТИ", MorphLang.UA, DecreeChangeKind.APPEND);
        t.addVariant("ДОПОВНИВШИ ЙОГО", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("СЛОВО", DecreeChangeValueKind.WORDS);
        DecreeChangeToken.m_Words = t;
        t.addVariant("АББРЕВИАТУРА", false);
        t.addVariant("АБРЕВІАТУРА", false);
        t.addVariant("ЗНАК СНОСКИ", false);
        t.addVariant("ПЕРЕМЕННАЯ", false);
        t.addVariant("МНОЖИТЕЛЬ", false);
        t.addVariant("КОД", false);
        t.addVariant("СОЮЗ", false);
        t.addVariant("ТЕКСТ СЛЕДУЮЩЕГО СОДЕРЖАНИЯ", false);
        t.addVariant("ДАТА", false);
        t.addVariant("СТРОКА", false);
        t.addVariant("СЛЕДУЮЩЕГОСОДЕРЖАНИЯ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("ОПРЕДЕЛЕНИЕ", DecreeChangeValueKind.DEFINITION);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new98("ТОЧКА С ЗАПЯТОЙ", DecreeChangeValueKind.WORDS, ";");
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new98("ТОЧКА", DecreeChangeValueKind.WORDS, ".");
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new98("ВОПРОСИТЕЛЬНЫЙ ЗНАК", DecreeChangeValueKind.WORDS, "?");
        t.addVariant("ЗНАК ВОПРОСА", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new98("ВОСКЛИЦАТЕЛЬНЫЙ ЗНАК", DecreeChangeValueKind.WORDS, "!");
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("ЦИФРА", DecreeChangeValueKind.NUMBERS);
        t.addVariant("ЧИСЛО", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("БЛОК", DecreeChangeValueKind.BLOCK);
        t.addVariant("БЛОК СО СЛОВАМИ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("БЛОК", MorphLang.UA, DecreeChangeValueKind.BLOCK);
        t.addVariant("БЛОК ЗІ СЛОВАМИ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new96("В СООТВЕТСТВУЮЩИХ ЧИСЛЕ И ПАДЕЖЕ", DecreeChangeValueKind.ROBUSTWORDS);
        t.addVariant("В СООТВЕТСТВУЮЩЕМ ПАДЕЖЕ", false);
        t.addVariant("В СООТВЕТСТВУЮЩЕМ ПАДЕЖЕ И ЧИСЛЕ", false);
        t.addVariant("В СООТВЕТСТВУЮЩЕМ ЧИСЛЕ", false);
        DecreeChangeToken.M_TERMS.add(t);
        t = Termin._new510("У ВІДПОВІДНОМУ ЧИСЛІ ТА ВІДМІНКУ", MorphLang.UA, DecreeChangeValueKind.ROBUSTWORDS);
        t.addVariant("У ВІДПОВІДНОМУ ВІДМІНКУ", false);
        t.addVariant("У ВІДПОВІДНОМУ ЧИСЛІ", false);
        DecreeChangeToken.M_TERMS.add(t);
    }
    
    static _new1048(_arg1, _arg2, _arg3) {
        let res = new DecreeChangeToken(_arg1, _arg2);
        res.typ = _arg3;
        return res;
    }
    
    static _new1063(_arg1, _arg2, _arg3, _arg4, _arg5) {
        let res = new DecreeChangeToken(_arg1, _arg2);
        res.typ = _arg3;
        res.hasChangeKeyword = _arg4;
        res.numBefore = _arg5;
        return res;
    }
    
    static _new1064(_arg1, _arg2, _arg3, _arg4, _arg5) {
        let res = new DecreeChangeToken(_arg1, _arg2);
        res.typ = _arg3;
        res.actKind = _arg4;
        res.numBefore = _arg5;
        return res;
    }
    
    static _new1066(_arg1, _arg2, _arg3, _arg4) {
        let res = new DecreeChangeToken(_arg1, _arg2);
        res.typ = _arg3;
        res.numBefore = _arg4;
        return res;
    }
    
    static _new1076(_arg1, _arg2, _arg3, _arg4) {
        let res = new DecreeChangeToken(_arg1, _arg2);
        res.typ = _arg3;
        res.actKind = _arg4;
        return res;
    }
    
    static static_constructor() {
        DecreeChangeToken.M_TERMS = null;
        DecreeChangeToken.m_Words = null;
    }
}


DecreeChangeToken.static_constructor();

module.exports = DecreeChangeToken