+2005-11-02 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * typemanager.cs: avoiding some Null Pointer Exceptions in GetPertinentStandardModules
+
2005-11-01 Aldo Monteiro do Nascimento <aldo@psl-pr.softwarelivre.org>
* mb-parser.jay: created a new parser rule to match a interface
declared inside another interface: "opt_interface_declaration"
standardModules = n;
}
- ///
- /// Registers a existing 'standard module' to lookup short-qualified or unqualified members
- ///
+ //
+ // Registers an existing 'standard module' to lookup short-qualified or unqualified members
+ //
private static void AddStandardModule(Type type)
{
object[] attributes = type.GetCustomAttributes(false);
}
}
- //
- //
- //
+ /// <summary>
+ /// Find types from pertinent standard modules (from those namespaces in the scope)
+ /// <summary>
public static Type[] GetPertinentStandardModules(params string[] namespaces)
{
ArrayList list = new ArrayList();
- foreach(string Namespace in namespaces)
- {
- for(int i = 0; i < standardModules.Length; i++) {
- if (standardModules[i].Namespace.ToLower () == Namespace.ToLower ()) {
- string name = standardModules[i].ToString();
- Type t = LookupType(name);
- if (t == null) {
- System.Console.WriteLine("Could not find standard module '" + name + "'");
- }
- else {
- list.Add(t);
+ if (standardModules != null && namespaces != null) {
+ foreach(string Namespace in namespaces)
+ {
+ for(int i = 0; i < standardModules.Length; i++) {
+ if (standardModules[i].Namespace.ToLower () == Namespace.ToLower ()) {
+ string name = standardModules[i].ToString();
+ Type t = LookupType(name);
+ if (t == null) {
+ System.Console.WriteLine("Could not find standard module '" + name + "'");
+ }
+ else {
+ list.Add(t);
+ }
}
}
}