Пример #1
0
        public static ASMParameterTemplate Parse(string str)
        {
            var ret = new ASMParameterTemplate();

            for (int i = 0; i < str.Length; i++)
            {
                switch (str[i])
                {
                case '*':
                    ret.AllowPointer = true;
                    break;

                case '@':
                    ret.AllowRegister = true;
                    break;

                case '$':
                    ret.AllowConstant = true;
                    break;

                default:
                    ret.Token = str.Substring(i);
                    i         = str.Length;
                    break;
                }
            }
            return(ret);
        }
        public static ASMInstructionTemplate Parse(string str)
        {
            var ret = new ASMInstructionTemplate();

            string[] split = str.Split(' ');
            ret.Token = split[0];
            int i         = 0;
            var paramList = new List <ASMParameterTemplate>();

            while (split[++i][0] != '(')
            {
                paramList.Add(ASMParameterTemplate.Parse(split[i]));
            }
            ret.Delay     = split[i][1] - '0';
            ret.IsGeneric = split[split.Length - 1].Equals("generic");
            ret.parameter = paramList.ToArray();
            return(ret);
        }