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;
20 public class VBModule : Class
22 public new const int AllowedModifiers = Modifiers.PUBLIC |Modifiers.INTERNAL;
24 public VBModule (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod,
25 Attributes attrs, Location l)
26 : base (ns, parent, name, 0, attrs, l)
29 if (parent.Parent != null)
30 Report.Error (30617, l,
31 "'Module' statements can occur only at file or namespace level");
34 this.ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.INTERNAL, l);
36 // add specialized attribute
38 Mono.CSharp.Attribute standardModuleAttribute = new Mono.CSharp.Attribute(null, Expression.StringToExpression ("Microsoft.VisualBasic.CompilerServices", l), "StandardModuleAttribute", null, l);
40 ArrayList al = new ArrayList();
41 al.Add(standardModuleAttribute);
42 if (attributes == null) {
43 attributes = new Attributes(al);
45 attributes.AddAttributes(al);
50 public override TypeAttributes TypeAttr
53 return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.Sealed;