Example #1
0
        //────────────────────────────────────────

        public override void Translate(
            Configurationtree_Node cur_Cf,    //<lookup-id>
            Expression_Node_String parent_Ec, //< Sf:text-template;>
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(9)" + cur_Cf.Name);
            }

            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);


            //
            //
            //
            // 親へ連結 (value属性)
            //
            //
            //
            {
                //
                // 自要素の value="" 属性を、親へ連結
                //
                PmName pmName = PmNames.S_VALUE;

                string sValue;
                bool   bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                if (bHit)
                {
                    cur_Ec.AppendTextNode(
                        sValue,
                        cur_Cf,
                        log_Reports
                        );

                    //
                    //
                    //
                    // 子
                    //
                    //
                    //
                    this.ParseChild_InConfigurationtreeToExpression(
                        cur_Cf,
                        cur_Ec,//自
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );

                    //
                    //
                    //
                    // 親へ連結 ※属性連結
                    //
                    //
                    //
                    parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports);

                    goto gt_EndMethod;
                }
                else
                {
                }
            }


            //
            //
            //
            // 子
            //
            //
            //
            {
                //<a-default>の子要素を確認し、親<f-switch>のdefault属性に追加します。

                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }


            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports);


            //
            //
            //
            // 親へ連結 debug
            //
            //
            //
            if (log_Method.CanDebug(1))
            {
                string parent_SName_Fnc;
                parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 親<[" + parent_Ec.Cur_Configuration.Name + "] name=”[" + parent_SName_Fnc + "]” >");

                string sName_MyFnc;
                cur_Ec.TrySelectAttribute(out sName_MyFnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 自<[" + cur_Ec.Cur_Configuration.Name + "] name=”[" + sName_MyFnc + "]” >");
            }


            goto gt_EndMethod;
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// 2010年11月22日追加。
        /// </summary>
        /// <returns></returns>
        public virtual Expression_Node_Function Translate(
            string sName_Action,
            Configurationtree_Node action_Conf,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            MemoryApplication owner_MemoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_Functions.Name_Library, this, "Translate",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment(action_Conf.Name);
            }

            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_Function expr_Func;
            {
                Expression_Node_String parent_Expression_Null = null;

                expr_Func = Collection_Function.NewFunction2(
                    sName_Action,
                    parent_Expression_Null,
                    action_Conf,
                    owner_MemoryApplication,
                    log_Reports
                    );
            }

            this.Translate_Step1(
                this,
                action_Conf,
                expr_Func,
                owner_MemoryApplication,
                pg_ParsingLog,
                log_Reports
                );

            this.Translate_Step2(
                this,
                action_Conf,
                expr_Func,
                owner_MemoryApplication,
                pg_ParsingLog,
                log_Reports
                );

            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(action_Conf.Name);
            }

            log_Method.EndMethod(log_Reports);

            return expr_Func;
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Cf,
            Expressionv_3FListboxValidationImpl parent_Exprv,
            UsercontrolListbox uctLst,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(35)" + cur_Cf.Name);
            }

            //
            //

            string err_Child_SName_Node = "";
            string err_Parent_SName_Node = "";
            Configurationtree_Node err_Child_CfNode = null;

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_4ADisplayImpl cur_Exprv = new Expressionv_4ADisplayImpl(parent_Exprv, cur_Cf, memoryApplication);

            //
            //
            //
            // 属性
            //
            //
            //
            {
                {
                    PmName pmName = PmNames.S_TYPE;
                    string sValue;
                    bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        cur_Exprv.Dictionary_SAttribute.Add(pmName.Name_Pm, sValue);
                    }
                }

                {
                    PmName pmName = PmNames.S_DESCRIPTION;
                    string sValue;
                    bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        cur_Exprv.Dictionary_SAttribute.Add(pmName.Name_Pm, sValue);
                    }
                }
            }

            parent_Exprv.List_Expressionv_ADisplay.Add(cur_Exprv);
            uctLst.AddValidator_FListboxForItems(parent_Exprv, log_Reports);

            // #デバッグ中
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" 子<f-●●>数=[" + cur_Cf.List_Child.Count + "]");
            }

            //
            //
            //
            // 子
            //
            //
            //
            cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node child_Cf, ref bool bBreak)
            {
                if (child_Cf is Configurationtree_Node)
                {
                    Configurationtree_Node child_Configurationtree_Node = (Configurationtree_Node)child_Cf;

                    string sName_Fnc;
                    child_Configurationtree_Node.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, false, log_Reports);

                    if (NamesFnc.S_VLD_ALL_FIELDS_IS_EMPTY == sName_Fnc)
                    {
                        //
                        // <f-all-fields-is-empty>要素
                        ConfigurationtreeToExpression_V54_FAllFieldsIsEmptyImpl_ to = new ConfigurationtreeToExpression_V54_FAllFieldsIsEmptyImpl_();
                        to.Translate(
                            child_Configurationtree_Node,
                            cur_Exprv,
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );
                    }
                    else if (NamesFnc.S_ALL_TRUE == sName_Fnc)
                    {
                        //
                        // <f-all-true>要素
                        ConfigurationtreeToExpression_V54_FAllTrueImpl_ to = new ConfigurationtreeToExpression_V54_FAllTrueImpl_();
                        to.Translate(
                            child_Configurationtree_Node,
                            cur_Exprv,
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );

                    }
                    else
                    {
                        //
                        // エラー。
                        err_Child_SName_Node = child_Configurationtree_Node.Name;
                        err_Parent_SName_Node = cur_Cf.Name;
                        err_Child_CfNode = child_Configurationtree_Node;
                        bBreak = true;
                    }
                }
            });
            if (null != err_Child_SName_Node)
            {
                goto undefined_element;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            undefined_element:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_Child_SName_Node, log_Reports);//子設定ノード名
                tmpl.SetParameter(2, err_Parent_SName_Node, log_Reports);//親設定ノード名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(err_Child_CfNode), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7020;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #4
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Conf,
            Expression_Node_String parent_Expr,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(40)" + cur_Conf.Name);
            }

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String ec_Value = new Expression_Node_StringImpl(parent_Expr, cur_Conf);

            ec_Value.AppendTextNode(
                cur_Conf.Name,
                cur_Conf,
                log_Reports
                );


            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_StringImpl cur_Expr = new Expression_Node_StringImpl(parent_Expr, cur_Conf);


            //
            //
            //
            // 属性
            //
            //
            //
            {
                cur_Expr.SetAttribute(
                    PmNames.S_NAME.Name_Pm,
                    ec_Value,
                    log_Reports
                    );

                parent_Expr.SetAttribute(
                    NamesNode.S_RECORD_SET_LOAD_FROM,
                    ((Expression_Node_String)cur_Expr),
                    log_Reports
                    );
            }


            //
            //
            //
            // 子要素
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Conf,
                    cur_Expr,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }

            log_Method.EndMethod(log_Reports);
        }
Example #5
0
        //────────────────────────────────────────

        public void ConfigurationtreeToUsercontrol(
            Configurationtree_Node cur_Cf,//Sv_3Validator <validator>
            Usercontrol ucontrol,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToFc", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(41)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            string    err_SParameterValue = null;
            Exception err_Excp            = null;
            string    err_SValue          = null;
            string    err_SName_Validator = null;



            EnumValidation_Old enumResult = EnumValidation_Old.Thru;

            if (cur_Cf.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE_RESULT.Name_Pm))
            {
                string sValue_Parameter;
                cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE_RESULT, out sValue_Parameter, true, log_Reports);
                switch (sValue_Parameter)
                {
                case "OK":
                    enumResult = EnumValidation_Old.Ok;
                    break;

                case "NG":
                    enumResult = EnumValidation_Old.Ng;
                    break;

                case "THRU":
                    enumResult = EnumValidation_Old.Thru;
                    break;

                default:
                    //
                    // エラー。
                    goto gt_Error_UndefinedValidator02;
                }
            }



            string sName;
            string sName_ValidatorTrim;

            {
                PmName pmName = PmNames.S_NAME;
                if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                {
                    cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sName, true, log_Reports);
                    sName_ValidatorTrim = sName.Trim();
                }
                else
                {
                    sName = "";
                    sName_ValidatorTrim = "";
                }
            }



            //
            // バリデーターの選択
            switch (sName_ValidatorTrim)
            {
            case NamesFnc.S_VLD_SPACES:
            {
                // SToE:
                Expressionv_SpacesTextValidator_Old nValidator = new Expressionv_SpacesTextValidator_Old(enumResult);

                ucontrol.AddValidator(
                    nValidator,
                    log_Reports
                    );
            }
            break;

            case NamesFnc.S_VLD_MATCH:
            {
                string sValue_Parameter;
                cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_EXPECTED, out sValue_Parameter, false, log_Reports);
                err_SParameterValue = sValue_Parameter;

                // SToE:
                Expressionv_MatchTextValidator_Old ecv_Validator = new Expressionv_MatchTextValidator_Old(sValue_Parameter);

                ucontrol.AddValidator(
                    ecv_Validator,
                    log_Reports
                    );
            }
            break;

            case NamesFnc.S_VLD_INT_RANGE:
            {
                bool bSuccessful = true;
                int  nBeginValue = 0;
                if (bSuccessful)
                {
                    string sBegin;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_BEGIN, out sBegin, false, log_Reports);

                    if (!int.TryParse(sBegin, out nBeginValue))
                    {
                        // エラー。
                        err_Excp   = null;
                        err_SValue = sBegin;
                        goto gt_Error_InvalidatedBegin02;
                    }
                }

                int nEndValue = 0;
                if (bSuccessful)
                {
                    string sEnd;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_END, out sEnd, false, log_Reports);

                    if (!int.TryParse(sEnd, out nEndValue))
                    {
                        // エラー。
                        err_Excp   = null;
                        err_SValue = sEnd;
                        goto gt_Error_InvalidatedEnd02;
                    }
                }

                if (bSuccessful)
                {
                    // SToE:
                    Expressionv_IntRangeTextValidator_Old nValidator = new Expressionv_IntRangeTextValidator_Old(nBeginValue, nEndValue);

                    ucontrol.AddValidator(
                        nValidator,
                        log_Reports
                        );
                }
            }
            break;

            case NamesFnc.S_VLD_ALL:
            {
                // SToE:
                Expressionv_AllTextValidator_Old ecv_Validator = new Expressionv_AllTextValidator_Old(enumResult);

                ucontrol.AddValidator(
                    ecv_Validator,
                    log_Reports
                    );
            }
            break;

            default:
                //
                // エラー。
                err_SName_Validator = sName;
                goto gt_Error_UndefinedValidator03;
            }//switch

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_UndefinedValidator02:
            // TODO 未定義のバリデーターの場合。
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_VALUE_RESULT.Name_Pm, log_Reports); //引数名
                tmpl.SetParameter(2, err_SParameterValue, log_Reports);            //バリデーター名

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7012;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_InvalidatedBegin02:
            // 設定エラー
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_BEGIN.Name_Pm, log_Reports);                          //属性名
                tmpl.SetParameter(2, err_SValue, log_Reports);                                       //属性値
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports); //例外メッセージ

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7013;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_InvalidatedEnd02:
            // 設定エラー
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_END.Name_Pm, log_Reports);                            //属性名
                tmpl.SetParameter(2, err_SValue, log_Reports);                                       //属性値
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports); //例外メッセージ

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7014;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_UndefinedValidator03:
            // TODO 未定義のバリデーターの場合。
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_SName_Validator, log_Reports);//バリデーター名

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7015;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Conf,
            Expressionv_4ADisplayImpl parent_Exprv,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(37)" + cur_Conf.Name);
            }

            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_5FAllFieldsIsEmptyImpl cur_Exprv = new Expressionv_5FAllFieldsIsEmptyImpl(parent_Exprv, cur_Conf, memoryApplication);

            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Conf,
                    cur_Exprv,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Exprv.List_Expression_Child.Add(
                cur_Exprv,
                log_Reports
                );

            // #デバッグ中
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" ★★ <f-all-fields-is-empty> 子要素数=[" + cur_Exprv.List_Expression_Child.Count + "] 属性数=[" + cur_Exprv.Dictionary_Expression_Attribute.Count + "]");
            }

            goto gt_EndMethod;
            //
            //
            //
            //
            gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #7
