public CompilationSourceFile(ModuleContext module, SourceFile sourceFile) { this.Compiler = module.Compiler; this.file = sourceFile; RootPackage = new PackageContainer(this, module); rootUsingScope = RootPackage; }
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; }
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; }
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); }
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); } }
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); }
public void AddChildNamespace(PackageContainer nc) { _ncontainers.Add(nc); }
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) { }
public ClassDeclaration(PackageContainer parent, MemberName name, Modifiers mod, VSharpAttributes attrs, Location l, CompilationSourceFile file) : base(parent, mod, AllowedModifiers, name, attrs, l, TypeKind.Class, file) { }
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; }
protected CompilerGeneratedContainer(PackageContainer parent, MemberName name, Modifiers mod, CompilationSourceFile f) : this(parent, name, mod, TypeKind.Class, f) { }