//変数を実際の値に置き換えて返却する
        public static string replaceVariable(string targetExpression, IVariableRepository variableRepository)
        {
            bool parsingVariable = false;

            string        finalExpression = "";
            StringBuilder stringBuilder   = new StringBuilder();

            Stack <string> var_stack = new Stack <string>(); //2重、3重カッコに対応

            for (var i = 0; i < targetExpression.Length; i++)
            {
                char c = targetExpression[i];
                switch (c)
                {
                case '{':
                    var currentBatch = stringBuilder.ToString();
                    if (parsingVariable)
                    {
                        var_stack.Push(currentBatch);
                    }
                    else
                    {
                        finalExpression += currentBatch;
                        parsingVariable  = true;
                    }
                    stringBuilder.Clear();
                    break;

                case '}':
                    string variableName = stringBuilder.ToString();
                    if (parsingVariable)
                    {
                        string var_val = variableRepository.GetString(variableName);
                        if (var_stack.Count == 0)
                        {
                            parsingVariable = false;
                            stringBuilder.Clear();
                            finalExpression += var_val;
                        }
                        else
                        {
                            string stack_var = var_stack.Pop();
                            stringBuilder.Clear();
                            stringBuilder.Append(stack_var);
                            stringBuilder.Append(var_val);
                        }
                    }
                    break;

                default:
                    stringBuilder.Append(c);
                    break;
                }
            }
            if (stringBuilder.Length > 0)
            {
                finalExpression += stringBuilder.ToString();
            }
            finalExpression = variableRepository.GetString(finalExpression);

            return(finalExpression);
        }