2 // module.cs: Module handler
4 // Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
6 // Licensed under the terms of the GNU GPL
8 // (C) 2002 Rafael Teixeira
11 using System.Collections;
12 using System.Diagnostics.SymbolStore;
13 using System.Reflection;
14 using System.Reflection.Emit;
15 using System.Runtime.CompilerServices;
22 public static void AddSpecializedAttribute(ref Attributes attrs, string attributeName, ArrayList args, Location loc)
24 Mono.CSharp.Attribute specialAttr = new Mono.CSharp.Attribute(null, attributeName, args, loc); // Sudha : passed null for target
25 ArrayList al = new ArrayList();
28 attrs = new Attributes(al);
30 attrs.AddAttributes(al);
35 public class VBModule : Class
37 public new const int AllowedModifiers = Modifiers.PUBLIC |Modifiers.INTERNAL;
39 public VBModule (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod,
40 Attributes attrs, Location l)
41 : base (ns, parent, name, 0, attrs, l)
44 if (parent.Parent != null)
45 Report.Error (30617, l,
46 "'Module' statements can occur only at file or namespace level");
49 this.ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.INTERNAL, l);
51 // add specialized attribute
52 Utils.AddSpecializedAttribute(ref attributes, "Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute", null, l);
56 public override TypeAttributes TypeAttr
59 return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.Sealed;