0
        //────────────────────────────────────────

        /// <summary>
        /// 2010年11月22日追加。
        /// </summary>
        /// <returns></returns>
        public virtual Expression_Node_Function Translate(
            string sName_Action,
            Configurationtree_Node action_Conf,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            MemoryApplication owner_MemoryApplication,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_Functions.Name_Library, this, "Translate", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment(action_Conf.Name);
            }

            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_Function expr_Func;

            {
                Expression_Node_String parent_Expression_Null = null;

                expr_Func = Collection_Function.NewFunction2(
                    sName_Action,
                    parent_Expression_Null,
                    action_Conf,
                    owner_MemoryApplication,
                    log_Reports
                    );
            }

            this.Translate_Step1(
                this,
                action_Conf,
                expr_Func,
                owner_MemoryApplication,
                pg_ParsingLog,
                log_Reports
                );

            this.Translate_Step2(
                this,
                action_Conf,
                expr_Func,
                owner_MemoryApplication,
                pg_ParsingLog,
                log_Reports
                );


            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(action_Conf.Name);
            }

            log_Method.EndMethod(log_Reports);

            return(expr_Func);
        }
        private void ParseChild_SpecialFnc_(
            Configurationtree_Node cur_Cf,
            Expression_Node_String cur_Ec,//「S■fnc」、や「S■event」か?
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "ParseChild_Special_",log_Reports);
            //
            //
            if (!log_Reports.Successful)
            {
                goto gt_EndMethod;
            }

            //
            //
            //
            // 子
            //
            //
            //
            cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node s_Child, ref bool bBreak)
            {
                if (log_Reports.Successful)
                {
                    if (NamesNode.S_ARG == s_Child.Name)
                    {
                        //━━━━━
                        // arg
                        //━━━━━

                        string sName_MyFnc;
                        cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_MyFnc, false, log_Reports);

                        string sName_ChildFnc;
                        s_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_ChildFnc, false, log_Reports);

                        //
                        bool bNormalize = false;
                        if(
                            // 親が「E■fnc」
                            NamesNode.S_FNC == cur_Ec.Cur_Configuration.Name &&
                            NamesFnc.S_CELL == sName_MyFnc
                            )
                        {
                            if (
                                // 子が「name=”select”」
                                PmNames.S_SELECT.Name_Pm == sName_ChildFnc
                                )
                            {
                                bNormalize = true;
                            }
                        }

                        if (bNormalize)
                        {
                            ConfigurationtreeToExpression_F14n16 to = new ConfigurationtreeToExpression_F14_FArgImpl();
                            to.Translate(
                                s_Child,
                                cur_Ec,//「E■fnc」とか
                                memoryApplication,
                                pg_ParsingLog,
                                log_Reports
                                );
                        }
                        else
                        {
                            string sValue = "";

                            //
                            // value=”” 属性が指定されていれば、その値をそのまま取得。
                            //
                            s_Child.Dictionary_Attribute.ForEach(delegate(string sPmName2, string sAttrValue2, ref bool bBreak2)
                            {
                                if (PmNames.S_VALUE.Name_Pm == sPmName2)
                                {
                                    // value属性が指定されていた場合。
                                    s_Child.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sValue, true, log_Reports);

                                    // 「E■arg1」は作らずに、親要素の属性として追加。
                                    Expression_Node_String e_Value = new Expression_Leaf_StringImpl(sValue, cur_Ec, cur_Ec.Cur_Configuration);
                                    cur_Ec.SetAttribute(sName_ChildFnc, e_Value, log_Reports);
                                }
                            });

                            //
                            // 子要素の有無。
                            //
                            if (0 < s_Child.List_Child.Count)
                            {
                                // 子要素が指定されている場合。

                                if ("" != sValue)
                                {
                                    // value属性が指定されているのに、子要素も指定されているのは、エラーです。

                                    if (log_Method.CanError())
                                    {
                                        log_Method.WriteError_ToConsole( " value属性が指定されているのに、子要素も指定されているのは、エラーです。");
                                    }
                                }
                                else
                                {
                                    Expression_Node_StringImpl ec_Value = new Expression_Node_StringImpl(cur_Ec, s_Child);

                                    ConfigurationtreeToExpression_F14_FncImpl_ to2 = new ConfigurationtreeToExpression_F14_FncImpl_();
                                    to2.ParseChild_SpecialFnc_(
                                        s_Child,
                                        ec_Value,
                                        memoryApplication,
                                        pg_ParsingLog,
                                        log_Reports
                                        );

                                    //
                                    // 「E■arg1」は作らずに、親要素の属性として追加。
                                    //
                                    cur_Ec.SetAttribute(sName_ChildFnc, ec_Value, log_Reports);
                                }
                            }
                            else
                            {
                                if ("" == sValue)
                                {
                                    // todo:
                                    throw new Exception(Info_ConfigurationtreeToExpression.Name_Library + ":" + this.GetType().Name + "#ParseChild:(3) 「S■[" + cur_Cf.Name + "]」の子要素「S■[" + s_Child.Name + "]」に、value属性がありませんでした。子要素もありませんでした。");
                                }
                            }
                        }

                    }
                    else if (NamesNode.S_F_VAR == s_Child.Name)
                    {
                        //━━━━━
                        // f-var
                        //━━━━━
                        //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#ParseChild:(b)f-var 使っていなければ廃止したい。");

                        // 親要素「S■fnc」の子要素として追加します。
                        ConfigurationtreeToExpression_F14_FvariableImpl_ to = new ConfigurationtreeToExpression_F14_FvariableImpl_();
                        to.Translate(
                            s_Child,
                            cur_Ec,//「E■fnc」とか
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );
                    }
                    else if (NamesNode.S_F_STR == s_Child.Name)
                    {
                        //━━━━━
                        // f-str
                        //━━━━━
                        //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#ParseChild:(c)f-str 使っていなければ廃止したい。");

                        // 親要素「S■fnc」の子要素として追加します。
                        ConfigurationtreeToExpression_F14_FstrImpl_ to = new ConfigurationtreeToExpression_F14_FstrImpl_();
                        to.Translate(
                            s_Child,
                            cur_Ec,//「E■fnc」とか
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );
                    }
                    else if (NamesNode.S_FNC == s_Child.Name)
                    {
                        //━━━━━
                        // fnc
                        //━━━━━
                        //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#ParseChild:(e)fnc 使っていなければ廃止したい。");

                        //
                        // S_FVarImpl (「S■f-var」)など。
                        // 【追加 2012-05-31】
                        //

                        // 親要素「S■fnc」の子要素として追加します。
                        pg_ParsingLog.Increment("(SToE_F_4FFncImpl②)");
                        ConfigurationtreeToExpression_F14n16 to = new ConfigurationtreeToExpression_F14_FncImpl_();
                        to.Translate(
                            s_Child,// s_Fnc,//※s_Node(「S■f-var」とか)を入れるのではなく、その親を入れます。
                            cur_Ec,//「E■fnc」とかか?
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );
                        pg_ParsingLog.Decrement();

                    }
                    else if (NamesNode.S_F_PARAM == s_Child.Name)
                    {
                        //━━━━━
                        // f-param
                        //━━━━━
                        //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#ParseChild:(f)f-param 使っていなければ廃止したい。");

                        // 【追加 2012-06-05】
                        ConfigurationtreeToExpression_F14_FparamImpl_ to4 = new ConfigurationtreeToExpression_F14_FparamImpl_();
                        to4.Translate(
                            s_Child,
                            cur_Ec,
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );

                    }
                    else
                    {
                        // todo:2
                        goto gt_Error_UndefinedChlid;
                        throw new Exception(Info_ConfigurationtreeToExpression.Name_Library + ":" + this.GetType().Name + "#ParseChild:(16) 「S■[" + cur_Cf.Name + "]」に、未定義の子要素「S■[" + s_Child.Name + "]」がありました。");
                    }
                }

                goto gt_EndMethod2;

                //
            gt_Error_UndefinedChlid:
                {
                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                    tmpl.SetParameter(1, cur_Cf.Name, log_Reports);//設定ノード名
                    tmpl.SetParameter(2, s_Child.Name, log_Reports);//子要素名
                    tmpl.SetParameter(3, cur_Cf.Dictionary_Attribute.Count.ToString(), log_Reports);//string属性の数

                    //string属性のリスト
                    StringBuilder s1 = new StringBuilder();
                    cur_Cf.Dictionary_Attribute.ForEach(delegate(string sKey2, string sValue2, ref bool bBreak2)
                    {
                        s1.Append("s属 [" + sKey2 + "]=[" + sValue2 + "]\n");
                    });
                    tmpl.SetParameter(4, s1.ToString(), log_Reports);

                    tmpl.SetParameter(5, cur_Cf.List_Child.Count.ToString(), log_Reports);//子要素の数

                    //子要素のリスト
                    StringBuilder s2 = new StringBuilder();
                    cur_Cf.List_Child.ForEach(
                        delegate(Configurationtree_Node cf_Child2, ref bool bBreak5)
                        {
                            s2.Append("子「S■" + cf_Child2.Name + "」\n");
                        });
                    tmpl.SetParameter(6, s2.ToString(), log_Reports);

                    tmpl.SetParameter(7, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                    memoryApplication.CreateErrorReport("Er:7005;", tmpl, log_Reports);
                }
                goto gt_EndMethod2;

            gt_EndMethod2:
                ;
            });

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Conf,
            Expressionv_4ADisplayImpl exprv_ADisplay,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(38)" + cur_Conf.Name);
            }

            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_5FAllTrueImpl cur_Exprv = new Expressionv_5FAllTrueImpl(exprv_ADisplay, cur_Conf, memoryApplication);

            //
            //
            //
            // 子
            //
            //
            //
            if(log_Reports.Successful)
            {
                exprv_ADisplay.List_Expression_Child.Add(
                    cur_Exprv,
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            List<Configurationtree_Node> cfList_Fnc = cur_Conf.GetChildrenByNodename(NamesNode.S_FNC, false, log_Reports);
            foreach (Configurationtree_Node cf_Child in cfList_Fnc)
            {
                string child_SName_Fnc;
                cf_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out child_SName_Fnc, true, log_Reports);

                if (NamesFnc.S_VLD_EMPTY_FIELD == child_SName_Fnc)
                {
                    // <a-empty-field>要素
                    ConfigurationtreeToExpression_V55_AEmptyFieldImpl_ to = new ConfigurationtreeToExpression_V55_AEmptyFieldImpl_();
                    to.Translate(
                        cf_Child,
                        cur_Exprv,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else
                {
                    if (log_Method.CanDebug(0))
                    {
                        log_Method.WriteError_ToConsole("未実装です。");
                    }

                    throw new Exception("未実装です。");
                }
            }

            goto gt_EndMethod;
            //
            //
            //
            //
            gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #10
0
        //────────────────────────────────────────

        /// <summary>
        ///
        /// </summary>
        /// <param name="s_cur"></param>
        /// <param name="e_parent"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,      //Sf:case;
            Expression_Node_String parent_Expr, //Sf:switch;
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: このメソッドは廃止方針です。");

            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(8)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            string parent_SName_Fnc;

            parent_Expr.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One, log_Reports);


            if (NamesFnc.S_SWITCH != parent_SName_Fnc)
            {
                goto gt_Error_Parent;
            }



            //
            // 親
            //
            Expression_SfswitchImpl parent_Expression_Fswitch = (Expression_SfswitchImpl)parent_Expr;

            //
            // 自
            //
            Expression_SfcaseImpl cur_Ec = (Expression_SfcaseImpl)Expression_SfcaseImpl.Create(parent_Expression_Fswitch, cur_Cf);

            //
            // 属性
            //
            {
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    true,  //name属性は必須。
                    false, //value属性は無い。
                    log_Reports
                    );
            }



            //
            //
            //
            // 子
            //
            //
            //
            Configurationtree_Node err_Child_Cf;

            {
                //
                // <fnc name=”Sf:case;”>
                //   <arg1 name=”caseValue” value=”★”>要素の value値を、nFallTrue に セット。
                //

                cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node child_Cf_Arg1, ref bool bBreak)
                {
                    if (
                        // <arg >
                        NamesNode.S_ARG == child_Cf_Arg1.Name
                        )
                    {
                        string sName_Child_Fnc;
                        child_Cf_Arg1.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Child_Fnc, true, log_Reports);

                        if (log_Method.CanDebug(1))
                        {
                            log_Method.WriteDebug_ToConsole(" ・" + child_Cf_Arg1.Name + " name=”[" + sName_Child_Fnc + "]”");
                        }

                        if (
                            //s_ChildArg1.Dictionary_Attribute.ContainsKey(PmNames.NAME.SAttrName) &&
                            // name=”caseValue”
                            PmNames.S_VALUE_CASE.Name_Pm == sName_Child_Fnc
                            )
                        {
                            //
                            // caseValueは、直接 value=""属性で指定されたものだけが有効です。子要素は指定できません。
                            //
                            if (child_Cf_Arg1.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE.Name_Pm))
                            {
                                log_Reports.Log_Callstack.Push(log_Method, "SToE②s_Cur→e_Cur");
                                this.ParseChild_InConfigurationtreeToExpression(
                                    cur_Cf, //Sf:case;
                                    cur_Ec, // e_Cur, e_Parent, //Sf:case;
                                    memoryApplication,
                                    pg_ParsingLog,
                                    log_Reports
                                    );
                                log_Reports.Log_Callstack.Pop(log_Method, "SToE②s_Cur→e_Cur");


                                //
                                // 最初のcaseValueのみ有効。
                                //
                                bBreak = true;
                            }
                            else
                            {
                                // エラー
                                err_Child_Cf = child_Cf_Arg1;
                                bBreak       = true;
                                goto gt_Error_NotConstCaseValue;
                            }
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        if (log_Method.CanDebug(1))
                        {
                            log_Method.WriteDebug_ToConsole(" ・" + child_Cf_Arg1.Name);
                        }
                    }

                    goto gt_End2;
                    //
                    //
                    gt_Error_NotConstCaseValue:
                    {
                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                        tmpl.SetParameter(1, PmNames.S_VALUE_CASE.Name_Pm, log_Reports);                             //ケース名
                        tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(err_Child_Cf), log_Reports); //設定位置パンくずリスト

                        memoryApplication.CreateErrorReport("Er:7017;", tmpl, log_Reports);
                    }
                    goto gt_End2;
                    //
                    gt_End2:
                    ;
                });
            }


            //
            //
            //
            // 親
            //
            //
            //
            parent_Expression_Fswitch.List_Expression_Sfcase.Add(cur_Ec);


            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" ┌────┐ 子要素数=[" + cur_Cf.List_Child.Count + "]");
                cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node s_Child, ref bool bBreak)
                {
                    if (NamesNode.S_ARG == s_Child.Name)
                    {
                        string sName;
                        s_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName, true, log_Reports);
                        log_Method.WriteDebug_ToConsole(" ・" + s_Child.Name + " name=”[" + sName + "]”");
                    }
                    else
                    {
                        log_Method.WriteDebug_ToConsole(" ・" + s_Child.Name);
                    }
                });
                log_Method.WriteDebug_ToConsole(" └────┘");


                log_Method.WriteDebug_ToConsole(" ┌────┐ string属性数=[" + cur_Cf.Dictionary_Attribute.Count + "]");
                cur_Cf.Dictionary_Attribute.ForEach(delegate(string sKey, string sValue, ref bool bBreak)
                {
                    log_Method.WriteDebug_ToConsole(" s属 [" + sKey + "]=[" + sValue + "]");
                });
                log_Method.WriteDebug_ToConsole(" └────┘");
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_Parent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, parent_Expr.Cur_Configuration.Name, log_Reports);                 //親設定ノード名
                tmpl.SetParameter(2, parent_SName_Fnc, log_Reports);                                   //親設定ノード関数名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7018;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public override void Translate(
            Configurationtree_Node cur_Cf,//「S■fnc」
            Expression_Node_String parent_Ec,//「S■fnc」、や「S■event」か?
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(29)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            if (!log_Reports.Successful)
            {
                goto gt_EndMethod;
            }

            if (null == parent_Ec)
            {
                goto gt_Error_NullParent;
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Ec = null;  //「E■fnc」

            //
            // 親ファンク名
            // 自ファンク名
            //
            string parent_SName_Fnc = "";
            string sName_MyFnc = "";
            {
                bool bHit9 = parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);

                if (!log_Reports.Successful)
                {
                    goto gt_EndMethod;
                }
                else if (NamesNode.S_FNC == parent_Ec.Cur_Configuration.Name && "" == parent_SName_Fnc)
                {
                    //
                    // エラー。親要素が、name属性を持たない「E■fnc」だった。
                    //
                    goto gt_Error_NoNameParent1;
                }
            }

            //   「E■fnc」には、name=”★”属性が必須。
            bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_MyFnc, true, log_Reports);

            if (!log_Reports.Successful)
            {
                goto gt_EndMethod;
            }

            //
            //
            //
            // 自
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 「E■fnc」要素を作成。

                if (NamesFnc.S_ALL_TRUE == sName_MyFnc)
                {
                    cur_Ec = Expressionv_5FAllTrueImpl.Create(parent_Ec, cur_Cf, memoryApplication);
                }
                else if (NamesFnc.S_TEXT_TEMPLATE == sName_MyFnc)
                {
                    cur_Ec = Expression_SftextTemplate.Create(parent_Ec, cur_Cf, memoryApplication);
                }
                else if (NamesFnc.S_CELL == sName_MyFnc)
                {
                    if (log_Method.CanDebug(10))
                    {
                        log_Method.WriteDebug_ToConsole( "(2) 「S■fnc name=”[" + sName_MyFnc + "]”」要素 属性解析開始。");
                    }
                    cur_Ec = Expression_SfcellImpl.Create(parent_Ec, cur_Cf, memoryApplication);
                }
                else if (NamesFnc.S_VALUE_CONTROL == sName_MyFnc)
                {
                    // コントロール名を取得し、コントロールの値を返すように設定。

                    string sFcName;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sFcName, true, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        goto gt_EndMethod;
                    }

                    Expression_Node_String ec_FcName = new Expression_Leaf_StringImpl(sFcName, parent_Ec, cur_Cf);
                    cur_Ec = new Expression_ValuecontrolImpl(ec_FcName, memoryApplication, parent_Ec, cur_Cf);
                }
                else if (NamesFnc.S_SWITCH == sName_MyFnc)
                {
                    if(log_Method.CanDebug(1))
                    {
                        Log_TextIndented s = new Log_TextIndentedImpl();
                        parent_Ec.ToText_Snapshot(s);
                        log_Method.WriteDebug_ToConsole( "E■switch生成。s=" + s.ToString());
                    }
                    cur_Ec = Expression_SfswitchImpl.Create(parent_Ec, cur_Cf);
                }
                else
                {

                    if(sName_MyFnc.StartsWith(NamesFnc.S_UF))
                    {
                        // ユーザー定義関数
                        cur_Ec = new Expression_FfncImpl(parent_Ec, cur_Cf, memoryApplication);
                    }
                    else
                    {
                        // システム定義関数
                        cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);
                    }

                }
            }
            else
            {
                goto gt_EndMethod;
            }

            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 元からあった。
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    true,//name属性は必須。
                    false,//value属性は、子<f-str>にしない。
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            if (log_Reports.Successful)
            {
                if(NamesFnc.S_TEXT_TEMPLATE == sName_MyFnc)
                {
                    this.ParseChild_SpecialTextTemplate_(
                        cur_Cf,
                        cur_Ec,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else if (NamesFnc.S_SWITCH == sName_MyFnc)
                {
                    this.ParseChild_SpecialSwitch_(
                        cur_Cf,//「S■fnc」
                        cur_Ec,//「E■fnc」
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                            );
                }
                else if (NamesFnc.S_VLD_EMPTY_FIELD == sName_MyFnc)
                {
                    // <a-empty-field>要素
                    ConfigurationtreeToExpression_V55_AEmptyFieldImpl_ to = new ConfigurationtreeToExpression_V55_AEmptyFieldImpl_();
                    to.Translate(
                        cur_Cf,
                        cur_Ec,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else
                {
                    // この「S□fnc」の子を解析。
                    // 「Sf:cell;」
                    // 「Sf:where;」
                    // 「Sf:rec-cond;」

                    // 【追加 2012-06-02】
                    this.ParseChild_SpecialFnc_(
                        cur_Cf,
                        cur_Ec,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
            }
            else
            {
                goto gt_EndMethod;
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            if (log_Reports.Successful)
            {

                //
                // "hardcoding-control" に追加する子要素としては、f-cellなどがある。
                //

                if (
                    sName_MyFnc.StartsWith(NamesFnc.S_UF)//ユーザー定義関数
                    || NamesFnc.S_TEXT_TEMPLATE == sName_MyFnc//テンプレート
                    || NamesFnc.S_SWITCH == sName_MyFnc//スイッチ文
                    || (NamesNode.S_FNC == cur_Cf.Name && NamesFnc.S_VALUE_CONTROL == sName_MyFnc)//todo:
                    || (NamesNode.S_FNC == parent_Ec.Cur_Configuration.Name)
                    || (NamesFnc.S_CELL == sName_MyFnc || NamesFnc.S_TEXT_TEMPLATE == sName_MyFnc)
                    || (sName_MyFnc == NamesFnc.S_REC_COND && NamesNode.S_FNC == parent_Ec.Cur_Configuration.Name && NamesFnc.S_WHERE == parent_SName_Fnc)//親が<rec-cond>で、自<fnc name=”Sf:Where;”>要素
                    )
                {
                    parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);
                }
                else
                {
                    // エラー

                    goto gt_Error_CanNotAddParent;
                    // todo:
                    //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE:(18)★★親要素へ連結不能    ・親「E■[" + e_Parent.Cur_Configurationtree.Name + "] name=”[" + sParentFncName + "]”」 ← 自「S■[" + s_AFnc.Name_Node + "] name=”[" + sFncName + "]”」中止。 /エラー。親要素に追加しようとしましたが、予想しない親要素でした。");
                }

            }

            //
            //
            // 終わり際に、デバッグ
            //
            //
            if (log_Method.CanDebug(10) && log_Reports.Successful)
            {
                if (null != cur_Ec)//既にエラーが出ている場合。
                {
                    log_Method.WriteDebug_ToConsole("(19) 自要素の属性の数=[" + cur_Ec.Dictionary_Expression_Attribute.Count + "]");

                    log_Method.WriteDebug_ToConsole("(21) ┌────┐自要素。その子要素の数=[" + cur_Ec.List_Expression_Child.Count + "]");

                    cur_Ec.List_Expression_Child.ForEach(
                        delegate(Expression_Node_String e_Child, ref bool bRemove, ref bool bBreak)
                        {
                            log_Method.WriteDebug_ToConsole("「S■" + e_Child.Cur_Configuration.Name + "」");
                        });

                    log_Method.WriteDebug_ToConsole( "(22) └────┘");

                    log_Method.WriteDebug_ToConsole( "(23)└────────────────┘ 「S■[" + cur_Cf.Name + "] name=”[" + sName_MyFnc + "]”」(fnc)要素解析終了。");

                    //
                    // name属性の指定は必須です。
                    //
                    string sName8;
                    bool bHit8 = cur_Ec.TrySelectAttribute(out sName8, PmNames.S_NAME.Name_Pm, EnumHitcount.One, log_Reports);
                    if (!bHit8)
                    {
                        // todo:
                        throw new Exception(Info_ConfigurationtreeToExpression.Name_Library + ":" + this.GetType().Name + "#SToE:(24)fnc要素にname属性が指定されていないのはエラーです①。");
                    }
                    else if ("" == sName8)
                    {
                        // todo:
                        //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE:(24)fnc要素に空文字列のname属性が指定されているのはエラーです。");
                        goto gt_Error_NoNameParent2;
                    }
                }
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_CanNotAddParent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, cur_Cf.Name, log_Reports);//設定ノード名
                tmpl.SetParameter(2, sName_MyFnc, log_Reports);//関数名

                if (null != cur_Ec)
                {
                    tmpl.SetParameter(3, cur_Ec.Dictionary_Expression_Attribute.Count.ToString(), log_Reports);//属性の数

                    //属性リスト
                    StringBuilder s1 = new StringBuilder();
                    cur_Ec.Dictionary_Expression_Attribute.ForEach(
                        delegate(string sName2, Expression_Node_String e_Attr2, ref bool bBreak)
                        {
                            s1.Append("属" + sName2 + "=”" + e_Attr2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "”\n");
                        });
                    tmpl.SetParameter(4, s1.ToString(), log_Reports);

                    tmpl.SetParameter(5, cur_Ec.List_Expression_Child.Count.ToString(), log_Reports);//子要素の数

                    //子要素リスト
                    StringBuilder s2 = new StringBuilder();
                    cur_Ec.List_Expression_Child.ForEach(
                        delegate(Expression_Node_String e_Child, ref bool bRemove, ref bool bBreak)
                        {
                            s2.Append("子「S■" + e_Child.Cur_Configuration.Name + "」\n");
                        });
                    tmpl.SetParameter(6, s2.ToString(), log_Reports);

                    tmpl.SetParameter(7, NamesNode.S_ARG, log_Reports);//期待の親設定ノード名
                    tmpl.SetParameter(8, PmNames.S_WHERE.Name_Pm, log_Reports);//期待の親設定関数名
                }
                else
                {
                    tmpl.SetParameter(3, "ヌル", log_Reports);//設定属性の数
                    tmpl.SetParameter(4, "ヌル", log_Reports);//設定属性リスト
                    tmpl.SetParameter(5, "ヌル", log_Reports);//設定子要素の数
                    tmpl.SetParameter(6, "ヌル", log_Reports);//設定子要素リスト
                    tmpl.SetParameter(7, "ヌル", log_Reports);//期待の親設定ノード名
                    tmpl.SetParameter(8, "ヌル", log_Reports);//期待の親設定関数名
                }

                if (null != parent_Ec)
                {
                    tmpl.SetParameter(9, parent_Ec.Cur_Configuration.Name, log_Reports);//実際の親Expression要素ノード名
                    tmpl.SetParameter(10, parent_SName_Fnc, log_Reports);//実際の親Expression要素関数名
                    tmpl.SetParameter(11, parent_Ec.Dictionary_Expression_Attribute.Count.ToString(), log_Reports);//Expression属性の数

                    StringBuilder s3 = new StringBuilder();
                    parent_Ec.Dictionary_Expression_Attribute.ForEach(
                        delegate(string sName2, Expression_Node_String e_Attr2, ref bool bBreak)
                        {
                            s3.Append("属" + sName2 + "=”" + e_Attr2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "”\n");
                        });
                    tmpl.SetParameter(12, s3.ToString(), log_Reports);//子Expression属性リスト

                    tmpl.SetParameter(13, parent_Ec.List_Expression_Child.Count.ToString(), log_Reports);//子Expression要素数

                    StringBuilder s4 = new StringBuilder();
                    parent_Ec.List_Expression_Child.ForEach(
                        delegate(Expression_Node_String e_Child, ref bool bRemove, ref bool bBreak)
                        {
                            s4.Append("子「S■" + e_Child.Cur_Configuration.Name + "」\n");
                        });
                    tmpl.SetParameter(14, s4.ToString(), log_Reports);//子Expression要素リスト

                }
                else
                {
                    tmpl.SetParameter(9, "ヌル", log_Reports);//実際の親Expression要素ノード名
                    tmpl.SetParameter(10, "ヌル", log_Reports);//実際の親Expression要素関数名
                    tmpl.SetParameter(11, "ヌル", log_Reports);//Expression属性の数
                    tmpl.SetParameter(12, "ヌル", log_Reports);//子Expression属性リスト
                    tmpl.SetParameter(13, "ヌル", log_Reports);//子Expression要素数
                    tmpl.SetParameter(14, "ヌル", log_Reports);//子Expression要素リスト
                }

                tmpl.SetParameter(15, Log_RecordReportsImpl.ToText_Configuration(parent_Ec.Cur_Configuration), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7021;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_NoNameParent2:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, cur_Cf.Name, log_Reports);//設定ノード名
                tmpl.SetParameter(2, sName_MyFnc, log_Reports);//関数名

                if (null != cur_Ec)
                {
                    tmpl.SetParameter(3, cur_Ec.Dictionary_Expression_Attribute.Count.ToString(), log_Reports);//属性の数

                    //属性リスト
                    StringBuilder s1 = new StringBuilder();
                    cur_Ec.Dictionary_Expression_Attribute.ForEach(
                        delegate(string sName2, Expression_Node_String e_Attr2, ref bool bBreak)
                        {
                            s1.Append("属" + sName2 + "=”" + e_Attr2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "”\n");
                        });
                    tmpl.SetParameter(4, s1.ToString(), log_Reports);

                    tmpl.SetParameter(5, cur_Ec.List_Expression_Child.Count.ToString(), log_Reports);//子要素の数

                    //子要素リスト
                    StringBuilder s2 = new StringBuilder();
                    cur_Ec.List_Expression_Child.ForEach(
                        delegate(Expression_Node_String e_Child, ref bool bRemove, ref bool bBreak)
                        {
                            s2.Append("子「S■" + e_Child.Cur_Configuration.Name + "」\n");
                        });
                    tmpl.SetParameter(6, s2.ToString(), log_Reports);

                    tmpl.SetParameter(7, NamesNode.S_ARG, log_Reports);//期待の親設定ノード名
                    tmpl.SetParameter(8, PmNames.S_WHERE.Name_Pm, log_Reports);//期待の親設定関数名
                }
                else
                {
                    tmpl.SetParameter(3, "ヌル", log_Reports);//設定属性の数
                    tmpl.SetParameter(4, "ヌル", log_Reports);//設定属性リスト
                    tmpl.SetParameter(5, "ヌル", log_Reports);//設定子要素の数
                    tmpl.SetParameter(6, "ヌル", log_Reports);//設定子要素リスト
                    tmpl.SetParameter(7, "ヌル", log_Reports);//期待の親設定ノード名
                    tmpl.SetParameter(8, "ヌル", log_Reports);//期待の親設定関数名
                }

                if (null != parent_Ec)
                {
                    tmpl.SetParameter(9, parent_Ec.Cur_Configuration.Name, log_Reports);//実際の親Expression要素ノード名
                    tmpl.SetParameter(10, parent_SName_Fnc, log_Reports);//実際の親Expression要素関数名
                    tmpl.SetParameter(11, parent_Ec.Dictionary_Expression_Attribute.Count.ToString(), log_Reports);//Expression属性の数

                    StringBuilder s3 = new StringBuilder();
                    parent_Ec.Dictionary_Expression_Attribute.ForEach(
                        delegate(string sName2, Expression_Node_String e_Attr2, ref bool bBreak)
                        {
                            s3.Append("属" + sName2 + "=”" + e_Attr2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "”\n");
                        });
                    tmpl.SetParameter(12, s3.ToString(), log_Reports);//子Expression属性リスト

                    tmpl.SetParameter(13, parent_Ec.List_Expression_Child.Count.ToString(), log_Reports);//子Expression要素数

                    StringBuilder s4 = new StringBuilder();
                    parent_Ec.List_Expression_Child.ForEach(
                        delegate(Expression_Node_String e_Child, ref bool bRemove, ref bool bBreak)
                        {
                            s4.Append("子「S■" + e_Child.Cur_Configuration.Name + "」\n");
                        });
                    tmpl.SetParameter(14, s4.ToString(), log_Reports);//子Expression要素リスト

                }
                else
                {
                    tmpl.SetParameter(9, "ヌル", log_Reports);//実際の親Expression要素ノード名
                    tmpl.SetParameter(10, "ヌル", log_Reports);//実際の親Expression要素関数名
                    tmpl.SetParameter(11, "ヌル", log_Reports);//Expression属性の数
                    tmpl.SetParameter(12, "ヌル", log_Reports);//子Expression属性リスト
                    tmpl.SetParameter(13, "ヌル", log_Reports);//子Expression要素数
                    tmpl.SetParameter(14, "ヌル", log_Reports);//子Expression要素リスト
                }

                tmpl.SetParameter(15, Log_RecordReportsImpl.ToText_Configuration(parent_Ec.Cur_Configuration), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7022;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_NoNameParent1:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, cur_Cf.Name, log_Reports);//設定ノード名
                tmpl.SetParameter(2, sName_MyFnc, log_Reports);//関数名

                if (null != cur_Ec)
                {
                    tmpl.SetParameter(3, cur_Ec.Dictionary_Expression_Attribute.Count.ToString(), log_Reports);//属性の数

                    //属性リスト
                    StringBuilder s1 = new StringBuilder();
                    cur_Ec.Dictionary_Expression_Attribute.ForEach(
                        delegate(string sName2, Expression_Node_String e_Attr2, ref bool bBreak)
                        {
                            s1.Append("属" + sName2 + "=”" + e_Attr2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "”\n");
                        });
                    tmpl.SetParameter(4, s1.ToString(), log_Reports);

                    tmpl.SetParameter(5, cur_Ec.List_Expression_Child.Count.ToString(), log_Reports);//子要素の数

                    //子要素リスト
                    StringBuilder s2 = new StringBuilder();
                    cur_Ec.List_Expression_Child.ForEach(
                        delegate(Expression_Node_String e_Child, ref bool bRemove, ref bool bBreak)
                        {
                            s2.Append("子「S■" + e_Child.Cur_Configuration.Name + "」\n");
                        });
                    tmpl.SetParameter(6, s2.ToString(), log_Reports);

                    tmpl.SetParameter(7, NamesNode.S_ARG, log_Reports);//期待の親設定ノード名
                    tmpl.SetParameter(8, PmNames.S_WHERE.Name_Pm, log_Reports);//期待の親設定関数名
                }
                else
                {
                    tmpl.SetParameter(3, "ヌル", log_Reports);//設定属性の数
                    tmpl.SetParameter(4, "ヌル", log_Reports);//設定属性リスト
                    tmpl.SetParameter(5, "ヌル", log_Reports);//設定子要素の数
                    tmpl.SetParameter(6, "ヌル", log_Reports);//設定子要素リスト
                    tmpl.SetParameter(7, "ヌル", log_Reports);//期待の親設定ノード名
                    tmpl.SetParameter(8, "ヌル", log_Reports);//期待の親設定関数名
                }

                if (null != parent_Ec)
                {
                    tmpl.SetParameter(9, parent_Ec.Cur_Configuration.Name, log_Reports);//実際の親Expression要素ノード名
                    tmpl.SetParameter(10, parent_SName_Fnc, log_Reports);//実際の親Expression要素関数名
                    tmpl.SetParameter(11, parent_Ec.Dictionary_Expression_Attribute.Count.ToString(), log_Reports);//Expression属性の数

                    StringBuilder s3 = new StringBuilder();
                    parent_Ec.Dictionary_Expression_Attribute.ForEach(
                        delegate(string sName2, Expression_Node_String e_Attr2, ref bool bBreak)
                        {
                            s3.Append("属" + sName2 + "=”" + e_Attr2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports) + "”\n");
                        });
                    tmpl.SetParameter(12, s3.ToString(), log_Reports);//子Expression属性リスト

                    tmpl.SetParameter(13, parent_Ec.List_Expression_Child.Count.ToString(), log_Reports);//子Expression要素数

                    StringBuilder s4 = new StringBuilder();
                    parent_Ec.List_Expression_Child.ForEach(
                        delegate(Expression_Node_String e_Child, ref bool bRemove, ref bool bBreak)
                        {
                            s4.Append("子「S■" + e_Child.Cur_Configuration.Name + "」\n");
                        });
                    tmpl.SetParameter(14, s4.ToString(), log_Reports);//子Expression要素リスト

                }
                else
                {
                    tmpl.SetParameter(9, "ヌル", log_Reports);//実際の親Expression要素ノード名
                    tmpl.SetParameter(10, "ヌル", log_Reports);//実際の親Expression要素関数名
                    tmpl.SetParameter(11, "ヌル", log_Reports);//Expression属性の数
                    tmpl.SetParameter(12, "ヌル", log_Reports);//子Expression属性リスト
                    tmpl.SetParameter(13, "ヌル", log_Reports);//子Expression要素数
                    tmpl.SetParameter(14, "ヌル", log_Reports);//子Expression要素リスト
                }

                tmpl.SetParameter(15, Log_RecordReportsImpl.ToText_Configuration(parent_Ec.Cur_Configuration), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7023;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_NullParent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7004;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #12
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Conf,
            Expressionv_4ADisplayImpl exprv_ADisplay,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(38)" + cur_Conf.Name);
            }

            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_5FAllTrueImpl cur_Exprv = new Expressionv_5FAllTrueImpl(exprv_ADisplay, cur_Conf, memoryApplication);


            //
            //
            //
            // 子
            //
            //
            //
            if (log_Reports.Successful)
            {
                exprv_ADisplay.List_Expression_Child.Add(
                    cur_Exprv,
                    log_Reports
                    );
            }


            //
            //
            //
            // 子
            //
            //
            //
            List <Configurationtree_Node> cfList_Fnc = cur_Conf.GetChildrenByNodename(NamesNode.S_FNC, false, log_Reports);

            foreach (Configurationtree_Node cf_Child in cfList_Fnc)
            {
                string child_SName_Fnc;
                cf_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out child_SName_Fnc, true, log_Reports);

                if (NamesFnc.S_VLD_EMPTY_FIELD == child_SName_Fnc)
                {
                    // <a-empty-field>要素
                    ConfigurationtreeToExpression_V55_AEmptyFieldImpl_ to = new ConfigurationtreeToExpression_V55_AEmptyFieldImpl_();
                    to.Translate(
                        cf_Child,
                        cur_Exprv,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else
                {
                    if (log_Method.CanDebug(0))
                    {
                        log_Method.WriteError_ToConsole("未実装です。");
                    }

                    throw new Exception("未実装です。");
                }
            }

            goto gt_EndMethod;
            //
            //
            //
            //
gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// <f-str>
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,//<f-str>
            Expression_Node_String parent_Ec,//親<●●>。
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(30)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            if (null == parent_Ec)
            {
                goto gt_Error_NullFAelem;
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String ec_Cur = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    ec_Cur,
                    false,//name属性は無い。
                    true,//value属性を、子<f-str>にする場合、真。
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    ec_Cur,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結 ※子連結が基本
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(ec_Cur, log_Reports);
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_NullFAelem:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7016;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// 
        /// </summary>
        /// <param name="s_cur"></param>
        /// <param name="e_parent"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,//Sf:case;
            Expression_Node_String parent_Expr,//Sf:switch;
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: このメソッドは廃止方針です。");

            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(8)"+cur_Cf.Name);
            }

            //
            //
            //
            //

            string parent_SName_Fnc;
            parent_Expr.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One, log_Reports);

            if (NamesFnc.S_SWITCH != parent_SName_Fnc)
            {
                goto gt_Error_Parent;
            }

            //
            // 親
            //
            Expression_SfswitchImpl parent_Expression_Fswitch = (Expression_SfswitchImpl)parent_Expr;

            //
            // 自
            //
            Expression_SfcaseImpl cur_Ec = (Expression_SfcaseImpl)Expression_SfcaseImpl.Create(parent_Expression_Fswitch, cur_Cf);

            //
            // 属性
            //
            {
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    true,//name属性は必須。
                    false,//value属性は無い。
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            Configurationtree_Node err_Child_Cf;
            {
                //
                // <fnc name=”Sf:case;”>
                //   <arg1 name=”caseValue” value=”★”>要素の value値を、nFallTrue に セット。
                //

                cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node child_Cf_Arg1, ref bool bBreak)
                {
                    if (
                        // <arg >
                        NamesNode.S_ARG == child_Cf_Arg1.Name
                        )
                    {
                        string sName_Child_Fnc;
                        child_Cf_Arg1.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Child_Fnc, true, log_Reports);

                        if (log_Method.CanDebug(1))
                        {
                            log_Method.WriteDebug_ToConsole( " ・" + child_Cf_Arg1.Name + " name=”[" + sName_Child_Fnc + "]”");
                        }

                        if (
                            //s_ChildArg1.Dictionary_Attribute.ContainsKey(PmNames.NAME.SAttrName) &&
                            // name=”caseValue”
                            PmNames.S_VALUE_CASE.Name_Pm == sName_Child_Fnc
                            )
                        {

                            //
                            // caseValueは、直接 value=""属性で指定されたものだけが有効です。子要素は指定できません。
                            //
                            if (child_Cf_Arg1.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE.Name_Pm))
                            {
                                log_Reports.Log_Callstack.Push(log_Method, "SToE②s_Cur→e_Cur");
                                this.ParseChild_InConfigurationtreeToExpression(
                                    cur_Cf, //Sf:case;
                                    cur_Ec,// e_Cur, e_Parent, //Sf:case;
                                    memoryApplication,
                                    pg_ParsingLog,
                                    log_Reports
                                    );
                                log_Reports.Log_Callstack.Pop(log_Method, "SToE②s_Cur→e_Cur");

                                //
                                // 最初のcaseValueのみ有効。
                                //
                                bBreak = true;
                            }
                            else
                            {
                                // エラー
                                err_Child_Cf = child_Cf_Arg1;
                                bBreak = true;
                                goto gt_Error_NotConstCaseValue;
                            }
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        if (log_Method.CanDebug(1))
                        {
                            log_Method.WriteDebug_ToConsole(" ・" + child_Cf_Arg1.Name);
                        }
                    }

                    goto gt_End2;
                //
                //
                gt_Error_NotConstCaseValue:
                    {
                        Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                        tmpl.SetParameter(1, PmNames.S_VALUE_CASE.Name_Pm, log_Reports);//ケース名
                        tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(err_Child_Cf), log_Reports);//設定位置パンくずリスト

                        memoryApplication.CreateErrorReport("Er:7017;", tmpl, log_Reports);
                    }
                    goto gt_End2;
                    //
                gt_End2:
                    ;
                });
            }

            //
            //
            //
            // 親
            //
            //
            //
            parent_Expression_Fswitch.List_Expression_Sfcase.Add(cur_Ec);

            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole( " ┌────┐ 子要素数=[" + cur_Cf.List_Child.Count + "]");
                cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node s_Child, ref bool bBreak)
                {
                    if (NamesNode.S_ARG == s_Child.Name)
                    {
                        string sName;
                        s_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName, true, log_Reports);
                        log_Method.WriteDebug_ToConsole( " ・" + s_Child.Name + " name=”[" + sName + "]”");
                    }
                    else
                    {
                        log_Method.WriteDebug_ToConsole( " ・" + s_Child.Name);
                    }
                });
                log_Method.WriteDebug_ToConsole( " └────┘");

                log_Method.WriteDebug_ToConsole(" ┌────┐ string属性数=[" + cur_Cf.Dictionary_Attribute.Count + "]");
                cur_Cf.Dictionary_Attribute.ForEach(delegate(string sKey, string sValue, ref bool bBreak)
                {
                    log_Method.WriteDebug_ToConsole( " s属 [" + sKey + "]=[" + sValue + "]");
                });
                log_Method.WriteDebug_ToConsole( " └────┘");

            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_Parent:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, parent_Expr.Cur_Configuration.Name, log_Reports);//親設定ノード名
                tmpl.SetParameter(2, parent_SName_Fnc, log_Reports);//親設定ノード関数名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7018;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public override void Translate(
            Configurationtree_Node cur_Cf,//<lookup-id>
            Expression_Node_String parent_Ec,//< Sf:text-template;>
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(9)" + cur_Cf.Name);
            }

            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            //
            //
            //
            // 親へ連結 (value属性)
            //
            //
            //
            {
                //
                // 自要素の value="" 属性を、親へ連結
                //
                PmName pmName = PmNames.S_VALUE;

                string sValue;
                bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                if (bHit)
                {

                    cur_Ec.AppendTextNode(
                        sValue,
                        cur_Cf,
                        log_Reports
                        );

                    //
                    //
                    //
                    // 子
                    //
                    //
                    //
                    this.ParseChild_InConfigurationtreeToExpression(
                        cur_Cf,
                        cur_Ec,//自
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );

                    //
                    //
                    //
                    // 親へ連結 ※属性連結
                    //
                    //
                    //
                    parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports);

                    goto gt_EndMethod;
                }
                else
                {
                }

            }

            //
            //
            //
            // 子
            //
            //
            //
            {
                //<a-default>の子要素を確認し、親<f-switch>のdefault属性に追加します。

                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports);

            //
            //
            //
            // 親へ連結 debug
            //
            //
            //
            if (log_Method.CanDebug(1))
            {
                string parent_SName_Fnc;
                parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 親<[" + parent_Ec.Cur_Configuration.Name + "] name=”[" + parent_SName_Fnc + "]” >");

                string sName_MyFnc;
                cur_Ec.TrySelectAttribute(out sName_MyFnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 自<[" + cur_Ec.Cur_Configuration.Name + "] name=”[" + sName_MyFnc + "]” >");
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// <f-param>
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,//<f-param>
            Expression_Node_String parent_Ec,//親<●●>要素。汎用。
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(28)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_FparamImpl cur_Ec = new Expression_FparamImpl(parent_Ec, cur_Cf, memoryApplication);

            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 非必須 call=”” call属性がなくても正常です。子要素を見に行きます。
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    false,//name属性は無い。
                    true,//valueは子f-strに変換。
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            {
                // 子<●●> TODO:子call属性要素。
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }
            //ystem.Console.WriteLine(this.GetType().Name + "#SToE: ──────────属性ここまで");

            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);
            }

            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #17
