本文整理汇总了C#中CSharpCompilation类的典型用法代码示例。如果您正苦于以下问题:C#CSharpCompilation类的具体用法?C#CSharpCompilation怎么用?C#CSharpCompilation使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:RewriteLocal
internaloverrideBoundExpressionRewriteLocal(CSharpCompilationcompilation,EENamedTypeSymbolcontainer,CSharpSyntaxNodesyntax)
{
varmethod=container.GetOrAddSynthesizedMethod(
ExpressionCompilerConstants.GetObjectAtAddressMethodName,
(c,n,s)=>
{
varparameterType=compilation.GetSpecialType(SpecialType.System_UInt64);
returnnewPlaceholderMethodSymbol(
c,
s,
n,
this.Type,
m=>ImmutableArray.Create
(newSynthesizedParameterSymbol(m,parameterType,ordinal:0,refKind:RefKind.None)));
});
varargument=newBoundLiteral(
syntax,
Microsoft.CodeAnalysis.ConstantValue.Create(_address),
method.Parameters[0].Type);
varcall=BoundCall.Synthesized(
syntax,
receiverOpt:null,
method:method,
arguments:ImmutableArray.Create(argument));
Debug.Assert(call.Type==this.Type);
returncall;
}
原文链接:http://www.jxszl.com/biancheng/C/556812.html