Beispiel #1
0
        private static void FindVoids(string line, int i, string[] lines, bool DefaultFile)
        {
            if (line.StartsWith("func") && !line.EndsWith(".start") && !line.EndsWith(".end"))
            {
                EggCodeTypeVoid TempVoid = new EggCodeTypeVoid
                {
                    name = line.StringSplit("func ")[1]
                };
                TempVoid.Start(i);

                if (DefaultFile && TempVoid.name == "start")
                {
                    startVoid = TempVoid;
                }

                eggCodeVoids.Add(TempVoid);
            }
            else if (line.StartsWith("void") && line.EndsWith(")"))
            {
                EggCodeTypeVoid TempVoid = new EggCodeTypeVoid
                {
                    name = line.StringSplit("void ")[1].Split('(')[0]
                };
                TempVoid.StartWithPrams(i, line.AdvancedBetween('(', ')'));

                eggCodeVoids.Add(TempVoid);
            }
            else if (line.EndsWith(".end"))
            {
                foreach (EggCodeTypeVoid ecv in eggCodeVoids)
                {
                    if (line.StringSplit(".end")[0] == ecv.name)
                    {
                        ecv.End(i);

                        ecv.Create(lines);
                    }
                }
            }
        }
Beispiel #2
0
        private static void FindVoids(string line, int i, string[] lines, bool DefaultFile)
        {
            if (line.StartsWith("pre declair"))
            {
                string[] args = line.Replace("pre declair ", "").StringSplit(" as ");

                EggCodeTypeVarible var = new EggCodeTypeVarible(args[0], args[1]);
                eggCodeGlobalVaribles.Add(var);
            }

            if (line.StartsWith("func") && !line.EndsWith(".start") && !line.EndsWith(".end"))
            {
                EggCodeTypeVoid TempVoid = new EggCodeTypeVoid
                {
                    name = line.StringSplit("func ")[1]
                };
                TempVoid.Start(i);

                try {
                    if (lines[i - 1] == "(loop forever)")
                    {
                        TempVoid.LoopForever = true;
                    }
                    else if (lines[i - 1].StartsWith("(loop condition)"))
                    {
                        TempVoid.LoopConditionTag = true;
                        TempVoid.LoopCondition    = lines[i - 1].StringSplit(" = ")[1].AdvancedBetween('(', ')');
                    }
                }
                catch { }

                if (DefaultFile && TempVoid.name == "start")
                {
                    startVoid = TempVoid;
                }

                eggCodeVoids.Add(TempVoid);
            }
            else if (line.StartsWith("void") && line.EndsWith(")"))
            {
                EggCodeTypeVoid TempVoid = new EggCodeTypeVoid
                {
                    name = line.StringSplit("void ")[1].Split('(')[0]
                };
                TempVoid.StartWithPrams(i, line.AdvancedBetween('(', ')'));

                eggCodeVoids.Add(TempVoid);
            }
            else if (line.EndsWith(".end"))
            {
                foreach (EggCodeTypeVoid ecv in eggCodeVoids)
                {
                    if (line.StringSplit(".end")[0] == ecv.name)
                    {
                        ecv.End(i);

                        ecv.Create(lines);
                    }
                }
            }
        }