0
        //────────────────────────────────────────

        public override void Translate(
            Configurationtree_Node cur_Cf,
            Expression_Node_String parent_Ec,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            // throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: このメソッドは廃止方針です。");

            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(18)" + cur_Cf.Name);
            }

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String ec_Value;
            {
                ec_Value = new Expression_Node_StringImpl(parent_Ec, cur_Cf);
                ec_Value.AppendTextNode(
                    cur_Cf.Name,
                    cur_Cf,
                    log_Reports
                    );
            }



            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_StringImpl ec_Ap1p = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            ec_Ap1p.SetAttribute(
                PmNames.S_NAME.Name_Pm,
                ec_Value,
                log_Reports
                );

            StringBuilder sb = new StringBuilder();

            sb.Append("p");
            sb.Append(this.NP1p);
            sb.Append("p");



            //
            //
            //
            // 属性
            //
            //
            //
            parent_Ec.SetAttribute(
                sb.ToString(),
                ((Expression_Node_String)ec_Ap1p),
                log_Reports
                );


            //
            // 子要素
            //
            this.ParseChild_InConfigurationtreeToExpression(
                cur_Cf,
                ec_Ap1p,
                memoryApplication,
                pg_ParsingLog,
                log_Reports
                );

            goto gt_EndMethod;
            //
            //
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #18
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Cf,      //<a-empty-field>
            Expression_Node_String parent_Expr, //Expressionv_5FAllTrueImpl
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(39)" + cur_Cf.Name);
            }

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_6AEmptyFieldImpl ecv_AEmptyFld = new Expressionv_6AEmptyFieldImpl(parent_Expr, cur_Cf, memoryApplication);


            //
            //
            //
            // 属性
            //
            //
            //
            {
                {
                    PmName pmName = PmNames.S_TYPE;
                    string sValue;
                    bool   bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        Expression_Leaf_String ec_Leaf = new Expression_Leaf_StringImpl(sValue, parent_Expr, cur_Cf);
                        ecv_AEmptyFld.SetAttribute(pmName.Name_Pm, ec_Leaf, log_Reports);
                        //evAEmptyFld.Dictionary_SAttribute.Add(sAttrName, s_Cur.SAttrDic.Get(sAttrName, true, log_Reports));
                    }
                    else
                    {
                        // クリアー上書きしない。
                    }
                }

                {
                    PmName pmName = PmNames.S_DESCRIPTION;
                    string sValue;
                    bool   bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        Expression_Leaf_String ec_Leaf = new Expression_Leaf_StringImpl(sValue, parent_Expr, cur_Cf);
                        ecv_AEmptyFld.SetAttribute(pmName.Name_Pm, ec_Leaf, log_Reports);
                    }
                    else
                    {
                        // クリアー上書きしない。
                    }
                }
            }


            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                // TODO:?
                parent_Expr.List_Expression_Child.Add(ecv_AEmptyFld, log_Reports);
            }


            //
            //
            //
            // 子
            //
            //
            //
            {
                // <f-cell>要素のリスト
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    ecv_AEmptyFld,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            goto gt_EndMethod;
            //
            //
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// 「S■f-var」
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,//「S■f-var」
            Expression_Node_String parent_Ec,//親<●●>
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(33)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_FvarImpl cur_Ec = new Expression_FvarImpl(parent_Ec, cur_Cf, memoryApplication);

            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    false,//name属性は無い。
                    false,//value属性は、子<f-str>にしない。
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            {
                // 非必須 value=”” value属性がなくても正常です。子要素を見に行きます。
                if (cur_Cf.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE.Name_Pm))
                {
                    string sValue;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sValue, true, log_Reports);
                    cur_Ec.AppendTextNode(
                        sValue,
                        cur_Cf,
                        log_Reports
                        );
                }
            }

            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(
                    cur_Ec,
                    log_Reports
                    );
            }

            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #20
