Exemple #1
0
 public override SymInfo[] GetNamesAsInObject()
 {
     List<SymInfo> syms = new List<SymInfo>();
     if (!CodeCompletionController.CurrentParser.LanguageInformation.IncludeDotNetEntities)
         return syms.ToArray();
     MemberInfo[] mis = ctn.GetMembers(BindingFlags.Public | BindingFlags.Instance);
     foreach (MemberInfo mi in mis)
         if (!mi.Name.Contains("$"))
             switch (mi.MemberType)
             {
                 case MemberTypes.Method: if (!(mi as MethodInfo).IsSpecialName)
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                         si2 = new CompiledMethodScope(si2, mi as MethodInfo, this).si;
                         syms.Add(si2);
                     }
                     break;
                 case MemberTypes.Field:
                     {
                         if (!(mi as FieldInfo).IsSpecialName)
                         {
                             SymInfo si2 = new SymInfo(null, SymbolKind.Field, null);
                             if ((mi as FieldInfo).IsLiteral) si2.kind = SymbolKind.Constant;
                             si2 = new CompiledFieldScope(si2, mi as FieldInfo, this).si;
                             syms.Add(si2);
                         }
                         //syms.Add(new SymInfo(mi.Name,SymbolKind.Field,mi.Name)); break;
                     }
                     break;
                 case MemberTypes.Property:
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Property, null);
                         si2 = new CompiledPropertyScope(si2, mi as PropertyInfo, this).si;
                         syms.Add(si2);
                         //syms.Add(new SymInfo(mi.Name,SymbolKind.Property,mi.Name));
                     }
                     break;
                 case MemberTypes.Event:
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Event, null);
                         si2 = new CompiledEventScope(si2, mi as EventInfo, this).si;
                         syms.Add(si2);
                         //syms.Add(new SymInfo(mi.Name,SymbolKind.Event,mi.Name));
                     }
                     break;
             }
     return syms.ToArray();
 }
Exemple #2
0
        public override SymInfo[] GetNames()
        {
            List<SymInfo> syms = new List<SymInfo>();
            if (!CodeCompletionController.CurrentParser.LanguageInformation.IncludeDotNetEntities)
                return syms.ToArray();
            MemberInfo[] mis = ctn.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy);
            if (ctn.IsInterface)
            {
                List<MemberInfo> mems = new List<MemberInfo>();
                mems.AddRange(mis);
                mems.AddRange(typeof(object).GetMembers());
                Type[] types = ctn.GetInterfaces();
                foreach (Type t in types)
                    mems.AddRange(t.GetMembers(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy));
                mis = mems.ToArray();
            }
            if (si.kind != SymbolKind.Type)
            {
                foreach (MemberInfo mi in mis)
                    if (!mi.Name.Contains("$"))
                        switch (mi.MemberType)
                        {
                            case MemberTypes.Method: if (!(mi as MethodInfo).IsSpecialName)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                                    si2 = new CompiledMethodScope(si2, mi as MethodInfo, this).si;
                                    syms.Add(si2);
                                }
                                break;
                            case MemberTypes.Field:
                                {
                                    if (!(mi as FieldInfo).IsSpecialName)
                                    {
                                        SymInfo si2 = new SymInfo(null, SymbolKind.Field, null);
                                        if ((mi as FieldInfo).IsLiteral) si2.kind = SymbolKind.Constant;
                                        si2 = new CompiledFieldScope(si2, mi as FieldInfo, this).si;
                                        syms.Add(si2);
                                    }
                                    //syms.Add(new SymInfo(mi.Name,SymbolKind.Field,mi.Name)); break;
                                }
                                break;
                            case MemberTypes.Property:
                                {
                                    PropertyInfo pi = mi as PropertyInfo;
                                    MethodInfo acc_mi = pi.GetGetMethod(true);
                                    if (acc_mi != null && !acc_mi.IsStatic)
                                    {
                                        SymInfo si2 = new SymInfo(null, SymbolKind.Property, null);
                                        si2 = new CompiledPropertyScope(si2, mi as PropertyInfo, this).si;
                                        syms.Add(si2);
                                    }
                                    //syms.Add(new SymInfo(mi.Name,SymbolKind.Property,mi.Name));
                                }
                                break;
                            case MemberTypes.Event:
                                {
                                    MethodInfo acc_mi = (mi as EventInfo).GetAddMethod(true);
                                    if (acc_mi.IsPublic && !acc_mi.IsStatic)
                                    {
                                        SymInfo si2 = new SymInfo(null, SymbolKind.Event, null);
                                        si2 = new CompiledEventScope(si2, mi as EventInfo, this).si;
                                        syms.Add(si2);
                                    }
                                    //syms.Add(new SymInfo(mi.Name,SymbolKind.Event,mi.Name));
                                }
                                break;
                        }
            }
            else
                foreach (MemberInfo mi in mis)
                    switch (mi.MemberType)
                    {
                        case MemberTypes.Method: if (!((mi as MethodInfo).IsSpecialName) && (mi as MethodInfo).IsStatic)
                            {
                                SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                                si2 = new CompiledMethodScope(si2, mi as MethodInfo, this).si;
                                syms.Add(si2);
                            }
                            break;
                        case MemberTypes.Field:
                            {
                                if ((mi as FieldInfo).IsStatic && !(mi as FieldInfo).IsSpecialName)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Field, null);
                                    if ((mi as FieldInfo).IsLiteral) si2.kind = SymbolKind.Constant;
                                    si2 = new CompiledFieldScope(si2, mi as FieldInfo, this).si;
                                    syms.Add(si2);
                                }
                            }
                            break;
                        case MemberTypes.Property:
                            {
                                PropertyInfo pi = mi as PropertyInfo;
                                MethodInfo acc_mi = pi.GetGetMethod(true);
                                if (acc_mi != null && acc_mi.IsStatic)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Property, null);
                                    si2 = new CompiledPropertyScope(si2, mi as PropertyInfo, this).si;
                                    syms.Add(si2);
                                }
                            }
                            break;
                        case MemberTypes.Event:
                            {
                                MethodInfo acc_mi = (mi as EventInfo).GetAddMethod(true);
                                if (acc_mi.IsPublic && acc_mi.IsStatic)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Event, null);
                                    si2 = new CompiledEventScope(si2, mi as EventInfo, this).si;
                                    syms.Add(si2);
                                }
                                //syms.Add(new SymInfo(mi.Name,SymbolKind.Event,mi.Name));
                            }
                            break;
                    }

            return syms.ToArray();
        }
