// This is only used to tell whether `System.Object' should
// have a base class or not.
//
- public static bool StdLib = true;
+ public static bool StdLib;
//
// This keeps track of the order in which classes were defined
static TypeBuilder impl_details_class;
- public static int WarningLevel = 3;
+ public static int WarningLevel;
- public static Target Target = Target.Exe;
+ public static Target Target;
public static string TargetExt = ".exe";
public static bool VerifyClsCompliance = true;
/// </summary>
public static bool Optimize = true;
- public static LanguageVersion Version = LanguageVersion.Default;
+ public static LanguageVersion Version;
//
// We keep strongname related info here because
//
public static string StrongNameKeyFile;
public static string StrongNameKeyContainer;
- public static bool StrongNameDelaySign = false;
+ public static bool StrongNameDelaySign;
//
// If set, enable XML documentation generation
//
public static Documentation Documentation;
+ static public string MainClass;
+
//
// Constructor
//
static RootContext ()
+ {
+ Reset ();
+ }
+
+ public static void Reset ()
{
tree = new Tree ();
type_container_resolve_order = new ArrayList ();
+ EntryPoint = null;
+ WarningLevel = 3;
+ Checked = false;
+ Unsafe = false;
+ StdLib = true;
+ StrongNameKeyFile = null;
+ StrongNameKeyContainer = null;
+ StrongNameDelaySign = false;
+ MainClass = null;
+ Target = Target.Exe;
+ Version = LanguageVersion.Default;
+ Documentation = null;
+ impl_details_class = null;
}
public static bool NeedsEntryPoint {
}
}
- static public string MainClass;
-
public static void RegisterOrder (TypeContainer tc)
{
type_container_resolve_order.Add (tc);
//
// The default compiler checked state
//
- static public bool Checked = false;
+ static public bool Checked;
//
// Whether to allow Unsafe code
//
- static public bool Unsafe = false;
+ static public bool Unsafe;
- static string MakeFQN (string nsn, string name)
- {
- if (nsn == "")
- return name;
- return String.Concat (nsn, ".", name);
- }
-
// <remarks>
// This function is used to resolve the hierarchy tree.
// It processes interfaces, structs and classes in that order.
ArrayList ifaces = root.Interfaces;
if (ifaces != null){
- foreach (Interface i in ifaces)
+ foreach (TypeContainer i in ifaces)
i.DefineType ();
}
object o = root.GetDefinition (name);
if (o == null){
Report.Error (518, "The predefined type `" + name + "' is not defined");
- Environment.Exit (1);
+ return;
}
if (!(o is Delegate)){
"System.Runtime.InteropServices.OutAttribute",
"System.Runtime.InteropServices.StructLayoutAttribute",
"System.Runtime.InteropServices.FieldOffsetAttribute",
+ "System.Runtime.InteropServices.DefaultCharSetAttribute",
"System.InvalidOperationException",
"System.NotSupportedException",
"System.MarshalByRefObject",
- "System.Security.CodeAccessPermission"
+ "System.Security.CodeAccessPermission",
+ "System.Runtime.CompilerServices.RequiredAttributeAttribute"
};
foreach (string cname in classes_second_stage)
if (type_container_resolve_order != null) {
foreach (TypeContainer tc in type_container_resolve_order)
tc.EmitType ();
+
+ foreach (TypeContainer tc in type_container_resolve_order)
+ tc.VerifyMembers ();
}
if (Tree.Types.Delegates != null) {