Esempio n. 1
0
        private void Parse()
        {
            for (;;)
            {
                var s = this.ReadString();
                if (s == null)
                {
                    break;
                }

                if (s == "include")
                {
                    var fileName = this.ReadString();
                    continue;
                }

                if (s == "}")
                {
                    this.GetObject(0).ParseClose(this);
                    this.PopObject();
                    continue;
                }

                if (this.parseStack.Count > 0)
                {
                    if (this.GetObject(0).ParseAttribute(this, s))
                    {
                        continue;
                    }
                }

                if (this.PeekString() == "{")
                {
                    this.ReadString();
                    IwClassFactory iwClassFactory = this.classRegistry.Get(S3E.HashString(s));
                    if (iwClassFactory == null)
                    {
                        throw new Exception(string.Format("Can't find class {0}", s));
                    }

                    this.PushObject(iwClassFactory.Create());
                    this.GetObject(0).ParseOpen(this);
                }
                else
                {
                    throw new Exception(string.Format("{0} is not an attribute in {1}", s, this.GetObject(0).GetType().Name));
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// The hash string.
 /// </summary>
 /// <param name="name">
 /// The name.
 /// </param>
 /// <returns>
 /// The hash string.
 /// </returns>
 public static uint HashString(string name)
 {
     return(S3E.HashString(name));
 }
Esempio n. 3
0
 /// <summary>
 /// Case insensetive hash.
 /// </summary>
 /// <param name="s">
 /// String to calculate hash for.
 /// </param>
 /// <returns>
 /// Calculated hash.
 /// </returns>
 public static uint ToeHash(this string s)
 {
     return(S3E.HashString(s));
 }
Esempio n. 4
0
 /// <summary>
 /// The read string hash.
 /// </summary>
 /// <returns>
 /// The read string hash.
 /// </returns>
 public uint ReadStringHash()
 {
     return(S3E.HashString(this.ReadString()));
 }