0
        //────────────────────────────────────────

        /// <summary>
        /// S → E
        ///
        /// データソース、
        /// データターゲット、
        /// <view>
        /// の3つを変換。
        /// </summary>
        /// <param oNodeName="sList_Name_Control"></param>
        /// <param oNodeName="s_FcConfig"></param>
        /// <param oNodeName="moOpyopyo"></param>
        /// <param oNodeName="log_Reports"></param>
        public void Translate(
            List <string> sList_Name_Control,
            Configurationtree_Node cf_FcConfig,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: このメソッドは廃止方針です。");

            //
            //
            //
            // デバッグ開始
            //
            //
            //
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE_DsrcDtrg", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(1)データソース・データターゲット・SSR");
            }

            //
            //
            //
            //

            string sName_Usercontrol;

            if (log_Reports.Successful)
            {
                // 正常時

                foreach (string sFcName in sList_Name_Control)
                {
                    // コントロール名。
                    Expression_Node_StringImpl ec_FcName = new Expression_Node_StringImpl(null, cf_FcConfig);
                    ec_FcName.AppendTextNode(
                        sFcName,
                        cf_FcConfig,
                        log_Reports
                        );


                    // コントロール名の指定は、1件のみと想定。
                    List <Usercontrol> list_Usercontrol = memoryApplication.MemoryForms.GetUsercontrolsByName(
                        ec_FcName,
                        true,
                        log_Reports
                        );

                    Usercontrol fcUc;
                    if (list_Usercontrol.Count < 1)
                    {
                        sName_Usercontrol = sFcName;
                        goto gt_Error_NotFoundUsercontrol;
                    }
                    else
                    {
                        fcUc = list_Usercontrol[0];
                    }



                    Configurationtree_Node cf_Control = fcUc.ControlCommon.Configurationtree_Control;

                    if (null == cf_Control)
                    {
                        //
                        // O_コントロール要素を新規作成。
                        cf_Control = new Configurationtree_NodeImpl(NamesNode.S_CONTROL1, cf_FcConfig);
                        fcUc.ControlCommon.Configurationtree_Control = cf_Control;
                    }
                    else
                    {
                        //
                        // O_コントロール要素は既存。
                    }


                    //
                    // コントロール名。
                    fcUc.ControlCommon.Configurationtree_Control.Dictionary_Attribute.Set(PmNames.S_NAME.Name_Pm, sFcName, log_Reports);


                    ConfigurationtreeToExpression_F11_ControlImpl_ to0 = new ConfigurationtreeToExpression_F11_ControlImpl_();
                    to0.Translate(
                        cf_Control,
                        fcUc.ControlCommon.Expression_Control,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
            }
            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NotFoundUsercontrol:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sName_Usercontrol, log_Reports);                                       //コントロール名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(cf_FcConfig), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7001;", tmpl, log_Reports);
            }

            // 処理を中断。
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement("データソース・データターゲット・SSR");
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Conf,//Sv_3FListboxValidation
            UsercontrolListbox uctLst,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(34)" + cur_Conf.Name);
            }

            //
            //

            // バリデーター設定要素
            Configurationtree_Node cf_ValidatorConfig;
            {
                List<Configurationtree_Node> cfList_ValidatorConfig = uctLst.ControlCommon.Configurationtree_Control.GetChildrenByNodename(NamesNode.S_CODEFILE_VALIDATORS, false, log_Reports);

                if (1 < cfList_ValidatorConfig.Count)
                {
                    throw new Exception("バリデーター設定要素が2つ以上ありました。");
                }
                else if (0 < cfList_ValidatorConfig.Count)
                {
                    cf_ValidatorConfig = cfList_ValidatorConfig[0];
                }
                else
                {
                    cf_ValidatorConfig = null;
                }
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_3FListboxValidationImpl cur_Exprv = new Expressionv_3FListboxValidationImpl(null, cf_ValidatorConfig, memoryApplication);

            //
            //
            //
            // 子
            //
            //
            //
            List<Configurationtree_Node> cfList_Fnc = cur_Conf.GetChildrenByNodename(NamesNode.S_FNC, false, log_Reports);

            // #デバッグ中
            //d_InMethod.WriteDebug_ToConsole(1, " <a-display>数=[" + sv_Cur.Sv_ADisplayList.Count + "]");
            //d_InMethod.WriteDebug_ToConsole(1, " <fnc name=”a-record-set-save-to”>数=[" + sv_Cur.Sv_ASelectRecordList.Count + "]");

            foreach (Configurationtree_Node child_Cf in cfList_Fnc)
            {
                string sName_Fnc;
                child_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, true, log_Reports);

                if (NamesFnc.S_VLD_SELECT_RECORD == sName_Fnc)
                {
                    ConfigurationtreeToExpression_V53_ASelectRecordImpl_ to = new ConfigurationtreeToExpression_V53_ASelectRecordImpl_();
                    to.Translate(
                        child_Cf,
                        cur_Exprv,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else if (NamesFnc.S_VLD_DISPLAY == sName_Fnc)
                {
                    // <a-display>要素
                    ConfigurationtreeToExpression_V53_ADisplayImpl_ to = new ConfigurationtreeToExpression_V53_ADisplayImpl_();
                    to.Translate(
                        child_Cf,
                        cur_Exprv,
                        uctLst,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else
                {
                    log_Method.WriteError_ToConsole("未実装です。");
                    throw new Exception("未実装です。");
                }
            }

            goto gt_EndMethod;

            //
            //
            //
            //
            gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// S → E
        /// 
        /// データソース、
        /// データターゲット、
        /// <view>
        /// の3つを変換。
        /// </summary>
        /// <param oNodeName="sList_Name_Control"></param>
        /// <param oNodeName="s_FcConfig"></param>
        /// <param oNodeName="moOpyopyo"></param>
        /// <param oNodeName="log_Reports"></param>
        public void Translate(
            List<string> sList_Name_Control,
            Configurationtree_Node cf_FcConfig,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            //throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: このメソッドは廃止方針です。");

            //
            //
            //
            // デバッグ開始
            //
            //
            //
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE_DsrcDtrg",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(1)データソース・データターゲット・SSR");
            }

            //
            //
            //
            //

            string sName_Usercontrol;
            if (log_Reports.Successful)
            {
                // 正常時

                foreach(string sFcName in sList_Name_Control)
                {
                    // コントロール名。
                    Expression_Node_StringImpl ec_FcName = new Expression_Node_StringImpl(null,cf_FcConfig);
                    ec_FcName.AppendTextNode(
                        sFcName,
                        cf_FcConfig,
                        log_Reports
                        );

                    // コントロール名の指定は、1件のみと想定。
                    List<Usercontrol> list_Usercontrol = memoryApplication.MemoryForms.GetUsercontrolsByName(
                        ec_FcName,
                        true,
                        log_Reports
                        );

                    Usercontrol fcUc;
                    if (list_Usercontrol.Count<1)
                    {
                        sName_Usercontrol = sFcName;
                        goto gt_Error_NotFoundUsercontrol;
                    }
                    else
                    {
                        fcUc = list_Usercontrol[0];
                    }

                    Configurationtree_Node cf_Control = fcUc.ControlCommon.Configurationtree_Control;

                    if (null == cf_Control)
                    {
                        //
                        // O_コントロール要素を新規作成。
                        cf_Control = new Configurationtree_NodeImpl(NamesNode.S_CONTROL1, cf_FcConfig);
                        fcUc.ControlCommon.Configurationtree_Control = cf_Control;
                    }
                    else
                    {
                        //
                        // O_コントロール要素は既存。
                    }

                    //
                    // コントロール名。
                    fcUc.ControlCommon.Configurationtree_Control.Dictionary_Attribute.Set(PmNames.S_NAME.Name_Pm, sFcName, log_Reports);

                    ConfigurationtreeToExpression_F11_ControlImpl_ to0 = new ConfigurationtreeToExpression_F11_ControlImpl_();
                    to0.Translate(
                        cf_Control,
                        fcUc.ControlCommon.Expression_Control,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
            }
            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_NotFoundUsercontrol:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, sName_Usercontrol, log_Reports);//コントロール名
                tmpl.SetParameter(2, Log_RecordReportsImpl.ToText_Configuration(cf_FcConfig), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7001;", tmpl, log_Reports);
            }

            // 処理を中断。
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement("データソース・データターゲット・SSR");
            }
            log_Method.EndMethod(log_Reports);
        }
Example #23
0
        //────────────────────────────────────────

        /// <summary>
        /// <arg1>
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,    //「S■arg1」
            Expression_Node_String parent_Ec, //親「E■fnc」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            //
            // デバッグオープンの前に。
            //
            // 「S■arg1 name=”★”」属性
            //
            string sName_MyFnc;

            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_MyFnc, false, log_Reports);

            if (log_Method.CanDebug(1))
            {
                Dictionary <string, string> s_Dic = new Dictionary <string, string>();
                s_Dic.Add(PmNames.S_NAME.Name_Pm, sName_MyFnc);
                pg_ParsingLog.Increment("(6.arg1・3要素)" + cur_Cf.Name, s_Dic);
            }

            //
            //

            if (log_Method.CanDebug(2))
            {
                log_Method.WriteDebug_ToConsole("「S■arg1・3」要素 解析開始┌────────────────┐ 自arg1・3は、e_Parent=[" + parent_Ec.Cur_Configuration.Name + "]の”" + sName_MyFnc + "”属性になる。");
            }


            string parent_SName_Fnc;
            {
                // ヒット必須にするとエラーになる?
                parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                if (!log_Reports.Successful)
                {
                    goto gt_EndMethod;
                }

                //if (0 < d_InMethod.NDebugLevel)
                //{
                //    if (NamesNode.S_FNC != e_Parent.Cur_Configurationtree.Name)
                //    {
                //        d_InMethod.WriteDebug_ToConsole(1, "fnc以外の親要素「E■[" + e_Parent.Cur_Configurationtree.Name + "]」");
                //    }
                //}
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);


            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 元からあった。
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    true, //name属性は必須。
                    true, //value属性は、子<f-str>にする。
                    log_Reports
                    );
            }


            //
            //
            //
            // 子
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }



            //
            //
            //
            // 親へ連結 ※属性連結。
            //
            //
            //
            if (log_Reports.Successful)
            {
                parent_Ec.SetAttribute(sName_MyFnc, cur_Ec, log_Reports);
            }

            goto gt_EndMethod;
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }

            if (log_Method.CanDebug(2))
            {
                log_Method.WriteDebug_ToConsole("「S■arg1・3」要素 解析終了└────────────────┘");
            }

            log_Method.EndMethod(log_Reports);
        }
