public PropertyDeclaration(TypeContainer parent, FullNamedExpression type, Modifiers mod, MemberName name, VSharpAttributes attrs) : base(parent, type, mod, parent is InterfaceDeclaration ? AllowedModifiersInterface : parent is StructDeclaration? AllowedModifiersStruct : AllowedModifiersClass, name, attrs, SymbolKind.Property) { }
public OperatorDeclaration(TypeContainer parent, VSC.TypeSystem.Resolver.OperatorType type, FullNamedExpression ret_type, Modifiers mod_flags, ParametersCompiled parameters, ToplevelBlock block, VSharpAttributes attrs, Location loc) : base(parent, ret_type, mod_flags, AllowedModifiers, new MemberName(VSC.TypeSystem.Resolver.ResolveContext.GetMetadataName(type), loc), parameters, attrs, SymbolKind.Operator) { OperatorType = type; this.block = block; }
public DelegateDeclaration(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, ParametersCompiled param_list, VSharpAttributes attrs, CompilationSourceFile file) : base(parent, mod_flags | Modifiers.SEALED, AllowedModifiers, name, attrs, name.Location, TypeKind.Delegate, file) { BaseTypes.Add(KnownTypeReference.MulticastDelegate); this.ReturnType = type; parameters = param_list; List <IUnresolvedParameter> uparameters = new List <IUnresolvedParameter>(); foreach (Parameter p in param_list.parameters) { uparameters.Add(p); } AddDefaultMethodsToDelegate(type as ITypeReference, uparameters); if (attrs != null) { IUnresolvedMethod invokeMethod = (IUnresolvedMethod)Members.Single(m => m.Name == "Invoke"); foreach (IUnresolvedAttribute attr in attrs.Attrs.Where(x => x.ExplicitTarget == "ret").ToList()) { invokeMethod.ReturnTypeAttributes.Add(attr); } } }
public MethodDeclaration(TypeContainer parent, FullNamedExpression returnType, Modifiers mod, MemberName name, ParametersCompiled parameters, VSharpAttributes attrs) : base(parent, returnType, mod, parent is InterfaceDeclaration ? AllowedModifiersInterface : parent is StructDeclaration ? AllowedModifiersStruct : AllowedModifiersClass, name, parameters, attrs, SymbolKind.Method) { SetTypeParameters(name); }
public void AddAttributes(VSharpAttributes attr) { if (attr != null) { foreach (var att in attr.Attrs) { moduleAttributes.Add(att); } } }
public PropertyOrIndexer(TypeContainer parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, VSharpAttributes attrs, SymbolKind sym) : base(parent, type, mod, allowed_mod, name, attrs, sym) { this.SymbolKind = SymbolKind.Property; this.DeclaringTypeDefinition = parent; this.Name = name.Name; if (parent != null) { this.UnresolvedFile = parent.UnresolvedFile; } }
public MethodCore(TypeContainer parent, FullNamedExpression returnType, Modifiers mod, Modifiers allowed, MemberName name, ParametersCompiled parameters, VSharpAttributes attrs, SymbolKind sym) : base(parent, returnType, mod, allowed, name, attrs, sym) { this.DeclaringTypeDefinition = parent; this.Name = name.Name; if (parent != null) { this.UnresolvedFile = parent.UnresolvedFile; } this.typeParameters = new List <IUnresolvedTypeParameter>(); this.aparameters = parameters; this.parameters = aparameters.parameters; }
protected MemberContainer(TypeContainer parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, Modifiers def_mod, MemberName name, VSharpAttributes attrs, SymbolKind sym) { caching_flags = Flags.Obsolete_Undetected; this.SymbolKind = sym; this.Parent = parent; this.declaringTypeDefinition = parent; this.name = name.Name; if (parent != null) { this.UnresolvedFile = parent.UnresolvedFile; } this.type_expr = type; this.attribs = attrs; member_name = name; mod_flags = mod; mod_flags = ModifiersExtensions.Check(allowed_mod, mod, def_mod, name.Location, Report); if (DeclaringTypeDefinition.Kind == TypeKind.Interface) { mod_flags |= Modifiers.PUBLIC | Modifiers.ABSTRACT; } if (attrs != null) { foreach (var a in attrs.Attrs) { this.attributes.Add(a); } } this.returnType = type as ITypeReference; if (member_name.ExplicitInterface != null) { ApplyExplicit(null); } }
public EnumMemberDeclaration(EnumDeclaration parent, MemberName name, VSharpAttributes attrs) : base(parent, parent as ITypeReference, Modifiers.PUBLIC, name, attrs) { }
public ClassOrStructDeclaration(TypeContainer 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 AddEventAccessor(EventDeclaration method, Modifiers mods, VSharpAttributes attrs, Location loc) : base(method, AddPrefix, mods, attrs, loc) { }
public EnumDeclaration(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, VSharpAttributes attrs, CompilationSourceFile file) : base(parent, mod_flags, AllowedModifiers, name, attrs, name.Location, TypeKind.Enum, file) { if (type != null) { SetBaseTypes(type); } mod_flags |= Modifiers.SEALED; }
public FieldDeclaration(TypeContainer parent, FullNamedExpression type, Modifiers mods, Modifiers allowed, MemberName name, VSharpAttributes attr) : base(parent, type, mods, allowed, name, attr, SymbolKind.Field) { }
public ConstantDeclaration(TypeContainer parent, FullNamedExpression type, Modifiers mods, MemberName name, VSharpAttributes attr) : base(parent, type, mods, AllowedModifiers, name, attr, SymbolKind.Field) { mod_flags |= Modifiers.STATIC; }
// // If true, this is an explicit interface implementation // protected InterfaceMemberContainer(TypeContainer parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, VSharpAttributes attrs, SymbolKind sym) : base(parent, type, mod, allowed_mod, Modifiers.PRIVATE, name, attrs, sym) { IsInterfaceMember = parent.Kind == TypeKind.Interface; }
public StructDeclaration(TypeContainer parent, MemberName name, Modifiers mod, VSharpAttributes attrs, Location l, CompilationSourceFile file) : base(parent, mod, AllowedModifiers, name, attrs, l, TypeKind.Struct, file) { mod_flags |= Modifiers.SEALED; }
public ClassDeclaration(PackageContainer parent, MemberName name, Modifiers mod, VSharpAttributes attrs, Location l, CompilationSourceFile file) : base(parent, mod, AllowedModifiers, name, attrs, l, TypeKind.Class, file) { }
public GetterDeclaration(PropertyOrIndexer method, Modifiers modifiers, ParametersCompiled par, VSharpAttributes attrs, Location loc) : base(method, method.TypeExpression, modifiers, "get_", par, attrs, loc) { }
public FieldContainer(TypeContainer parent, FullNamedExpression type, Modifiers mods, Modifiers allowed, MemberName name, VSharpAttributes attr, SymbolKind sym) : base(parent, type, mods, allowed, Modifiers.PRIVATE, name, attr, sym) { if ((mods & Modifiers.ABSTRACT) != 0) { Report.Error(233, Location, "The modifier 'abstract' is not valid on fields. Try using a property instead"); } }
public EventDeclaration(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, VSharpAttributes attrs, bool autogen = false) : base(parent, type, mod_flags, name, attrs) { IsAutoGenerated = autogen; }
public ConstructorDeclaration(TypeContainer parent, string name, Modifiers mod, VSharpAttributes attrs, ParametersCompiled args, Location loc) : base(parent, new TypeExpression(parent, loc), mod, AllowedModifiers, new MemberName(name, loc), args, attrs, SymbolKind.Constructor) { }
public TypeDeclaration(TypeContainer 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, ns.Name == "default" ? Modifiers.INTERNAL : Modifiers.PRIVATE, l, Report); this.Kind = kind; }
public DestructorDeclaration(TypeContainer parent, Modifiers mod, ParametersCompiled parameters, VSharpAttributes attrs, Location l) : base(parent, new TypeExpression(KnownTypeReference.Void, l), mod, AllowedModifiers, new MemberName(MetadataName, l), parameters, attrs, SymbolKind.Destructor) { ModFlags &= ~Modifiers.PRIVATE; ModFlags |= Modifiers.PROTECTED | Modifiers.OVERRIDE; }
public PropertyMethod(PropertyBasedMember method, FullNamedExpression returnType, Modifiers modifiers, string prefix, ParametersCompiled parameters, VSharpAttributes attrs, Location loc) : base(method, returnType, modifiers, AllowedModifiers, prefix, parameters, attrs, loc) { }
public IndexerDeclaration(TypeContainer parent, FullNamedExpression type, MemberName name, Modifiers mod, ParametersCompiled parameters, VSharpAttributes attrs) : base(parent, type, mod, parent is InterfaceDeclaration ? AllowedInterfaceModifiers : AllowedModifiers, name, attrs, SymbolKind.Indexer) { this.parameters = parameters; }
protected PropertyBasedMember(TypeContainer parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, VSharpAttributes attrs, SymbolKind sym) : base(parent, type, mod, allowed_mod, name, attrs, sym) { }
public ConstantDeclaration(TypeContainer parent, ITypeReference type, Modifiers mods, MemberName name, VSharpAttributes attr) : base(parent, new TypeExpression(type, name.Location), mods, AllowedModifiers, name, attr, SymbolKind.Field) { mod_flags |= Modifiers.STATIC; }
public IndexerSetterDeclaration(PropertyOrIndexer property, Modifiers modifiers, ParametersCompiled parameters, VSharpAttributes attrs, Location loc) : base(property, modifiers, parameters, attrs, loc) { }
public Parameter(FullNamedExpression type, string name, ParameterModifier mods, VSharpAttributes attr, Location loc) : this(type as ITypeReference, name, loc) { if ((mods & ParameterModifier.Out) == ParameterModifier.Out) { IsOut = true; CompilerContext.InternProvider.Intern(new ByReferenceTypeReference(this.type)); } if ((mods & ParameterModifier.Ref) == ParameterModifier.Ref) { IsRef = true; CompilerContext.InternProvider.Intern(new ByReferenceTypeReference(this.type)); } if ((mods & ParameterModifier.Self) == ParameterModifier.Self) { IsSelf = true; } if ((mods & ParameterModifier.Params) == ParameterModifier.Params) { IsParams = true; } if (attr != null) { foreach (var a in attr.Attrs) { this.attributes.Add(a); } } }
public FieldDeclaration(TypeContainer parent, FullNamedExpression type, Modifiers mods, MemberName name, VSharpAttributes attr) : this(parent, type, mods, AllowedFieldModifiers, name, attr) { }