Exemplo n.º 1
0
        protected FAsmOpCodes Sync(char[] path, int offset)
        {
            char ch = path[offset];

            if (ch == '0')
            {
                if (_object0 == null)
                {
                    _object0 = new FAsmOpPath();
                }
                if (offset == path.Length - 1)
                {
                    return(_object0._codes);
                }
                return(_object0.Sync(path, offset + 1));
            }
            else if (ch == '1')
            {
                if (_object1 == null)
                {
                    _object1 = new FAsmOpPath();
                }
                if (offset == path.Length - 1)
                {
                    return(_object1._codes);
                }
                return(_object1.Sync(path, offset + 1));
            }
            else
            {
                throw new FFatalException("Valid path char");
            }
        }
Exemplo n.º 2
0
        public void LoadOpCode(FXmlNode config)
        {
            string flag = config["flag"];
            string path = null;

            char[] chs   = flag.ToCharArray();
            int    count = chs.Length;

            for (int n = 0; n < count; n++)
            {
                char ch = chs[n];
                if ((n != count - 1) && (ch == '0' || ch == '1'))
                {
                    continue;
                }
                path = flag.Substring(0, n);
                break;
            }
            FAsmOpCodes codes = _codes.Sync(path);

            codes.CreateCode(config);
        }