Example #24
0
        //────────────────────────────────────────

        /// <summary>
        /// 読取。
        /// </summary>
        /// <param name="s_View"></param>
        /// <param name="ef_View"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public void Translate(
            Configurationtree_Node cur_Cf,    //<view>
            Expression_Node_String parent_Ec, //「E■form-component」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(3)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //

            Expression_Node_StringImpl cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            //
            //
            //
            // 子
            //
            //
            //
            {
                //<●●>要素を全検索。<f-list-box-labels>があることが期待されます。

                cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node cf_Child, ref bool bBreak)
                {
                    if (cf_Child is Configurationtree_Node)
                    {
                        Configurationtree_Node cf_Node = (Configurationtree_Node)cf_Child;

                        string sName_Node = cf_Node.Name;
                        string sName_Fnc  = "";
                        {
                            bool bRequired;

                            if (NamesNode.S_FNC == sName_Node)
                            {
                                bRequired = true;
                            }
                            else
                            {
                                bRequired = false;
                            }

                            // todo; 子要素のnameも取りたい。
                            cf_Node.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, bRequired, log_Reports);
                        }

                        if (NamesNode.S_FNC == sName_Node && NamesFnc.S_LISTBOX_LABELS == sName_Fnc)
                        {
                            // 「S■fnc name=”Sf:f-listbox-labels;”」

                            ConfigurationtreeToExpression_F91_FListboxLabelsImpl_ to = new ConfigurationtreeToExpression_F91_FListboxLabelsImpl_();
                            to.Translate(
                                cf_Child,
                                cur_Ec,
                                memoryApplication,
                                pg_ParsingLog,
                                log_Reports
                                );
                        }
                        else
                        {
                            // エラー
                            {
                                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                                tmpl.SetParameter(1, sName_Node, log_Reports); //設定ノード名
                                tmpl.SetParameter(2, sName_Fnc, log_Reports);  //関数名

                                memoryApplication.CreateErrorReport("Er:7003;", tmpl, log_Reports);
                            }

                            bBreak = true;
                        }
                    }
                });
            }


            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);
            }


            goto gt_EndMethod;
            //
            //

gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// <data>要素の読取。
        /// </summary>
        /// <param select="xDataSource"></param>
        /// <param select="fcUc"></param>
        public void Translate(
            Configurationtree_Node cur_Cf,//<data>要素
            Expression_Node_String parent_Ec,//「S■form-component」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "CfToEc",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(2)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_NodeImpl cur_Ec = new Expression_NodeImpl(parent_Ec, cur_Cf, memoryApplication);

            //
            //
            //
            // 属性
            //
            //
            //
            string err_SAttrName;
            cur_Cf.Dictionary_Attribute.ForEach(delegate(string sPmName, string sValue, ref bool bBreak)
            {
                if (
                    PmNames.S_MEMORY.Name_Pm == sPmName ||
                    PmNames.S_ACCESS.Name_Pm == sPmName ||
                    PmNames.S_NAME_TABLE.Name_Pm == sPmName ||
                    PmNames.S_NAME_VAR.Name_Pm == sPmName || //.Z_ITEM_VALUE_TO_VARIABLE
                    PmNames.S_DESCRIPTION.Name_Pm == sPmName
                    )
                {
                    //ystem.Console.WriteLine(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: <データT >に属性追加 [" + sKey + "]←[" + sValue + "]");

                    // なんでも属性として追加。
                    Expression_Node_String ec_Value = new Expression_Leaf_StringImpl(sValue, cur_Ec, cur_Cf);
                    cur_Ec.SetAttribute(sPmName, ec_Value, log_Reports);
                }
                else
                {
                    err_SAttrName = sPmName;
                    bBreak = true;
                    goto gt_Error_UndefinedAttr;
                }

                goto gt_gt_EndMethod2;
                //
                //
                //
                //
            gt_Error_UndefinedAttr:
                {
                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                    tmpl.SetParameter(1, cur_Cf.Name, log_Reports);//設定ノード名
                    tmpl.SetParameter(2, err_SAttrName, log_Reports);//属性名
                    tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                    memoryApplication.CreateErrorReport("Er:7002;", tmpl, log_Reports);
                }
                goto gt_gt_EndMethod2;

            gt_gt_EndMethod2:
                ;
            });

            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }

            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Cf,//<a-select-record>
            Expressionv_3FListboxValidationImpl parent_Exprv,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(36)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_4ASelectRecordImpl cur_Exprv = new Expressionv_4ASelectRecordImpl(parent_Exprv, cur_Cf, memoryApplication);

            //
            //
            //
            // 属性
            //
            //
            //
            {
                {
                    PmName pmName = PmNames.S_FIELD_KEY;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Field = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_VALUE_KEY;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_LookupVal = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_REQUIRED;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Required = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_FROM;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_From = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_STORAGE;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Storage = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_DESCRIPTION;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Description = ec_Str;
                    }
                }

            }//属性

            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Exprv.List_Expressionv_ASelectRecord.Add(cur_Exprv);//.Add(nA66, EnumHitcount.Unconstraint, log_Reports);

            //
            //
            //
            // 子
            //
            //
            //
            {
                // <f-cell>要素のリスト
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Exprv,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            goto gt_EndMethod;
            //
            //
            //
            //
            gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void ConfigurationtreeToUsercontrol(
            Configurationtree_Node cur_Cf,//Sv_3Validator <validator>
            Usercontrol ucontrol,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToFc",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(41)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            string err_SParameterValue = null;
            Exception err_Excp = null;
            string err_SValue = null;
            string err_SName_Validator = null;

            EnumValidation_Old enumResult = EnumValidation_Old.Thru;

            if (cur_Cf.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE_RESULT.Name_Pm))
            {
                string sValue_Parameter;
                cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE_RESULT, out sValue_Parameter, true, log_Reports);
                switch (sValue_Parameter)
                {
                    case "OK":
                        enumResult = EnumValidation_Old.Ok;
                        break;
                    case "NG":
                        enumResult = EnumValidation_Old.Ng;
                        break;
                    case "THRU":
                        enumResult = EnumValidation_Old.Thru;
                        break;
                    default:
                        //
                        // エラー。
                        goto gt_Error_UndefinedValidator02;
                }
            }

            string sName;
            string sName_ValidatorTrim;
            {
                PmName pmName = PmNames.S_NAME;
                if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                {
                    cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sName, true, log_Reports);
                    sName_ValidatorTrim = sName.Trim();
                }
                else
                {
                    sName = "";
                    sName_ValidatorTrim = "";
                }
            }

            //
            // バリデーターの選択
            switch (sName_ValidatorTrim)
            {
                case NamesFnc.S_VLD_SPACES:
                    {
                        // SToE:
                        Expressionv_SpacesTextValidator_Old nValidator = new Expressionv_SpacesTextValidator_Old(enumResult);

                        ucontrol.AddValidator(
                            nValidator,
                            log_Reports
                            );
                    }
                    break;

                case NamesFnc.S_VLD_MATCH:
                    {
                        string sValue_Parameter;
                        cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_EXPECTED, out sValue_Parameter, false, log_Reports);
                        err_SParameterValue = sValue_Parameter;

                        // SToE:
                        Expressionv_MatchTextValidator_Old ecv_Validator = new Expressionv_MatchTextValidator_Old(sValue_Parameter);

                        ucontrol.AddValidator(
                            ecv_Validator,
                            log_Reports
                            );
                    }
                    break;

                case NamesFnc.S_VLD_INT_RANGE:
                    {
                        bool bSuccessful = true;
                        int nBeginValue = 0;
                        if (bSuccessful)
                        {
                            string sBegin;
                            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_BEGIN, out sBegin, false, log_Reports);

                            if (!int.TryParse(sBegin, out nBeginValue))
                            {
                                // エラー。
                                err_Excp = null;
                                err_SValue = sBegin;
                                goto gt_Error_InvalidatedBegin02;
                            }
                        }

                        int nEndValue = 0;
                        if (bSuccessful)
                        {
                            string sEnd;
                            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_END, out sEnd, false, log_Reports);

                            if (!int.TryParse(sEnd, out nEndValue))
                            {
                                // エラー。
                                err_Excp = null;
                                err_SValue = sEnd;
                                goto gt_Error_InvalidatedEnd02;
                            }
                        }

                        if (bSuccessful)
                        {
                            // SToE:
                            Expressionv_IntRangeTextValidator_Old nValidator = new Expressionv_IntRangeTextValidator_Old(nBeginValue, nEndValue);

                            ucontrol.AddValidator(
                                nValidator,
                                log_Reports
                                );
                        }
                    }
                    break;

                case NamesFnc.S_VLD_ALL:
                    {
                        // SToE:
                        Expressionv_AllTextValidator_Old ecv_Validator = new Expressionv_AllTextValidator_Old(enumResult);

                        ucontrol.AddValidator(
                            ecv_Validator,
                            log_Reports
                            );
                    }
                    break;

                default:
                    //
                    // エラー。
                    err_SName_Validator = sName;
                    goto gt_Error_UndefinedValidator03;
            }//switch

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_UndefinedValidator02:
            // TODO 未定義のバリデーターの場合。
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_VALUE_RESULT.Name_Pm, log_Reports);//引数名
                tmpl.SetParameter(2, err_SParameterValue, log_Reports);//バリデーター名

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7012;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_InvalidatedBegin02:
            // 設定エラー
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_BEGIN.Name_Pm, log_Reports);//属性名
                tmpl.SetParameter(2, err_SValue, log_Reports);//属性値
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);//例外メッセージ

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7013;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_InvalidatedEnd02:
            // 設定エラー
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, PmNames.S_END.Name_Pm, log_Reports);//属性名
                tmpl.SetParameter(2, err_SValue, log_Reports);//属性値
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Exception(err_Excp), log_Reports);//例外メッセージ

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7014;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            gt_Error_UndefinedValidator03:
            // TODO 未定義のバリデーターの場合。
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_SName_Validator, log_Reports);//バリデーター名

                ucontrol.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:7015;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #28
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Cf,
            Expressionv_3FListboxValidationImpl parent_Exprv,
            UsercontrolListbox uctLst,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(35)" + cur_Cf.Name);
            }

            //
            //

            string err_Child_SName_Node             = "";
            string err_Parent_SName_Node            = "";
            Configurationtree_Node err_Child_CfNode = null;



            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_4ADisplayImpl cur_Exprv = new Expressionv_4ADisplayImpl(parent_Exprv, cur_Cf, memoryApplication);


            //
            //
            //
            // 属性
            //
            //
            //
            {
                {
                    PmName pmName = PmNames.S_TYPE;
                    string sValue;
                    bool   bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        cur_Exprv.Dictionary_SAttribute.Add(pmName.Name_Pm, sValue);
                    }
                }

                {
                    PmName pmName = PmNames.S_DESCRIPTION;
                    string sValue;
                    bool   bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        cur_Exprv.Dictionary_SAttribute.Add(pmName.Name_Pm, sValue);
                    }
                }
            }

            parent_Exprv.List_Expressionv_ADisplay.Add(cur_Exprv);
            uctLst.AddValidator_FListboxForItems(parent_Exprv, log_Reports);

            // #デバッグ中
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" 子<f-●●>数=[" + cur_Cf.List_Child.Count + "]");
            }

            //
            //
            //
            // 子
            //
            //
            //
            cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node child_Cf, ref bool bBreak)
            {
                if (child_Cf is Configurationtree_Node)
                {
                    Configurationtree_Node child_Configurationtree_Node = (Configurationtree_Node)child_Cf;

                    string sName_Fnc;
                    child_Configurationtree_Node.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, false, log_Reports);

                    if (NamesFnc.S_VLD_ALL_FIELDS_IS_EMPTY == sName_Fnc)
                    {
                        //
                        // <f-all-fields-is-empty>要素
                        ConfigurationtreeToExpression_V54_FAllFieldsIsEmptyImpl_ to = new ConfigurationtreeToExpression_V54_FAllFieldsIsEmptyImpl_();
                        to.Translate(
                            child_Configurationtree_Node,
                            cur_Exprv,
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );
                    }
                    else if (NamesFnc.S_ALL_TRUE == sName_Fnc)
                    {
                        //
                        // <f-all-true>要素
                        ConfigurationtreeToExpression_V54_FAllTrueImpl_ to = new ConfigurationtreeToExpression_V54_FAllTrueImpl_();
                        to.Translate(
                            child_Configurationtree_Node,
                            cur_Exprv,
                            memoryApplication,
                            pg_ParsingLog,
                            log_Reports
                            );
                    }
                    else
                    {
                        //
                        // エラー。
                        err_Child_SName_Node  = child_Configurationtree_Node.Name;
                        err_Parent_SName_Node = cur_Cf.Name;
                        err_Child_CfNode      = child_Configurationtree_Node;
                        bBreak = true;
                    }
                }
            });
            if (null != err_Child_SName_Node)
            {
                goto undefined_element;
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
undefined_element:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, err_Child_SName_Node, log_Reports);                                         //子設定ノード名
                tmpl.SetParameter(2, err_Parent_SName_Node, log_Reports);                                        //親設定ノード名
                tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(err_Child_CfNode), log_Reports); //設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7020;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Conf,
            Expression_Node_String parent_Expr,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(40)" + cur_Conf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String ec_Value = new Expression_Node_StringImpl(parent_Expr, cur_Conf);
            ec_Value.AppendTextNode(
                cur_Conf.Name,
                cur_Conf,
                log_Reports
                );

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_StringImpl cur_Expr = new Expression_Node_StringImpl(parent_Expr, cur_Conf);

            //
            //
            //
            // 属性
            //
            //
            //
            {
                cur_Expr.SetAttribute(
                    PmNames.S_NAME.Name_Pm,
                    ec_Value,
                    log_Reports
                    );

                parent_Expr.SetAttribute(
                    NamesNode.S_RECORD_SET_LOAD_FROM,
                    ((Expression_Node_String)cur_Expr),
                    log_Reports
                    );
            }

            //
            //
            //
            // 子要素
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Conf,
                    cur_Expr,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }

            log_Method.EndMethod(log_Reports);
        }