Exemple #3
0
 public override SymInfo[] GetNamesAsInObject(ExpressionVisitor ev)
 {
     List<SymInfo> syms = new List<SymInfo>();
     if (!CodeCompletionController.CurrentParser.LanguageInformation.IncludeDotNetEntities)
         return syms.ToArray();
     MemberInfo[] mis = ctn.GetMembers(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
     List<MemberInfo> members = new List<MemberInfo>();
     members.AddRange(mis);
     IEnumerable<MemberInfo> en = PascalABCCompiler.NetHelper.NetHelper.GetExtensionMethods(ctn);
     members.AddRange(en);
     mis = members.ToArray();
     if (ctn.IsInterface)
     {
         List<MemberInfo> mems = new List<MemberInfo>();
         mems.AddRange(mis);
         mems.AddRange(typeof(object).GetMembers(BindingFlags.Public | BindingFlags.Instance));
         Type[] types = ctn.GetInterfaces();
         foreach (Type t in types)
             mems.AddRange(t.GetMembers(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy));
         mis = mems.ToArray();
     }
     foreach (MemberInfo mi in mis)
         if (!mi.Name.Contains("$"))
             switch (mi.MemberType)
             {
                 case MemberTypes.Method: if (!(mi as MethodInfo).IsSpecialName)
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                         si2 = new CompiledMethodScope(si2, mi as MethodInfo, this).si;
                         if (si2.acc_mod == access_modifer.protected_modifer)
                         {
                             if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                 syms.Add(si2);
                         }
                         else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                             syms.Add(si2);
                     }
                     break;
                 case MemberTypes.Field:
                     {
                         if (!(mi as FieldInfo).IsSpecialName)
                         {
                             SymInfo si2 = new SymInfo(null, SymbolKind.Field, null);
                             if ((mi as FieldInfo).IsLiteral) si2.kind = SymbolKind.Constant;
                             si2 = new CompiledFieldScope(si2, mi as FieldInfo, this).si;
                             if (si2.acc_mod == access_modifer.protected_modifer)
                             {
                                 if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                     syms.Add(si2);
                             }
                             else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                 syms.Add(si2);
                         }
                     }
                     break;
                 case MemberTypes.Property:
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Property, null);
                         si2 = new CompiledPropertyScope(si2, mi as PropertyInfo, this).si;
                         if (si2.acc_mod == access_modifer.protected_modifer)
                         {
                             if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                 syms.Add(si2);
                         }
                         else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                             syms.Add(si2);
                     }
                     break;
                 case MemberTypes.Event:
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Event, null);
                         si2 = new CompiledEventScope(si2, mi as EventInfo, this).si;
                         if (si2.acc_mod == access_modifer.protected_modifer)
                         {
                             if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                 syms.Add(si2);
                         }
                         else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                             syms.Add(si2);
                     }
                     break;
             }
     if (implemented_interfaces != null && false)
     {
         foreach (TypeScope ts in implemented_interfaces)
             syms.AddRange(ts.GetNamesAsInObject(ev));
     }
     return syms.ToArray();
 }
