예제 #1
0
 public static void RestoreSymbol(SymbolInfo si, string name, int index = 0)
 {
     if (si != null)
     {
         if (si.sym_info != null)
         {
             if (si.sym_info.semantic_node_type == semantic_node_type.wrap_def)
             {
                 wrapped_definition_node wdn = (wrapped_definition_node)si.sym_info;
                 RestoreSymbols(si, wdn, name);
             }
         }
     }
 }
예제 #2
0
 static void RestoreSymbols(SymbolInfo si, wrapped_definition_node wdn, string name)
 {
     if (wdn.is_synonim)
     {
         si.sym_info = wdn.PCUReader.CreateTypeSynonim(wdn.offset, name);
     }
     else
     if (si.scope is ClassScope)
     {
         si.sym_info = wdn.PCUReader.CreateInterfaceInClassMember(wdn.offset, name);
     }
     else
     {
         si.sym_info = wdn.PCUReader.CreateImplementationMember(wdn.offset, false);
     }
 }
예제 #3
0
 public static void RestoreSymbols(List <SymbolInfo> sil, string name, int index = 0)
 {
     if (sil != null)
     {
         for (int i = index; i < sil.Count; ++i)
         {
             if (sil[i].sym_info != null)
             {
                 if (sil[i].sym_info.semantic_node_type == semantic_node_type.wrap_def)
                 {
                     wrapped_definition_node wdn = (wrapped_definition_node)sil[i].sym_info;
                     RestoreSymbols(sil[i], wdn, name);
                 }
             }
         }
     }
 }
예제 #4
0
 public static void RestoreSymbolsInterfaceMember(List <SymbolInfo> sil, string name)
 {
     if (sil != null)
     {
         foreach (var si in sil)
         {
             if (si.sym_info != null)
             {
                 if (si.sym_info.semantic_node_type == semantic_node_type.wrap_def)
                 {
                     wrapped_definition_node wdn = (wrapped_definition_node)si.sym_info;
                     si.sym_info = wdn.PCUReader.CreateInterfaceMember(wdn.offset, name);
                 }
             }
         }
     }
 }
        private void AddNames(NameRef[] names, SymbolTable.Scope Scope)
        {
            for (int i = 0; i < names.Length; i++)
            {
                SymbolInfo si = new SymbolInfo();

                si.symbol_kind = names[i].symbol_kind;
                wrapped_definition_node wdn = new wrapped_definition_node(names[i].offset, this);
                si.sym_info = wdn;
                if (names[i].special_scope == 0)
                {
                    //PCUReturner.AddPCUReader((wrapped_definition_node)si.sym_info, this);
                    //si.access_level = access_level.al_public;
                    SymbolInfo si2 = (cun.scope as WrappedUnitInterfaceScope).FindWithoutCreation(names[i].name);
                    si.Next = si2;
                    Scope.AddSymbol(names[i].name, si);
                }
                else
                {
                    
                    type_node tn = GetSpecialTypeReference(names[i].offset);
                    if (tn is compiled_type_node)
                        (tn as compiled_type_node).scope.AddSymbol(names[i].name, si);
                    else if (tn is generic_instance_type_node)
                        tn.Scope.AddSymbol(names[i].name, si);
                    else if (tn is common_type_node)
                        (tn as common_type_node).scope.AddSymbol(names[i].name, si);
                    else
                        throw new NotSupportedException();
                }
            }
        }