예제 #1
0
파일: ObjCallStmt.cs 프로젝트: Myvar/Eclang
        public override Statement Interprete(string src, int line)
        {
            var returns = new ObjCallStmt();

            returns.Line = line;
            string tmp1 = "";

            for (int index = 0; index < src.Split('(').Length; index++)
            {
                string i = src.Split('(')[index];
                if (index == 0)
                {
                }
                else
                {
                    tmp1 += i + "(";
                }
            }
            string value = tmp1.Remove(tmp1.Length - 2, 2);
            string tmp   = "";

            for (int index = 0; index < src.Split('(')[0].Split('.').Length; index++)
            {
                string i = src.Split('(')[0].Split('.')[index];
                int    l = src.Split('(')[0].Split('.').Length;
                if (index == l - 1)
                {
                    returns.Name = i;
                }
                else
                {
                    tmp += i + ".";
                }
            }
            tmp = tmp.TrimEnd('.');

            returns.Target = tmp;

            if (value.Contains(','))
            {
                foreach (string i in value.Split(','))
                {
                    returns.Paramaters.Add(StatmentVarHandler.HandleVar(i));
                }
            }
            else
            {
                if (value != "")
                {
                    returns.Paramaters.Add(StatmentVarHandler.HandleVar(value));
                }
            }
            return(returns);
        }
예제 #2
0
        public override Statement Interprete(string src, int line)
        {
            var returns = new ObjCallStmt();
            returns.Line = line;
            string tmp1 = "";
            for (int index = 0; index < src.Split('(').Length; index++)
            {
                string i = src.Split('(')[index];
                if (index == 0)
                {
                }
                else
                {
                    tmp1 += i + "(";
                }
            }
            string value = tmp1.Remove(tmp1.Length - 2, 2);
            string tmp = "";
            for (int index = 0; index < src.Split('(')[0].Split('.').Length; index++)
            {
                string i = src.Split('(')[0].Split('.')[index];
                int l = src.Split('(')[0].Split('.').Length;
                if (index == l - 1)
                {
                    returns.Name = i;
                }
                else
                {
                    tmp += i + ".";
                }
            }
            tmp = tmp.TrimEnd('.');

            returns.Target = tmp;

            if (value.Contains(','))
            {
                foreach (string i in value.Split(','))
                {
                    returns.Paramaters.Add(StatmentVarHandler.HandleVar(i));
                }
            }
            else
            {
                if (value != "")
                {
                    returns.Paramaters.Add(StatmentVarHandler.HandleVar(value));
                }
            }
            return returns;
        }
예제 #3
0
 public virtual void Visit(ObjCallStmt dec)
 {
 }