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();
27 AttributeSection asec = new AttributeSection(null, al);
29 attrs = new Attributes(asec, loc);
31 attrs.AddAttribute(asec);
36 /// Summary description for module.
38 public class Module : Mono.MonoBASIC.Class
41 // Modifiers allowed in a class declaration
43 public new const int AllowedModifiers =
48 public Module(TypeContainer parent, string name, int mod, Attributes attrs, Location l)
49 : base (parent, name, 0, null, l)
51 if (parent.Parent != null)
52 Report.Error (30617, l,
53 "'Module' statements can occur only at file or namespace level");
56 this.ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.INTERNAL, l);
58 // add specialized attribute
59 Utils.AddSpecializedAttribute(ref attrs, "Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute", null, l);
60 this.attributes = attrs;
64 // FIXME: How do we deal with the user specifying a different
67 public override TypeAttributes TypeAttr
71 return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.Sealed;