當前位置: 首頁>>代碼示例>>C#>>正文


C# Driver.ProcessDefaultConfig方法代碼示例

本文整理匯總了C#中Mono.CSharp.Driver.ProcessDefaultConfig方法的典型用法代碼示例。如果您正苦於以下問題:C# Driver.ProcessDefaultConfig方法的具體用法?C# Driver.ProcessDefaultConfig怎麽用?C# Driver.ProcessDefaultConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mono.CSharp.Driver的用法示例。


在下文中一共展示了Driver.ProcessDefaultConfig方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Init

		/// <summary>
		///   Optional initialization for the Evaluator.
		/// </summary>
		/// <remarks>
		///  Initializes the Evaluator with the command line options
		///  that would be processed by the command line compiler.  Only
		///  the first call to Init will work, any future invocations are
		///  ignored.
		///
		///  You can safely avoid calling this method if your application
		///  does not need any of the features exposed by the command line
		///  interface.
		/// </remarks>
		public static void Init (string [] args)
		{
			lock (evaluator_lock){
				if (inited)
					return;
				
				RootContext.Version = LanguageVersion.Default;
				driver = Driver.Create (args, false);
				if (driver == null)
					throw new Exception ("Failed to create compiler driver with the given arguments");
				
				driver.ProcessDefaultConfig ();
				CompilerCallableEntryPoint.Reset ();
				Driver.LoadReferences ();
				RootContext.EvalMode = true;
				inited = true;
			}
		}
開發者ID:lewurm,項目名稱:benchmarker,代碼行數:31,代碼來源:eval.cs

示例2: InitAndGetStartupFiles

		/// <summary>
		///   Optional initialization for the Evaluator.
		/// </summary>
		/// <remarks>
		///  Initializes the Evaluator with the command line
		///  options that would be processed by the command
		///  line compiler.  Only the first call to
		///  InitAndGetStartupFiles or Init will work, any future
		///  invocations are ignored.
		///
		///  You can safely avoid calling this method if your application
		///  does not need any of the features exposed by the command line
		///  interface.
		///
		///  This method return an array of strings that contains any
		///  files that were specified in `args'.
		/// </remarks>
		public static string [] InitAndGetStartupFiles (string [] args)
		{
			lock (evaluator_lock){
				if (inited)
					return new string [0];
				
				driver = Driver.Create (args, false, new ConsoleReportPrinter ());
				if (driver == null)
					throw new Exception ("Failed to create compiler driver with the given arguments");

				ctx = driver.ctx;

				RootContext.ToplevelTypes = new ModuleCompiled (ctx, true);
				
				driver.ProcessDefaultConfig ();

				var startup_files = new List<string> ();
				foreach (CompilationUnit file in Location.SourceFiles)
					startup_files.Add (file.Path);
				
				CompilerCallableEntryPoint.Reset ();
				RootContext.ToplevelTypes = new ModuleCompiled (ctx, true);
				var ctypes = TypeManager.InitCoreTypes ();

				ctx.MetaImporter.Initialize ();
				driver.LoadReferences ();
				TypeManager.InitCoreTypes (ctx, ctypes);
				TypeManager.InitOptionalCoreTypes (ctx);

				RootContext.EvalMode = true;
				inited = true;

				return startup_files.ToArray ();
			}
		}
開發者ID:silk,項目名稱:monodevelop,代碼行數:52,代碼來源:eval.cs

示例3: InitAndGetStartupFiles

		/// <summary>
		///   Optional initialization for the Evaluator.
		/// </summary>
		/// <remarks>
		///  Initializes the Evaluator with the command line
		///  options that would be processed by the command
		///  line compiler.  Only the first call to
		///  InitAndGetStartupFiles or Init will work, any future
		///  invocations are ignored.
		///
		///  You can safely avoid calling this method if your application
		///  does not need any of the features exposed by the command line
		///  interface.
		///
		///  This method return an array of strings that contains any
		///  files that were specified in `args'.
		/// </remarks>
		public static string [] InitAndGetStartupFiles (string [] args)
		{
			lock (evaluator_lock){
				if (inited)
					return new string [0];
				
				driver = Driver.Create (args, false, new ConsoleReportPrinter ());
				if (driver == null)
					throw new Exception ("Failed to create compiler driver with the given arguments");

				RootContext.ToplevelTypes = new ModuleContainer (ctx, true);
				
				driver.ProcessDefaultConfig ();

				ArrayList startup_files = new ArrayList ();
				foreach (CompilationUnit file in Location.SourceFiles)
					startup_files.Add (file.Path);
				
				CompilerCallableEntryPoint.Reset ();
				RootContext.ToplevelTypes = new ModuleContainer (ctx, true);

				driver.LoadReferences ();
				RootContext.EvalMode = true;
				inited = true;

				return (string []) startup_files.ToArray (typeof (string));
			}
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:45,代碼來源:eval.cs


注:本文中的Mono.CSharp.Driver.ProcessDefaultConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。