Exemplo n.º 1
0
        private static void ProcessRow(string Row)
        {
            if (Row == "[") //Don't ask.
            {
                return;
            }

            string TypeOfRow = RegExManager.GetKeyValue(Row, "type");

            switch (TypeOfRow)
            {
            case "Class":
                ParseClass(Row);
                break;

            case "Property":
                ParseProperty(Row);
                break;

            case "Enum":
                ParseEnum(Row);
                break;

            case "EnumItem":
                ParseEnumItem(Row);
                break;
            }
        }
Exemplo n.º 2
0
        //
        public string _RegExEval
        (
            string p_tagSearch
            , string p_textSearch
        )
        {
            //
            string p_textContent = Session["XmlContent"].ToString();
            //
            string p_textContentRaw = Session["XmlContentRaw"].ToString();
            //
            string status = "0";

            //
            try
            {
                //--------------------------------------------------
                // LOG
                //--------------------------------------------------
#if DEBUG
                //
                LogModel.Log(
                    string.Format("REGEX_XML. p_tagSearch='{0}', p_textSearch='{1}'"
                                  , p_tagSearch
                                  , p_textSearch)
                    );
#endif
                //--------------------------------------------------
                // SEARCH REGEX TEXT
                //--------------------------------------------------
                RegExManager regexManager = new RegExManager
                                            (
                    p_tagSearch
                    , p_textSearch
                    , p_textContentRaw
                                            );
                //
                status = regexManager.GetMaches();

                //
#if DEBUG
                LogModel.Log(
                    string.Format("REGEX_XML. Status ='{0}'"
                                  , status)
                    );
#endif
                //
            }
            catch (Exception ex)
            {
                //
                LogModel.Log(string.Format("REGEX_ÈRROR. ='{0}'-'{1}'"
                                           , ex.Message
                                           , ex.StackTrace)
                             , string.Empty
                             , LogModel.LogType.Error);
            }
            //
            return(status);
        }
Exemplo n.º 3
0
        private static List <string> DecodeTags(string Row)
        {
            List <string> Tags = new List <string>();

            RegExManager.ForEachMatch(Row, RegExManager.Tags, (regExMatch) => {
                Group g = regExMatch.Groups["tags"];
                if (!string.IsNullOrWhiteSpace(g.Value))
                {
                    RegExManager.ForEachMatch(g.Value, RegExManager.SeparateTags, (Argument) => {
                        if (!string.IsNullOrWhiteSpace(Argument.Value))
                        {
                            if (Argument.Value.StartsWith("\"") && Argument.Value.EndsWith("\""))
                            {
                                Tags.Add(Argument.Value.Substring(1, Argument.Value.Length - 2));
                            }
                            else
                            {
                                Tags.Add(Argument.Value);
                            }
                        }
                    });
                }
            });

            return(Tags);
        }
Exemplo n.º 4
0
        private static void ParseEnum(string Row)
        {
            string EnumName = RegExManager.GetKeyValue(Row, "Name");

            List <string> Tags = DecodeTags(Row);

            RobloxEnum.AddRobloxEnum(EnumName, Tags);
        }
Exemplo n.º 5
0
        private static void ParseEnumItem(string Row)
        {
            string        Name = RegExManager.GetKeyValue(Row, "Name");
            List <string> Tags = DecodeTags(Row);

            string Enum = RegExManager.GetKeyValue(Row, "Enum");

            RobloxEnum e = RobloxEnum.Enums[Enum];

            e.AddEnumItem(Name, Tags);
        }
Exemplo n.º 6
0
        private static void ParseClass(string Row)
        {
            string Name       = RegExManager.GetKeyValue(Row, "Name");
            string Superclass = RegExManager.GetKeyValue(Row, "Superclass");

            List <string> Tags = DecodeTags(Row);

            if (RobloxHierachy == null)
            {
                RobloxHierachy = new Dictionary <string, RobloxInstance>();
            }

            RobloxHierachy.Add(Name, new RobloxInstance(Name, Tags, Superclass));
        }
Exemplo n.º 7
0
        private static void ParseProperty(string Row)
        {
            string ClassName = RegExManager.GetKeyValue(Row, "Class");

            RobloxInstance Inst;

            if (!RobloxHierachy.TryGetValue(ClassName, out Inst))
            {
                throw new ArgumentException("Invalid ClassName " + ClassName);
            }

            string Name      = RegExManager.GetKeyValue(Row, "Name");
            string ValueType = RegExManager.GetKeyValue(Row, "ValueType");

            List <string> Tags = DecodeTags(Row);

            Inst.AddProperty(new RobloxProperty(Name, Tags, ValueType));
        }