示例#1
0
 public static void AddUsingListToScope(SymbolTable.Scope scope, using_namespace_list unl)
 {
     SymbolTable.UnitPartScope ups = scope as SymbolTable.UnitPartScope;
     if (ups == null)
     {
         return;
     }
     foreach (SymbolTable.Scope sc in ups.TopScopeArray)
     {
         NetHelper.NetScope netsc = sc as NetHelper.NetScope;
         if (netsc != null && netsc.used_namespaces.Count == 0)
         {
             using_namespace_list new_unl = new using_namespace_list();
             foreach (using_namespace un in unl)
             {
                 SymbolInfo si = netsc.FindOnlyInScope(un.namespace_name);
                 if ((si.sym_info as compiled_namespace_node) != null)
                 {
                     new_unl.AddElement(un);
                 }
             }
             netsc.used_namespaces = new_unl;
         }
     }
 }
        public SymbolTable.Scope[] MakeTopScopeArray(using_namespace_list unl, int uses_count)
        {
            List<SymbolTable.Scope> top_scopes = new List<SymbolTable.Scope>();

            //Добавляем внутренний системный модуль
            top_scopes.Add(SystemLibrary.SystemLibrary.system_unit.scope);

            //Добавляем .NET - пространство
            System.Reflection.Assembly _as = typeof(string).Assembly;
            NetHelper.NetScope ns = new NetHelper.NetScope(unl, _as, SystemLibrary.SystemLibrary.symtab);
            top_scopes.Add(ns);

            //Добавляем подключенные модули
            for (int i = 0; i < uses_count; i++)
            {
                PCUReader pcu_r = units[pcu_file.incl_modules[i]] as PCUReader;
                if (pcu_r != null)
                {
                    top_scopes.Add(pcu_r.cun.scope);
                }
            }

            //Добавляем внутренний системный модуль
            //top_scopes.Add(SystemLibrary.SystemLibrary.system_unit.scope);

            return top_scopes.ToArray();
        }
示例#3
0
 public dot_net_unit_node(NetHelper.NetScope dotNetScope)
 {
     _dotNetScope = dotNetScope;
 }
示例#4
0
 public dot_net_unit_node(NetHelper.NetScope dotNetScope)
 {
     _dotNetScope = dotNetScope;
 }