예제 #1
0
 public EnumValue(FCSEnum e, string value)
 {
     this.type   = e;
     this.String = value;
 }
예제 #2
0
        private static bool parseEnum(StreamReader r, string firstLine)
        {
            string i;
            string str = null;

            if (!firstLine.StartsWith("enum"))
            {
                return(false);
            }
            List <string> strs = Definitions.tokenise(firstLine, 3);

            if (strs[0] != "enum" || strs.Count > 2 && strs[2] != "{")
            {
                return(false);
            }
            for (i = firstLine; !r.EndOfStream && !i.Contains <char>('}'); i = string.Concat(i, " ", str.Trim()))
            {
                str = Definitions.readLine(r);
                int num = str.IndexOf("//");
                if (num >= 0)
                {
                    str = str.Remove(num);
                }
            }
            List <string> strs1 = Definitions.tokenise(i, 999);

            if (strs1[0] != "enum")
            {
                return(false);
            }
            string item = strs1[1];

            if (strs1[2] != "{")
            {
                return(false);
            }
            FCSEnum fCSEnums = new FCSEnum();
            int     num1     = 3;

            while (num1 < strs1.Count)
            {
                string tansedStr = "";
                string item1     = strs1[num1];
                if (item1 != ",")
                {
                    if (item1 == "}")
                    {
                        break;
                    }
                    int max = fCSEnums.Max;
                    if (strs1[num1 + 1] != "=")
                    {
                        num1++;
                    }
                    else
                    {
                        max   = int.Parse(strs1[num1 + 2]);
                        num1 += 3;
                    }
                    //if (!(bool)NativeTranslte.enumDict.TryGetValue(item1, out tansedStr))
                    //{
                    //    tansedStr = item1;
                    //}
                    //// Console.Write(tansedStr, max);
                    //try
                    //{
                    //    fCSEnums.addValue(tansedStr, max);
                    //}
                    //catch (Exception exception)
                    //{
                    //    fCSEnums.addValue(item1, max);
                    //}

                    fCSEnums.addValue(item1, max);
                }
                else
                {
                    num1++;
                }
            }
            FCSEnums.types.Add(item, fCSEnums);
            return(true);
        }
예제 #3
0
 public EnumValue(FCSEnum e, int value)
 {
     this.type  = e;
     this.Value = value;
 }