Example #1
0
        public static string Write(object One)
        {
            LsInt Two = (LsInt)One;

            foreach (Prefix prefix in Two.Prefixes)
            {
                switch (prefix)
                {
                case Prefix.@protected:
                    Two.Name = "self._" + Two.Name;
                    break;

                case Prefix.@private:
                    Two.Name = "self.__" + Two.Name;
                    break;

                default:
                    break;
                }
            }
            string temp = "";

            if (Two.ValueType)
            {
                temp = Two.Name + " = " + Two.ValueT;
            }
            else
            {
                temp = Two.Name + " = " + Two.Value.ToString();
            }
            return(temp);
        }
Example #2
0
        public static string Write(object One)
        {
            LsInt  Two = (LsInt)One;
            string pre = "";

            foreach (Prefix prefix in Two.Prefixes)
            {
                switch (prefix)
                {
                case Prefix.@public:
                    pre = "public " + pre;
                    break;

                case Prefix.@protected:
                    pre = "protected " + pre;
                    break;

                case Prefix.@private:
                    pre = "private " + pre;
                    break;

                case Prefix.@static:
                    pre = "static " + pre;
                    break;

                case Prefix.@readonly:
                    pre = "readonly " + pre;
                    break;

                case Prefix.@internal:
                    pre = "internal " + pre;
                    break;

                default:
                    break;
                }
            }
            string temp = "";

            if (Two.ValueType)
            {
                temp = pre + "int " + Two.Name + " = " + Two.ValueT + ";";
            }
            else
            {
                temp = pre + "int " + Two.Name + " = " + Two.Value.ToString() + ";";
            }
            return(temp);
        }
Example #3
0
        public static LsInt Read(string One)
        {
            string        Two      = One.Split('=')[0].Trim().Split(' ')[One.Split('=')[0].Trim().Split(' ').Length - 1].Trim();
            string        Three    = One.Split('=')[1].Trim().Trim(';').Trim();
            List <Prefix> prefixes = new List <Prefix>();

            foreach (var item in One.Split('=')[0].Split(' '))
            {
                if (item.Trim() == "protected")
                {
                    prefixes.Add(Prefix.@protected);
                }
                else if (item.Trim() == "private")
                {
                    prefixes.Add(Prefix.@private);
                }
                else if (item.Trim() == "static")
                {
                    prefixes.Add(Prefix.@static);
                }
                else if (item.Trim() == "readonly")
                {
                    prefixes.Add(Prefix.@readonly);
                }
                else if (item.Trim() == "internal")
                {
                    prefixes.Add(Prefix.@internal);
                }
                else if (item.Trim() == "public")
                {
                    prefixes.Add(Prefix.@public);
                }
            }
            if (prefixes.Count == 0)
            {
                prefixes.Add(Prefix.@public);
            }
            LsInt Four;

            try { Four = new LsInt(Two, int.Parse(Three), prefixes); }
            catch { Four = new LsInt(Two, Three, prefixes); }
            return(Four);
        }
Example #4
0
        public static LsInt Read(string One)
        {
            string        Two      = One.Split('=')[0].Split(' ')[1].Trim();
            string        Three    = One.Split('=')[1].Trim().Trim(';').Trim();
            List <Prefix> prefixes = new List <Prefix>();

            if (Two[0] == '@')
            {
                prefixes.Add(Prefix.@public);
            }
            else
            {
                prefixes.Add(Prefix.@private);
            }
            LsInt Four;

            try { Four = new LsInt(Two, int.Parse(Three), prefixes); }
            catch { Four = new LsInt(Two, Three, prefixes); }
            return(Four);
        }
Example #5
0
        public static string Write(object One)
        {
            LsInt Two = (LsInt)One;

            foreach (Prefix prefix in Two.Prefixes)
            {
                if (prefix == Prefix.@public)
                {
                    Two.Name = "@" + Two.Name;
                }
            }
            string temp = "";

            if (Two.ValueType)
            {
                temp = "SET " + Two.Name + " = " + Two.ValueT + ";";
            }
            else
            {
                temp = "SET " + Two.Name + " = " + Two.Value.ToString() + ";";
            }
            return(temp);
        }
Example #6
0
        public static LsInt Read(string One)
        {
            string Two   = One.Split('=')[0].Trim();
            string Three = One.Split('=')[1].Trim();
            LsInt  Four  = new LsInt(Two);

            if (Two.StartsWith("self.__"))
            {
                Two.TrimStart("self.__".ToCharArray());
                Four.Prefixes.Add(Prefix.@private);
            }
            else if (Two.StartsWith("self._"))
            {
                Two.TrimStart("self._".ToCharArray());
                Four.Prefixes.Add(Prefix.@protected);
            }
            else
            {
                Four.Prefixes.Add(Prefix.@public);
            }
            try { Four = new LsInt(Two, int.Parse(Three)); }
            catch { Four = new LsInt(Two, Three); }
            return(Four);
        }