Example #30
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Cf,//<a-select-record>
            Expressionv_3FListboxValidationImpl parent_Exprv,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(36)" + cur_Cf.Name);
            }

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_4ASelectRecordImpl cur_Exprv = new Expressionv_4ASelectRecordImpl(parent_Exprv, cur_Cf, memoryApplication);


            //
            //
            //
            // 属性
            //
            //
            //
            {
                {
                    PmName pmName = PmNames.S_FIELD_KEY;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Field = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_VALUE_KEY;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_LookupVal = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_REQUIRED;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Required = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_FROM;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_From = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_STORAGE;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Storage = ec_Str;
                    }
                }

                {
                    PmName pmName = PmNames.S_DESCRIPTION;
                    if (cur_Cf.Dictionary_Attribute.ContainsKey(pmName.Name_Pm))
                    {
                        string sValue;
                        cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, true, log_Reports);

                        Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(parent_Exprv, cur_Cf);
                        ec_Str.AppendTextNode(
                            sValue,
                            cur_Cf,
                            log_Reports
                            );
                        cur_Exprv.Expression_Description = ec_Str;
                    }
                }
            }//属性


            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Exprv.List_Expressionv_ASelectRecord.Add(cur_Exprv);//.Add(nA66, EnumHitcount.Unconstraint, log_Reports);


            //
            //
            //
            // 子
            //
            //
            //
            {
                // <f-cell>要素のリスト
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Exprv,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            goto gt_EndMethod;
            //
            //
            //
            //
gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #31
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Conf,//Sv_3FListboxValidation
            UsercontrolListbox uctLst,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(34)" + cur_Conf.Name);
            }

            //
            //

            // バリデーター設定要素
            Configurationtree_Node cf_ValidatorConfig;
            {
                List <Configurationtree_Node> cfList_ValidatorConfig = uctLst.ControlCommon.Configurationtree_Control.GetChildrenByNodename(NamesNode.S_CODEFILE_VALIDATORS, false, log_Reports);

                if (1 < cfList_ValidatorConfig.Count)
                {
                    throw new Exception("バリデーター設定要素が2つ以上ありました。");
                }
                else if (0 < cfList_ValidatorConfig.Count)
                {
                    cf_ValidatorConfig = cfList_ValidatorConfig[0];
                }
                else
                {
                    cf_ValidatorConfig = null;
                }
            }



            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_3FListboxValidationImpl cur_Exprv = new Expressionv_3FListboxValidationImpl(null, cf_ValidatorConfig, memoryApplication);

            //
            //
            //
            // 子
            //
            //
            //
            List <Configurationtree_Node> cfList_Fnc = cur_Conf.GetChildrenByNodename(NamesNode.S_FNC, false, log_Reports);

            // #デバッグ中
            //d_InMethod.WriteDebug_ToConsole(1, " <a-display>数=[" + sv_Cur.Sv_ADisplayList.Count + "]");
            //d_InMethod.WriteDebug_ToConsole(1, " <fnc name=”a-record-set-save-to”>数=[" + sv_Cur.Sv_ASelectRecordList.Count + "]");

            foreach (Configurationtree_Node child_Cf in cfList_Fnc)
            {
                string sName_Fnc;
                child_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, true, log_Reports);

                if (NamesFnc.S_VLD_SELECT_RECORD == sName_Fnc)
                {
                    ConfigurationtreeToExpression_V53_ASelectRecordImpl_ to = new ConfigurationtreeToExpression_V53_ASelectRecordImpl_();
                    to.Translate(
                        child_Cf,
                        cur_Exprv,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else if (NamesFnc.S_VLD_DISPLAY == sName_Fnc)
                {
                    // <a-display>要素
                    ConfigurationtreeToExpression_V53_ADisplayImpl_ to = new ConfigurationtreeToExpression_V53_ADisplayImpl_();
                    to.Translate(
                        child_Cf,
                        cur_Exprv,
                        uctLst,
                        memoryApplication,
                        pg_ParsingLog,
                        log_Reports
                        );
                }
                else
                {
                    log_Method.WriteError_ToConsole("未実装です。");
                    throw new Exception("未実装です。");
                }
            }


            goto gt_EndMethod;


            //
            //
            //
            //
gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #32
0
        //────────────────────────────────────────

        /// <summary>
        /// <f-param>
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,    //<f-param>
            Expression_Node_String parent_Ec, //親<●●>要素。汎用。
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(28)" + cur_Cf.Name);
            }

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expression_FparamImpl cur_Ec = new Expression_FparamImpl(parent_Ec, cur_Cf, memoryApplication);


            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 非必須 call=”” call属性がなくても正常です。子要素を見に行きます。
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    false, //name属性は無い。
                    true,  //valueは子f-strに変換。
                    log_Reports
                    );
            }


            //
            //
            //
            // 子
            //
            //
            //
            {
                // 子<●●> TODO:子call属性要素。
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }
            //ystem.Console.WriteLine(this.GetType().Name + "#SToE: ──────────属性ここまで");


            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);
            }

            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #33
0
        //────────────────────────────────────────

        /// <summary>
        /// S → E。
        /// </summary>
        public void Translate(
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(41)バリデーションファイル");
            }

            //
            //
            //
            //

            if (log_Reports.Successful)
            {
                //
                // コントロール順
                memoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct, ref bool bRemove, ref bool bBreak)
                {
                    if (uct is UsercontrolListbox)
                    {
                        //
                        // リストボックスなら。
                        UsercontrolListbox uctLst = (UsercontrolListbox)uct;

                        List <Configurationtree_Node> cfList_ValidatorConfig = uctLst.ControlCommon.Configurationtree_Control.GetChildrenByNodename(NamesNode.S_CODEFILE_VALIDATORS, false, log_Reports);
                        if (1 < cfList_ValidatorConfig.Count)
                        {
                            throw new Exception("バリデーター設定要素が2つ以上ありました。");
                        }
                        else if (0 < cfList_ValidatorConfig.Count)
                        {
                            Configurationtree_Node cf_ValidatorConfig = cfList_ValidatorConfig[0];

                            // (Sv)コントロールのSv
                            {
                                ConfigurationtreeToExpression_V52_FListboxValidationImpl_ to = new ConfigurationtreeToExpression_V52_FListboxValidationImpl_();

                                List <Configurationtree_Node> cfList_Validation = cf_ValidatorConfig.GetChildrenByNodename(NamesNode.S_F_LISTBOX_VALIDATION, false, log_Reports);

                                foreach (Configurationtree_Node child_Cf in cfList_Validation)
                                {
                                    //
                                    // <f-list-box-validation>
                                    to.Translate(
                                        child_Cf,
                                        uctLst,
                                        memoryApplication,
                                        pg_ParsingLog,
                                        log_Reports
                                        );
                                }//foreach
                            }

                            {
                                ConfigurationtreeToUsercontrol_V52_ValidatorImpl_ to = new ConfigurationtreeToUsercontrol_V52_ValidatorImpl_();

                                List <Configurationtree_Node> cfList_Validator = cf_ValidatorConfig.GetChildrenByNodename(NamesNode.S_VALIDATOR, false, log_Reports);
                                foreach (Configurationtree_Node cf in cfList_Validator)
                                {
                                    to.ConfigurationtreeToUsercontrol(
                                        cf,
                                        uct,
                                        pg_ParsingLog,
                                        log_Reports
                                        );
                                }
                            }
                        }//Ov
                    }
                    else
                    {
                    }
                });
            }

            goto gt_EndMethod;


            //
            //
            //
            //
gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement("(41)バリデーションファイル");
            }
            log_Method.EndMethod(log_Reports);
        }