Exemple #4
0
        public SymInfo[] GetStaticNames()
        {
            List<SymInfo> syms = new List<SymInfo>();
            if (!CodeCompletionController.CurrentParser.LanguageInformation.IncludeDotNetEntities)
                return syms.ToArray();
            MemberInfo[] mis = ctn.GetMembers(BindingFlags.Public | BindingFlags.NonPublic |/*BindingFlags.Instance|*/BindingFlags.Static | BindingFlags.FlattenHierarchy);

            if (ctn.IsInterface)
            {
                return syms.ToArray();
            }
            foreach (MemberInfo mi in mis)
                if (!mi.Name.Contains("$"))
                    switch (mi.MemberType)
                    {
                        case MemberTypes.Method: if (!(mi as MethodInfo).IsSpecialName && (mi as MethodInfo).IsStatic)
                            {
                                SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                                CompiledMethodScope member = new CompiledMethodScope(si2, mi as MethodInfo, this);
                                si2 = member.si;
                                if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                    syms.Add(si2);
                            }
                            break;
                        case MemberTypes.Field:
                            {
                                if (!(mi as FieldInfo).IsSpecialName && (mi as FieldInfo).IsStatic)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Field, null);
                                    if ((mi as FieldInfo).IsLiteral) si2.kind = SymbolKind.Constant;
                                    si2 = new CompiledFieldScope(si2, mi as FieldInfo, this).si;
                                    if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                        syms.Add(si2);
                                }
                            }
                            break;
                        case MemberTypes.Constructor:
                            {
                                SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                                CompiledConstructorScope member = new CompiledConstructorScope(si2, mi as ConstructorInfo, this);
                                si2 = member.si;
                                if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                    syms.Add(si2);
                            }
                            break;
                        case MemberTypes.Property:
                            {
                                PropertyInfo pi = mi as PropertyInfo;
                                if (pi.GetGetMethod(true) != null && pi.GetGetMethod(true).IsStatic)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Property, null);
                                    si2 = new CompiledPropertyScope(si2, mi as PropertyInfo, this).si;
                                    if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                        syms.Add(si2);
                                }
                            }
                            break;
                        case MemberTypes.Event:
                            {
                                MethodInfo acc_mi = (mi as EventInfo).GetAddMethod(true);
                                if (acc_mi != null && acc_mi.IsStatic)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Event, null);
                                    si2 = new CompiledEventScope(si2, mi as EventInfo, this).si;
                                    syms.Add(si2);
                                    if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                        syms.Add(si2);
                                }
                            }
                            break;
                        case MemberTypes.NestedType:
                            {
                                if ((mi as Type).IsNestedPublic)
                                {
                                    SymInfo si2 = new SymInfo(null, SymbolKind.Type, null);
                                    CompiledScope member = TypeTable.get_compiled_type(si2, mi as Type);
                                    si2 = member.si;
                                    syms.Add(si2);
                                }
                            }
                            break;
                    }
            return syms.ToArray();
        }
