Exemple #1
0
 private static void CreateMainFunctionAndConstants()
 {
     Functions.Add(MainFunction);
     MainFunction.FindVariables();
     MainFunction.FindVariablesLines();
     FindConstantsLines();
 }
Exemple #2
0
        private static void CreateFunctions()
        {
            Functions    = new List <Function>();
            Constants    = new List <Constant>();
            MainFunction = new MainFunction();
            for (int i = 0; i < Data.Code.Lines.Length; i++)
            {
                Word[] words = Data.Code[i];
                if (words.Length == 0)
                {
                    continue;
                }
                if (Split.IsTag(words[0].Text))
                {
                    continue;
                }
                if (words[0].Text == "")
                {
                    continue;
                }
                if (Word.Contains(words, Data.FUNCTION))
                {
                    int end = Brackets.GetCloseCurveBracketIndex(Data.Code.Lines, i + 1);
                    Functions.Add(new Function(i, end, words));
                    i = end;
                }
                else
                {
                    int end = MainFunctionEnd(i);
                    MainFunction.AddLines(i, end);
                    i = end;
                }
            }

            List <Function> onlyOutputtingFunctions = GetFunctionsThatAreOnlyForOutput();

            foreach (Function function in Functions)
            {
                function.DefineIsOnlyForOutputting(ref onlyOutputtingFunctions);
            }
        }