Error_GlobalNamespaceRedefined() public static method

public static Error_GlobalNamespaceRedefined ( Mono.CSharp.Location loc, Report Report ) : void
loc Mono.CSharp.Location
Report Report
return void
Example #1
0
        //
        // Creates alias global namespace
        //
        public RootNamespace CreateRootNamespace(string alias)
        {
            if (alias == global_ns.Alias)
            {
                NamespaceEntry.Error_GlobalNamespaceRedefined(Location.Null, Report);
                return(global_ns);
            }

            RootNamespace rn;

            if (!alias_ns.TryGetValue(alias, out rn))
            {
                rn = new RootNamespace(alias);
                alias_ns.Add(alias, rn);
            }

            return(rn);
        }
Example #2
0
        public static void DefineRootNamespace(string alias, Assembly assembly)
        {
            if (alias == "global")
            {
                NamespaceEntry.Error_GlobalNamespaceRedefined(Location.Null);
                return;
            }

            RootNamespace retval = GetRootNamespace(alias);

            if (retval == null)
            {
                retval = new RootNamespace(alias);
                root_namespaces.Add(alias, retval);
            }

            retval.AddAssemblyReference(assembly);
        }