Exemple #5
0
 public override SymInfo[] GetNames(ExpressionVisitor ev, PascalABCCompiler.Parsers.KeywordKind keyword, bool called_in_base)
 {
     List<SymInfo> syms = new List<SymInfo>();
     if (!CodeCompletionController.CurrentParser.LanguageInformation.IncludeDotNetEntities)
         return syms.ToArray();
     MemberInfo[] mis = ctn.GetMembers(BindingFlags.Public | BindingFlags.NonPublic |/*BindingFlags.Instance|*/BindingFlags.Static | BindingFlags.FlattenHierarchy);
     List<MemberInfo> constrs = new List<MemberInfo>();
     //constrs.AddRange(ctn.GetNestedTypes(BindingFlags.Public));
     //if (ctn != typeof(object))
     ConstructorInfo[] cis = ctn.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
     foreach (ConstructorInfo ci in cis)
         if (!called_in_base)
             constrs.Add(ci);
         else if (ci.GetParameters().Length > 0)
             constrs.Add(ci);
     constrs.AddRange(mis);
     //constrs.AddRange(PascalABCCompiler.NetHelper.NetHelper.GetExtensionMethods(ctn));
     mis = constrs.ToArray();
     if (ctn.IsInterface)
     {
         return syms.ToArray();
     }
     foreach (MemberInfo mi in mis)
         if (!mi.Name.Contains("$"))
             switch (mi.MemberType)
             {
                 case MemberTypes.Method: if (!(mi as MethodInfo).IsSpecialName && (mi as MethodInfo).IsStatic)
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                         CompiledMethodScope member = new CompiledMethodScope(si2, mi as MethodInfo, this);
                         si2 = member.si;
                         if (si2.acc_mod == access_modifer.protected_modifer)
                         {
                             if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                 syms.Add(si2);
                         }
                         else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                             syms.Add(si2);
                     }
                     break;
                 case MemberTypes.Field:
                     {
                         if (!(mi as FieldInfo).IsSpecialName && (mi as FieldInfo).IsStatic)
                         {
                             SymInfo si2 = new SymInfo(null, SymbolKind.Field, null);
                             if ((mi as FieldInfo).IsLiteral) si2.kind = SymbolKind.Constant;
                             si2 = new CompiledFieldScope(si2, mi as FieldInfo, this).si;
                             if (si2.acc_mod == access_modifer.protected_modifer)
                             {
                                 if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                     syms.Add(si2);
                             }
                             else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                 syms.Add(si2);
                         }
                     }
                     break;
                 case MemberTypes.Constructor:
                     {
                         SymInfo si2 = new SymInfo(null, SymbolKind.Method, null);
                         CompiledConstructorScope member = new CompiledConstructorScope(si2, mi as ConstructorInfo, this);
                         si2 = member.si;
                         if (si2.acc_mod == access_modifer.protected_modifer)
                         {
                             if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                 syms.Add(si2);
                         }
                         else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                             syms.Add(si2);
                     }
                     break;
                 case MemberTypes.Property:
                     {
                         PropertyInfo pi = mi as PropertyInfo;
                         if (pi.GetGetMethod(true) != null && pi.GetGetMethod(true).IsStatic)
                         {
                             SymInfo si2 = new SymInfo(null, SymbolKind.Property, null);
                             si2 = new CompiledPropertyScope(si2, mi as PropertyInfo, this).si;
                             if (si2.acc_mod == access_modifer.protected_modifer)
                             {
                                 if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                     syms.Add(si2);
                             }
                             else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                 syms.Add(si2);
                         }
                     }
                     break;
                 case MemberTypes.Event:
                     {
                         MethodInfo acc_mi = (mi as EventInfo).GetAddMethod(true);
                         if (acc_mi != null && acc_mi.IsStatic)
                         {
                             SymInfo si2 = new SymInfo(null, SymbolKind.Event, null);
                             si2 = new CompiledEventScope(si2, mi as EventInfo, this).si;
                             syms.Add(si2);
                             if (si2.acc_mod == access_modifer.protected_modifer)
                             {
                                 if (ev.CheckForBaseAccess(ev.entry_scope, this))
                                     syms.Add(si2);
                             }
                             else if (si2.acc_mod != access_modifer.private_modifer && si2.acc_mod != access_modifer.internal_modifer)
                                 syms.Add(si2);
                         }
                     }
                     break;
                 case MemberTypes.NestedType:
                     {
                         if ((mi as Type).IsNestedPublic)
                         {
                             SymInfo si2 = new SymInfo(null, SymbolKind.Type, null);
                             CompiledScope member = TypeTable.get_compiled_type(si2, mi as Type);
                             si2 = member.si;
                             syms.Add(si2);
                         }
                     }
                     break;
             }
     return syms.ToArray();
 }
