In ilasm/codegen:
[mcs.git] / bmcs / module.cs
blob421e022cb28f2e33bdbb7f89017ef2010e7039a1
1 //
2 // module.cs: Module handler
3 //
4 // Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
5 //
6 // Licensed under the terms of the GNU GPL
7 //
8 // (C) 2002 Rafael Teixeira
9 //
10 using System;
11 using System.Collections;
12 using System.Diagnostics.SymbolStore;
13 using System.Reflection;
14 using System.Reflection.Emit;
15 using System.Runtime.CompilerServices;
16 using Mono.CSharp ;
18 namespace Mono.CSharp
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");
33 // overwrite ModFlags
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);
44 } else {
45 attributes.AddAttributes(al);
50 public override TypeAttributes TypeAttr
52 get {
53 return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.Sealed;