Ejemplo n.º 1
0
        public ReflectedModule EnsureNamespace(string full, SymbolId name)
        {
            ReflectedModule nested;

            if (!namespaces.TryGetValue(name, out nested))
            {
                nested           = new ReflectedModule(full);
                namespaces[name] = nested;
            }
            return(nested);
        }
Ejemplo n.º 2
0
        private void LoadTypes(Assembly assembly)
        {
            Type[] types = assembly.GetExportedTypes();

            foreach (Type type in types)
            {
                ReflectedModule scope = global;
                string[]        ns    = type.Namespace.Split('.');
                string          full  = "";
                bool            dot   = false;
                foreach (string n in ns)
                {
                    full  = dot ? full + "." + n : n;
                    dot   = true;
                    scope = scope.EnsureNamespace(full, SymbolTable.StringToId(n));
                }
                scope.AddType(type);
            }
        }
Ejemplo n.º 3
0
 public bool TryGetNamespace(string name, out ReflectedModule scope)
 {
     return(namespaces.TryGetValue(SymbolTable.StringToId(name), out scope));
 }