Ejemplo n.º 1
0
 public CompilationSourceFile(ModuleContext module, SourceFile sourceFile)
 {
     this.Compiler  = module.Compiler;
     this.file      = sourceFile;
     RootPackage    = new PackageContainer(this, module);
     rootUsingScope = RootPackage;
 }
Ejemplo n.º 2
0
        public TypeContainer(TypeContainer parent, MemberName name, Location l, CompilationSourceFile file)
            : base(parent, name.Name)
        {
            defined_names       = new Dictionary <string, EntityCore>();
            HasExtensionMethods = false;
            SetTypeParameters(name);
            if (parent.Name != "default")
            {
                parent.NestedTypes.Add(this);
            }
            else
            {
                parent.ParentPackageContainer.TypeContainers.Add(this);
                file.TopLevelTypeDefinitions.Add(this);
            }


            ParentPackageContainer = parent.ParentPackageContainer;
            UnresolvedFile         = file;
            this.usingScope        = parent.usingScope;
            this.AddDefaultConstructorIfRequired = true;
            GlobalTypeDefinition = false;
            loc         = l;
            Parent      = parent;
            member_name = name;
        }
Ejemplo n.º 3
0
 public TypeDeclaration(PackageContainer ns, Modifiers mods, Modifiers allowed, MemberName name, VSharpAttributes attr, Location l, TypeKind kind, CompilationSourceFile file)
     : base(ns, name, l, file)
 {
     if (attr != null)
     {
         this.AddAttributes(attr);
     }
     this.mod_flags = mods;
     this.mod_flags = ModifiersExtensions.Check(allowed, mods, Modifiers.INTERNAL, l, Report);
     this.Kind      = kind;
 }
Ejemplo n.º 4
0
        public PackageContainer(PackageContainer parent, string name, Location loc, CompilationSourceFile file)
            : base(parent, name)
        {
            Parent           = parent;
            _imports         = new List <Import>();
            _containers      = new List <TypeContainer>();
            _ncontainers     = new List <PackageContainer>();
            DefaultType      = new ClassDeclaration(this, new MemberName("default", Location.Null), Modifiers.PUBLIC | Modifiers.STATIC | Modifiers.SEALED | Modifiers.COMPILER_GENERATED, null, Location.Null, file);
            DeclarationFound = false;

            DefaultTypesContainers.Add(DefaultType);
        }
Ejemplo n.º 5
0
 public static PackageContainer CreateContainers(PackageContainer parent, MemberName mn, Location loc, CompilationSourceFile file)
 {
     if (mn.Left != null)
     {
         PackageContainer left    = CreateContainers(parent, mn.Left, loc, file);
         PackageContainer current = new PackageContainer(left, mn.Name, loc, file);
         left.AddChildNamespace(current);
         return(current);
     }
     else
     {
         var c = new PackageContainer(parent, mn.Name, loc, file);
         parent.AddChildNamespace(c);
         return(c);
     }
 }
Ejemplo n.º 6
0
 public TypeContainer(PackageContainer parent, MemberName name, Location l, CompilationSourceFile file)
     : base(parent.NamespaceName, name.Name)
 {
     defined_names = new Dictionary <string, EntityCore>();
     SetTypeParameters(name);
     HasExtensionMethods = false;
     UnresolvedFile      = file;
     this.AddDefaultConstructorIfRequired = true;
     GlobalTypeDefinition = false;
     loc = l;
     parent.TypeContainers.Add(this);
     ParentPackageContainer = parent;
     usingScope             = parent;
     member_name            = name;
     Module = parent.Module;
     file.TopLevelTypeDefinitions.Add(this);
 }
Ejemplo n.º 7
0
 public void AddChildNamespace(PackageContainer nc)
 {
     _ncontainers.Add(nc);
 }
Ejemplo n.º 8
0
 public ClassOrStructDeclaration(PackageContainer ns, Modifiers mods, Modifiers allowed, MemberName name, VSharpAttributes attr, Location l, TypeKind kind, CompilationSourceFile file)
     : base(ns, mods, allowed, name, attr, l, kind, file)
 {
 }
Ejemplo n.º 9
0
 public ClassDeclaration(PackageContainer parent, MemberName name, Modifiers mod, VSharpAttributes attrs, Location l, CompilationSourceFile file)
     : base(parent, mod, AllowedModifiers, name, attrs, l, TypeKind.Class, file)
 {
 }
Ejemplo n.º 10
0
 protected CompilerGeneratedContainer(PackageContainer parent, MemberName name, Modifiers mod, TypeKind kind, CompilationSourceFile f)
     : base(parent, mod, mod, name, null, Location.Null, kind, f)
 {
     ModFlags = mod | Modifiers.COMPILER_GENERATED | Modifiers.SEALED;
 }
Ejemplo n.º 11
0
 protected CompilerGeneratedContainer(PackageContainer parent, MemberName name, Modifiers mod, CompilationSourceFile f)
     : this(parent, name, mod, TypeKind.Class, f)
 {
 }