Exemple #6
0
 public override SymScope FindName(string s)
 {
     string full_name = name + "." + s;
     bool is_ns = PascalABCCompiler.NetHelper.NetHelper.IsNetNamespace(full_name);
     if (is_ns)
     {
         return new NamespaceScope(full_name);
     }
     else
     {
         Type t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name);
         if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name + PascalABCCompiler.TreeConverter.compiler_string_consts.generic_params_infix + "1");
         if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType(full_name + PascalABCCompiler.TreeConverter.compiler_string_consts.generic_params_infix + "2");
         if (t != null)
         {
             return TypeTable.get_compiled_type(new SymInfo(s, SymbolKind.Type, full_name), t);
         }
         else
         {
             PascalABCCompiler.TreeConverter.SymbolInfo si = null;
             if (entry_type != null)
             {
                 t = PascalABCCompiler.NetHelper.NetHelper.FindType(entry_type.ctn.Namespace + "." + s);
                 if (t != null) return TypeTable.get_compiled_type(new SymInfo(s, SymbolKind.Type, entry_type.ctn.Namespace + "." + s), t);
                 else
                 {
                     object[] attrs = entry_type.ctn.GetCustomAttributes(false);
                     for (int j = 0; j < attrs.Length; j++)
                         if (attrs[j].GetType().Name == "$GlobAttr")
                         {
                             si = PascalABCCompiler.NetHelper.NetHelper.FindName(entry_type.ctn, s);
                             if (si != null) break;
                         }
                 }
             }
             if (si != null)
                 switch (si.sym_info.semantic_node_type)
                 {
                     case semantic_node_type.compiled_function_node:
                         {
                             CompiledMethodScope cms = new CompiledMethodScope(new SymInfo(s, SymbolKind.Method, s), (si.sym_info as compiled_function_node).method_info, entry_type, true);
                             si = si.Next;
                             CompiledMethodScope tmp = cms;
                             SortedDictionary<int, List<CompiledMethodScope>> meths = new SortedDictionary<int, List<CompiledMethodScope>>();
                             if (cms.acc_mod != access_modifer.internal_modifer && cms.acc_mod != access_modifer.private_modifer)
                             {
                                 int par_num = cms.mi.GetParameters().Length;
                                 meths[par_num] = new List<CompiledMethodScope>();
                                 meths[par_num].Add(cms);
                             }
                             while (si != null)
                             {
                                 if (si.access_level != PascalABCCompiler.TreeConverter.access_level.al_internal && si.access_level != PascalABCCompiler.TreeConverter.access_level.al_private && si.sym_info.semantic_node_type == semantic_node_type.compiled_function_node)
                                 {
                                     tmp = new CompiledMethodScope(new SymInfo(s, SymbolKind.Method, s), (si.sym_info as compiled_function_node).method_info, entry_type);
                                     tmp.is_global = true;
                                     //tmp.nextProc = cms;
                                     //cms = tmp;
                                     int par_num = tmp.mi.GetParameters().Length;
                                     if (!meths.ContainsKey(par_num))
                                         meths[par_num] = new List<CompiledMethodScope>();
                                     meths[par_num].Add(tmp);
                                 }
                                 si = si.Next;
                             }
                             bool beg = false;
                             tmp = null;
                             cms = null;
                             foreach (List<CompiledMethodScope> lst in meths.Values)
                             {
                                 foreach (CompiledMethodScope m in lst)
                                 {
                                     if (beg == false)
                                     {
                                         tmp = m;
                                         cms = tmp;
                                         beg = true;
                                     }
                                     else
                                     {
                                         tmp.nextProc = m;
                                         tmp = tmp.nextProc as CompiledMethodScope;
                                     }
                                 }
                             }
                             return cms;
                         }
                     case semantic_node_type.compiled_variable_definition:
                         if (si.access_level != PascalABCCompiler.TreeConverter.access_level.al_internal && si.access_level != PascalABCCompiler.TreeConverter.access_level.al_private)
                         {
                             CompiledFieldScope fld = new CompiledFieldScope(new SymInfo(s, SymbolKind.Field, s), (si.sym_info as compiled_variable_definition).compiled_field, entry_type, true);
                             return fld;
                         }
                         break;
                     case semantic_node_type.compiled_class_constant_definition:
                         if (si.access_level != PascalABCCompiler.TreeConverter.access_level.al_internal && si.access_level != PascalABCCompiler.TreeConverter.access_level.al_private)
                         {
                             CompiledFieldScope fld = new CompiledFieldScope(new SymInfo(s, SymbolKind.Constant, s), (si.sym_info as compiled_class_constant_definition).field, entry_type, true);
                             return fld;
                         }
                         break;
                 }
         }
         return null;
     }
 }