Пример #1
0
        public functionInfoMassiveElement[] get_functions_info_massive()
        {
            delete_all_comments();
            functionInfoMassiveElement[] function_info_massive = new functionInfoMassiveElement[1];
            int functionInfoMassiveLength = 1;

            StringBuilder currentFunctionText;
            string currentFunctionName = "Глобальная область программы";
            Function currentFunction = new Function(text.ToString());
            function_info_massive[0].functionName = currentFunctionName;
            function_info_massive[0].functionVariables = currentFunction.get_function_identifiers_massive(null);
            identifiersMassiveElement[] globalIdentifiers = function_info_massive[0].functionVariables;

            int functionBeginIndex = 0, functionEndIndex = 0;
            while(condition_to_continue_watch_text(ref currentFunctionName,ref functionBeginIndex,ref functionEndIndex))
            {
                functionInfoMassiveLength++;
                Array.Resize<functionInfoMassiveElement>(ref function_info_massive, functionInfoMassiveLength);
                currentFunctionText = new StringBuilder(text.ToString().Substring(functionBeginIndex + currentFunctionName.Length, functionEndIndex - functionBeginIndex - currentFunctionName.Length + 1));
                currentFunction = new Function(currentFunctionText.ToString());
                function_info_massive[functionInfoMassiveLength - 1].functionName = currentFunctionName;
                function_info_massive[functionInfoMassiveLength - 1].functionVariables = currentFunction.get_function_identifiers_massive(globalIdentifiers);
            }
            return function_info_massive;
        }
 public void loadAnswer(functionInfoMassiveElement[] functionsMassive)
 {
     int massiveLen = functionsMassive.Length;
     int index;
     int index2;
     int amountFunctionVariables;
     for(index = 0;index < massiveLen;index++)
     {
         richTextBoxAnswer.Text += functionsMassive[index].functionName + "\n";
         amountFunctionVariables = functionsMassive[index].functionVariables.Length;
         if (amountFunctionVariables == 0)
             richTextBoxAnswer.Text += "   " + "У данной функции отсутствуют локальные переменные\n\n";
         else
         {
             for (index2 = 0; index2 < amountFunctionVariables;index2++)
             {
                 richTextBoxAnswer.Text += "   " + functionsMassive[index].functionVariables[index2].identifier + "   " + functionsMassive[index].functionVariables[index2].amount.ToString() + "\n";
             }
             richTextBoxAnswer.Text += "\n";
         }
     }
 }