Example #34
0
        //────────────────────────────────────────

        /// <summary>
        /// <f-str>
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,    //<f-str>
            Expression_Node_String parent_Ec, //親<●●>。
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(30)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            if (null == parent_Ec)
            {
                goto gt_Error_NullFAelem;
            }


            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String ec_Cur = new Expression_Node_StringImpl(parent_Ec, cur_Cf);


            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    ec_Cur,
                    false, //name属性は無い。
                    true,  //value属性を、子<f-str>にする場合、真。
                    log_Reports
                    );
            }


            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    ec_Cur,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }


            //
            //
            //
            // 親へ連結 ※子連結が基本
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(ec_Cur, log_Reports);
            }

            goto gt_EndMethod;
            //
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_NullFAelem:
            {
                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports);//設定位置パンくずリスト

                memoryApplication.CreateErrorReport("Er:7016;", tmpl, log_Reports);
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// S → E。
        /// </summary>
        public void Translate(
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(41)バリデーションファイル");
            }

            //
            //
            //
            //

            if (log_Reports.Successful)
            {

                //
                // コントロール順
                memoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct, ref bool bRemove, ref bool bBreak)
                {
                    if (uct is UsercontrolListbox)
                    {
                        //
                        // リストボックスなら。
                        UsercontrolListbox uctLst = (UsercontrolListbox)uct;

                        List<Configurationtree_Node> cfList_ValidatorConfig = uctLst.ControlCommon.Configurationtree_Control.GetChildrenByNodename(NamesNode.S_CODEFILE_VALIDATORS, false, log_Reports);
                        if (1 < cfList_ValidatorConfig.Count)
                        {
                            throw new Exception("バリデーター設定要素が2つ以上ありました。");
                        }
                        else if (0 < cfList_ValidatorConfig.Count)
                        {
                            Configurationtree_Node cf_ValidatorConfig = cfList_ValidatorConfig[0];

                            // (Sv)コントロールのSv
                            {
                                ConfigurationtreeToExpression_V52_FListboxValidationImpl_ to = new ConfigurationtreeToExpression_V52_FListboxValidationImpl_();

                                List<Configurationtree_Node> cfList_Validation = cf_ValidatorConfig.GetChildrenByNodename(NamesNode.S_F_LISTBOX_VALIDATION, false, log_Reports);

                                foreach (Configurationtree_Node child_Cf in cfList_Validation)
                                {

                                    //
                                    // <f-list-box-validation>
                                    to.Translate(
                                        child_Cf,
                                        uctLst,
                                        memoryApplication,
                                        pg_ParsingLog,
                                        log_Reports
                                        );

                                }//foreach
                            }

                            {
                                ConfigurationtreeToUsercontrol_V52_ValidatorImpl_ to = new ConfigurationtreeToUsercontrol_V52_ValidatorImpl_();

                                List<Configurationtree_Node> cfList_Validator = cf_ValidatorConfig.GetChildrenByNodename(NamesNode.S_VALIDATOR, false, log_Reports);
                                foreach (Configurationtree_Node cf in cfList_Validator)
                                {
                                    to.ConfigurationtreeToUsercontrol(
                                        cf,
                                        uct,
                                        pg_ParsingLog,
                                        log_Reports
                                        );
                                }
                            }

                        }//Ov

                    }
                    else
                    {
                    }
                });
            }

            goto gt_EndMethod;

            //
            //
            //
            //
            gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement("(41)バリデーションファイル");
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// <arg1>
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,//「S■arg1」
            Expression_Node_String parent_Ec,//親「E■fnc」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            //
            // デバッグオープンの前に。
            //
            // 「S■arg1 name=”★”」属性
            //
            string sName_MyFnc;
            cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_MyFnc, false, log_Reports);

            if (log_Method.CanDebug(1))
            {
                Dictionary<string, string> s_Dic = new Dictionary<string, string>();
                s_Dic.Add(PmNames.S_NAME.Name_Pm, sName_MyFnc);
                pg_ParsingLog.Increment("(6.arg1・3要素)" + cur_Cf.Name, s_Dic);
            }

            //
            //

            if (log_Method.CanDebug(2))
            {
                log_Method.WriteDebug_ToConsole("「S■arg1・3」要素 解析開始┌────────────────┐ 自arg1・3は、e_Parent=[" + parent_Ec.Cur_Configuration.Name + "]の”" + sName_MyFnc + "”属性になる。");
            }

            string parent_SName_Fnc;
            {
                // ヒット必須にするとエラーになる?
                parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports);
                if (!log_Reports.Successful)
                {
                    goto gt_EndMethod;
                }

                //if (0 < d_InMethod.NDebugLevel)
                //{
                //    if (NamesNode.S_FNC != e_Parent.Cur_Configurationtree.Name)
                //    {
                //        d_InMethod.WriteDebug_ToConsole(1, "fnc以外の親要素「E■[" + e_Parent.Cur_Configurationtree.Name + "]」");
                //    }
                //}
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                // 元からあった。
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    true,//name属性は必須。
                    true,//value属性は、子<f-str>にする。
                    log_Reports
                    );
            }

            //
            //
            //
            // 子
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            //
            //
            //
            // 親へ連結 ※属性連結。
            //
            //
            //
            if (log_Reports.Successful)
            {
                parent_Ec.SetAttribute(sName_MyFnc, cur_Ec, log_Reports);
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }

            if (log_Method.CanDebug(2))
            {
                log_Method.WriteDebug_ToConsole( "「S■arg1・3」要素 解析終了└────────────────┘");
            }

            log_Method.EndMethod(log_Reports);
        }
Example #37
0
        //────────────────────────────────────────

        /// <summary>
        /// 「S■f-var」
        /// </summary>
        /// <param name="oFStrNode"></param>
        /// <param name="nFAelem"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public override void Translate(
            Configurationtree_Node cur_Cf,    //「S■f-var」
            Expression_Node_String parent_Ec, //親<●●>
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(33)" + cur_Cf.Name);
            }

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expression_FvarImpl cur_Ec = new Expression_FvarImpl(parent_Ec, cur_Cf, memoryApplication);


            //
            //
            //
            // 属性
            //
            //
            //
            if (log_Reports.Successful)
            {
                this.ParseAttr_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    false, //name属性は無い。
                    false, //value属性は、子<f-str>にしない。
                    log_Reports
                    );
            }


            //
            //
            //
            // 子
            //
            //
            //
            {
                // 非必須 value=”” value属性がなくても正常です。子要素を見に行きます。
                if (cur_Cf.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE.Name_Pm))
                {
                    string sValue;
                    cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_VALUE, out sValue, true, log_Reports);
                    cur_Ec.AppendTextNode(
                        sValue,
                        cur_Cf,
                        log_Reports
                        );
                }
            }


            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }


            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(
                    cur_Ec,
                    log_Reports
                    );
            }

            //
            //
            //
            //

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public void Translate(
            Configurationtree_Node cur_Cf,//<a-empty-field>
            Expression_Node_String parent_Expr,//Expressionv_5FAllTrueImpl
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(39)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_6AEmptyFieldImpl ecv_AEmptyFld = new Expressionv_6AEmptyFieldImpl(parent_Expr, cur_Cf, memoryApplication);

            //
            //
            //
            // 属性
            //
            //
            //
            {
                {
                    PmName pmName = PmNames.S_TYPE;
                    string sValue;
                    bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        Expression_Leaf_String ec_Leaf = new Expression_Leaf_StringImpl(sValue, parent_Expr, cur_Cf);
                        ecv_AEmptyFld.SetAttribute(pmName.Name_Pm, ec_Leaf, log_Reports);
                        //evAEmptyFld.Dictionary_SAttribute.Add(sAttrName, s_Cur.SAttrDic.Get(sAttrName, true, log_Reports));
                    }
                    else
                    {
                        // クリアー上書きしない。
                    }
                }

                {
                    PmName pmName = PmNames.S_DESCRIPTION;
                    string sValue;
                    bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports);
                    if (bHit)
                    {
                        Expression_Leaf_String ec_Leaf = new Expression_Leaf_StringImpl(sValue, parent_Expr, cur_Cf);
                        ecv_AEmptyFld.SetAttribute(pmName.Name_Pm, ec_Leaf, log_Reports);
                    }
                    else
                    {
                        // クリアー上書きしない。
                    }
                }
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                // TODO:?
                parent_Expr.List_Expression_Child.Add(ecv_AEmptyFld, log_Reports);
            }

            //
            //
            //
            // 子
            //
            //
            //
            {
                // <f-cell>要素のリスト
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    ecv_AEmptyFld,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }

            goto gt_EndMethod;
            //
            //
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        /// <summary>
        /// 読取。
        /// </summary>
        /// <param name="s_View"></param>
        /// <param name="ef_View"></param>
        /// <param name="moOpyopyo"></param>
        /// <param name="log_Reports"></param>
        public void Translate(
            Configurationtree_Node cur_Cf,//<view>
            Expression_Node_String parent_Ec,//「E■form-component」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(3)"+cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //

            Expression_Node_StringImpl cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            //
            //
            //
            // 子
            //
            //
            //
            {
                //<●●>要素を全検索。<f-list-box-labels>があることが期待されます。

                cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node cf_Child, ref bool bBreak)
                {
                    if (cf_Child is Configurationtree_Node)
                    {
                        Configurationtree_Node cf_Node = (Configurationtree_Node)cf_Child;

                        string sName_Node = cf_Node.Name;
                        string sName_Fnc = "";
                        {
                            bool bRequired;

                            if (NamesNode.S_FNC == sName_Node)
                            {
                                bRequired = true;
                            }
                            else
                            {
                                bRequired = false;
                            }

                            // todo; 子要素のnameも取りたい。
                            cf_Node.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, bRequired, log_Reports);
                        }

                        if (NamesNode.S_FNC == sName_Node && NamesFnc.S_LISTBOX_LABELS == sName_Fnc)
                        {
                            // 「S■fnc name=”Sf:f-listbox-labels;”」

                            ConfigurationtreeToExpression_F91_FListboxLabelsImpl_ to = new ConfigurationtreeToExpression_F91_FListboxLabelsImpl_();
                            to.Translate(
                                cf_Child,
                                cur_Ec,
                                memoryApplication,
                                pg_ParsingLog,
                                log_Reports
                                );
                        }
                        else
                        {
                            // エラー
                            {
                                Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                                tmpl.SetParameter(1, sName_Node, log_Reports);//設定ノード名
                                tmpl.SetParameter(2, sName_Fnc, log_Reports);//関数名

                                memoryApplication.CreateErrorReport("Er:7003;", tmpl, log_Reports);
                            }

                            bBreak = true;
                        }
                    }
                });
            }

            //
            //
            //
            // 親へ連結
            //
            //
            //
            {
                parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);
            }

            goto gt_EndMethod;
            //
            //

            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
        //────────────────────────────────────────
        public override void Translate(
            Configurationtree_Node cur_Cf,
            Expression_Node_String parent_Ec,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            // throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: このメソッドは廃止方針です。");

            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE",log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(18)" + cur_Cf.Name);
            }

            //
            //
            //
            //

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_String ec_Value;
            {
                ec_Value = new Expression_Node_StringImpl(parent_Ec, cur_Cf);
                ec_Value.AppendTextNode(
                    cur_Cf.Name,
                    cur_Cf,
                    log_Reports
                    );
            }

            //
            //
            //
            // 自
            //
            //
            //
            Expression_Node_StringImpl ec_Ap1p = new Expression_Node_StringImpl(parent_Ec, cur_Cf);

            ec_Ap1p.SetAttribute(
                PmNames.S_NAME.Name_Pm,
                ec_Value,
                log_Reports
                );

            StringBuilder sb = new StringBuilder();
            sb.Append("p");
            sb.Append(this.NP1p);
            sb.Append("p");

            //
            //
            //
            // 属性
            //
            //
            //
            parent_Ec.SetAttribute(
                sb.ToString(),
                ((Expression_Node_String)ec_Ap1p),
                log_Reports
                );

            //
            // 子要素
            //
            this.ParseChild_InConfigurationtreeToExpression(
                cur_Cf,
                ec_Ap1p,
                memoryApplication,
                pg_ParsingLog,
                log_Reports
                );

            goto gt_EndMethod;
            //
            //
            //
            //
            gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }
Example #41
0
        //────────────────────────────────────────

        /// <summary>
        /// <data>要素の読取。
        /// </summary>
        /// <param select="xDataSource"></param>
        /// <param select="fcUc"></param>
        public void Translate(
            Configurationtree_Node cur_Cf,    //<data>要素
            Expression_Node_String parent_Ec, //「S■form-component」
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "CfToEc", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(2)" + cur_Cf.Name);
            }

            //
            //
            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expression_NodeImpl cur_Ec = new Expression_NodeImpl(parent_Ec, cur_Cf, memoryApplication);


            //
            //
            //
            // 属性
            //
            //
            //
            string err_SAttrName;

            cur_Cf.Dictionary_Attribute.ForEach(delegate(string sPmName, string sValue, ref bool bBreak)
            {
                if (
                    PmNames.S_MEMORY.Name_Pm == sPmName ||
                    PmNames.S_ACCESS.Name_Pm == sPmName ||
                    PmNames.S_NAME_TABLE.Name_Pm == sPmName ||
                    PmNames.S_NAME_VAR.Name_Pm == sPmName || //.Z_ITEM_VALUE_TO_VARIABLE
                    PmNames.S_DESCRIPTION.Name_Pm == sPmName
                    )
                {
                    //ystem.Console.WriteLine(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: <データT >に属性追加 [" + sKey + "]←[" + sValue + "]");

                    // なんでも属性として追加。
                    Expression_Node_String ec_Value = new Expression_Leaf_StringImpl(sValue, cur_Ec, cur_Cf);
                    cur_Ec.SetAttribute(sPmName, ec_Value, log_Reports);
                }
                else
                {
                    err_SAttrName = sPmName;
                    bBreak        = true;
                    goto gt_Error_UndefinedAttr;
                }

                goto gt_gt_EndMethod2;
                //
                //
                //
                //
                gt_Error_UndefinedAttr:
                {
                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl();
                    tmpl.SetParameter(1, cur_Cf.Name, log_Reports);                                        //設定ノード名
                    tmpl.SetParameter(2, err_SAttrName, log_Reports);                                      //属性名
                    tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(cur_Cf), log_Reports); //設定位置パンくずリスト

                    memoryApplication.CreateErrorReport("Er:7002;", tmpl, log_Reports);
                }
                goto gt_gt_EndMethod2;

                gt_gt_EndMethod2:
                ;
            });


            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Cf,
                    cur_Ec,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }


            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Ec.List_Expression_Child.Add(cur_Ec, log_Reports);



            goto gt_EndMethod;
            //
            //
gt_EndMethod:
            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Cf.Name);
            }

            log_Method.EndMethod(log_Reports);
        }
Example #42
0
        //────────────────────────────────────────

        public void Translate(
            Configurationtree_Node cur_Conf,
            Expressionv_4ADisplayImpl parent_Exprv,
            MemoryApplication memoryApplication,
            Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports);

            if (log_Method.CanDebug(1))
            {
                pg_ParsingLog.Increment("(37)" + cur_Conf.Name);
            }

            //
            //


            //
            //
            //
            // 自
            //
            //
            //
            Expressionv_5FAllFieldsIsEmptyImpl cur_Exprv = new Expressionv_5FAllFieldsIsEmptyImpl(parent_Exprv, cur_Conf, memoryApplication);


            //
            //
            //
            // 子
            //
            //
            //
            {
                this.ParseChild_InConfigurationtreeToExpression(
                    cur_Conf,
                    cur_Exprv,
                    memoryApplication,
                    pg_ParsingLog,
                    log_Reports
                    );
            }


            //
            //
            //
            // 親へ連結
            //
            //
            //
            parent_Exprv.List_Expression_Child.Add(
                cur_Exprv,
                log_Reports
                );


            // #デバッグ中
            if (log_Method.CanDebug(1))
            {
                log_Method.WriteDebug_ToConsole(" ★★ <f-all-fields-is-empty> 子要素数=[" + cur_Exprv.List_Expression_Child.Count + "] 属性数=[" + cur_Exprv.Dictionary_Expression_Attribute.Count + "]");
            }

            goto gt_EndMethod;
            //
            //
            //
            //
gt_EndMethod:

            if (Log_ReportsImpl.BDebugmode_Static)
            {
                pg_ParsingLog.Decrement(cur_Conf.Name);
            }
            log_Method.EndMethod(log_Reports);
        }