本文整理匯總了C#中Analyzer.DefineConstructedTypeBuilders方法的典型用法代碼示例。如果您正苦於以下問題:C# Analyzer.DefineConstructedTypeBuilders方法的具體用法?C# Analyzer.DefineConstructedTypeBuilders怎麽用?C# Analyzer.DefineConstructedTypeBuilders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Analyzer
的用法示例。
在下文中一共展示了Analyzer.DefineConstructedTypeBuilders方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Compile
/// <summary>
/// Compiles the transient unit. 'PreCompile' should be called first!
/// </summary>
internal bool Compile(CompilationContext/*!*/ context, EvalKinds kind)
{
Analyzer analyzer = null;
try
{
analyzer = new Analyzer(context);
// perform pre-analysis on types and functions:
if (types != null)
analyzer.PreAnalyze(types.Values);
if (functions != null)
analyzer.PreAnalyze(functions.Values);
// perform member analysis on types and functions:
if (types != null)
analyzer.AnalyzeMembers(types.Values);
if (functions != null)
analyzer.AnalyzeMembers(functions.Values);
if (context.Errors.AnyFatalError) return false;
// perform full analysis:
analyzer.Analyze(sourceUnit);
if (context.Errors.AnyFatalError) return false;
// perform post analysis:
analyzer.PostAnalyze();
}
catch (CompilerException)
{
return false;
}
finally
{
resolvingScriptContext = null;
referringType = null;
}
// do not emit anything if there was parse/analysis error:
if (context.Errors.AnyError) return false;
DefineBuilders();
// define constructed types:
analyzer.DefineConstructedTypeBuilders();
CodeGenerator cg = new CodeGenerator(context);
sourceUnit.Emit(cg);
return true;
}