//
// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)
// Copyright 2004, 2005, 2006, 2007, 2008 Novell, Inc
+// Copyright 2011 Xamarin Inc
//
using System;
}
}
- void Parse (CompilationSourceFile file, ModuleContainer module)
+ public void Parse (CompilationSourceFile file, ModuleContainer module)
{
Stream input;
public void Parse (SeekableStreamReader reader, CompilationSourceFile file, ModuleContainer module)
{
- file.NamespaceContainer = new NamespaceEntry (module, null, file, null);
+ file.NamespaceContainer = new NamespaceContainer (null, module, null, file);
CSharpParser parser = new CSharpParser (reader, file);
parser.parse ();
return true;
}
- if (RootContext.ToplevelTypes.NamespaceEntry != null)
- throw new InternalErrorException ("who set it?");
-
var output_file = settings.OutputFile;
string output_file_name;
if (output_file == null) {
references_loader.LoadReferences (module);
tr.Start (TimeReporter.TimerType.PredefinedTypesInit);
- if (!ctx.BuildinTypes.CheckDefinitions (module))
+ if (!ctx.BuiltinTypes.CheckDefinitions (module))
return false;
tr.Stop (TimeReporter.TimerType.PredefinedTypesInit);
var assembly = new AssemblyDefinitionDynamic (module, output_file_name, output_file);
module.SetDeclaringAssembly (assembly);
- var importer = new ReflectionImporter (module, ctx.BuildinTypes);
+ var importer = new ReflectionImporter (module, ctx.BuiltinTypes);
assembly.Importer = importer;
var loader = new DynamicLoader (importer, ctx);
loader.LoadReferences (module);
- if (!ctx.BuildinTypes.CheckDefinitions (module))
+ if (!ctx.BuiltinTypes.CheckDefinitions (module))
return false;
if (!assembly.Create (AppDomain.CurrentDomain, AssemblyBuilderAccess.Save))
tr.Start (TimeReporter.TimerType.UsingResolve);
foreach (var source_file in ctx.SourceFiles) {
- source_file.NamespaceContainer.Resolve ();
+ source_file.NamespaceContainer.Define ();
}
tr.Stop (TimeReporter.TimerType.UsingResolve);
if (Report.Errors > 0)
return false;
- if (settings.Documentation != null &&
- !settings.Documentation.OutputDocComment (
- output_file, Report))
- return false;
+ if (settings.DocumentationFile != null) {
+ var doc = new DocumentationBuilder (module);
+ doc.OutputDocComment (output_file, settings.DocumentationFile);
+ }
assembly.Resolve ();