* profiles/basic.make (do-profile-check): Make the "silent"
[mono.git] / mcs / bmcs / module.cs
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 ;
17
18 namespace Mono.CSharp
19 {
20         public class VBModule : Class
21         {
22                 public new const int AllowedModifiers = Modifiers.PUBLIC |Modifiers.INTERNAL;
23
24                 public VBModule (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod,
25                               Attributes attrs, Location l)
26                         : base (ns, parent, name, 0, attrs, l)
27
28                 {
29                         if (parent.Parent != null)
30                                 Report.Error (30617, l,
31                                         "'Module' statements can occur only at file or namespace level");
32
33                         // overwrite ModFlags
34                         this.ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.INTERNAL, l);
35
36                         // add specialized attribute
37
38                         Mono.CSharp.Attribute standardModuleAttribute = new Mono.CSharp.Attribute(null, Expression.StringToExpression ("Microsoft.VisualBasic.CompilerServices", l), "StandardModuleAttribute", null, l); 
39                         
40                         ArrayList al = new ArrayList();
41                         al.Add(standardModuleAttribute);
42                         if (attributes == null) {
43                                 attributes = new Attributes(al);
44                         } else {
45                                 attributes.AddAttributes(al);
46                         }
47                 }
48
49
50                 public override TypeAttributes TypeAttr 
51                 {
52                         get {
53                                 return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.Sealed;
54                         }
55                 }
56         }
57 }