public static ABIExitCode Compile(ABIFileSystemOptions options, LogFactory factory)
{
#region Argument exceptions
if (options == null)
throw new ArgumentNullException("options");
if (factory == null)
throw new ArgumentNullException("factory");
#endregion
_logger = factory.GetCurrentClassLogger();
_logger.Debug(options);
try
{
if (!Validate(options))
return ABIExitCode.ErrorDuringValidation;
var engine = new CompilerEngine(options, factory);
var result = engine.Compile();
Debug.Assert(result != ABIExitCode.ErrorExitCodeUnassigned);
return result;
}
catch (Exception ex) // avoid external unhandled exceptions
{
_logger.Error(ex);
}
return ABIExitCode.ErrorUnhandledException;
}