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;
16 using Mono.MonoBASIC ;
18 namespace Mono.MonoBASIC
22 public static void AddSpecializedAttribute(ref Attributes attrs, string attributeName, ArrayList args, Location loc)
24 Mono.MonoBASIC.Attribute specialAttr = new Mono.MonoBASIC.Attribute(attributeName, args, loc);
25 ArrayList al = new ArrayList();
28 attrs = new Attributes(al);
30 attrs.AddAttributes(al);
35 /// Summary description for module.
37 public class Module : Mono.MonoBASIC.Class
40 // Modifiers allowed in a class declaration
42 public new const int AllowedModifiers =
47 public Module(TypeContainer parent, string name, int mod, Attributes attrs, Location l)
48 : base (parent, name, 0, null, l)
50 if (parent.Parent != null)
51 Report.Error (30617, l,
52 "'Module' statements can occur only at file or namespace level");
55 this.ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.INTERNAL, l);
57 // add specialized attribute
58 Utils.AddSpecializedAttribute(ref attrs, "Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute", null, l);
59 this.attributes = attrs;
63 // FIXME: How do we deal with the user specifying a different
66 public override TypeAttributes TypeAttr
70 return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.Sealed;