Beispiel #1
0
        void _resolveNames(Globals globals)
        {
            foreach (string key in globals.GetPropertyNames())
            {
                TypeInfo t = globals.GetProperty(key, true) as TypeInfo;
                if (t != null)
                {
                    if (!t.IsComplete)
                    {
                        globals.AddProperty(key, globals.GetTypeInfo(t.Name), -1, "");
                    }
                    if (t is TemplateInst)
                    {
                        TemplateInst ti = globals.GetProperty(key, true) as TemplateInst;
                        if (!ti.WrappedType.IsComplete)
                        {
                            ti.WrappedType = globals.GetTypeInfo(ti.WrappedType.Name);
                        }
                    }
                }
            }

            foreach (FunctionInfo f in globals.GetFunctions(null, true))
            {
                f.ResolveIncompletion(globals);
            }

            foreach (TypeInfo type in globals.TypeInfo)
            {
                type.ResolveIncompletion(globals);
            }
        }
Beispiel #2
0
 void ParseDumpGlobProps(string line, StringReader rdr, Globals globals)
 {
     while ((line = rdr.ReadLine()) != null)
     {
         if (line.Length == 0)
         {
             return;
         }
         if (line.StartsWith("/*") || line.StartsWith("//"))
         {
             continue;
         }
         else
         {
             string[] parts  = line.Replace(";", "").Split(' ');                                               //[TypeName] [PropertyName]
             string   pname  = parts[0].EndsWith("@") ? parts[0].Substring(0, parts[0].Length - 1) : parts[0]; //handle
             TypeInfo pType  = null;
             string   myname = parts[1];
             if (globals.ContainsTypeInfo(pname))
             {
                 pType = globals.GetTypeInfo(pname);
             }
             if (pType == null)   //create temp type to resolve
             {
                 pType = new TypeInfo()
                 {
                     Name = pname, IsComplete = false
                 };
             }
             globals.AddProperty(myname, pType, -1, null);
         }
     }
 }
        void _resolveNames(Globals globals)
        {
            foreach (string key in globals.GetPropertyNames()) {
                TypeInfo t = globals.GetProperty(key, true) as TypeInfo;
                if (t != null)
                {
                    if (!t.IsComplete)
                        globals.AddProperty(key, globals.GetTypeInfo(t.Name), -1, "");
                    if (t is TemplateInst)
                    {
                        TemplateInst ti = globals.GetProperty(key, true) as TemplateInst;
                        if (!ti.WrappedType.IsComplete)
                            ti.WrappedType = globals.GetTypeInfo(ti.WrappedType.Name);
                    }
                }
            }

            foreach (FunctionInfo f in globals.GetFunctions(null, true)) {
                f.ResolveIncompletion(globals);
            }

            foreach (TypeInfo type in globals.TypeInfo) {
                type.ResolveIncompletion(globals);
            }
        }
 void ParseDumpGlobProps(string line, StringReader rdr, Globals globals)
 {
     while ((line = rdr.ReadLine()) != null) {
         if (line.Length == 0)
             return;
         if (line.StartsWith("/*") || line.StartsWith("//"))
             continue;
         else {
             string[] parts = line.Replace(";", "").Split(' '); //[TypeName] [PropertyName]
             string pname = parts[0].EndsWith("@") ? parts[0].Substring(0, parts[0].Length - 1) : parts[0]; //handle
             TypeInfo pType = null;
             string myname = parts[1];
             if (globals.ContainsTypeInfo(pname))
                 pType = globals.GetTypeInfo(pname);
             if (pType == null) { //create temp type to resolve
                 pType = new TypeInfo() { Name = pname, IsComplete = false };
             }
             globals.AddProperty(myname, pType, -1, null);
         }
     }
 }