本文整理匯總了C#中Pchp.CodeAnalysis.CodeGen.CodeGenerator.EmitGetProperty方法的典型用法代碼示例。如果您正苦於以下問題:C# CodeGenerator.EmitGetProperty方法的具體用法?C# CodeGenerator.EmitGetProperty怎麽用?C# CodeGenerator.EmitGetProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pchp.CodeAnalysis.CodeGen.CodeGenerator
的用法示例。
在下文中一共展示了CodeGenerator.EmitGetProperty方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: EmitGetCurrent
internal void EmitGetCurrent(CodeGenerator cg, BoundReferenceExpression valueVar, BoundReferenceExpression keyVar)
{
Debug.Assert(_enumeratorLoc != null);
var enumeratorPlace = new LocalPlace(_enumeratorLoc);
if (valueVar is BoundListEx)
{
throw new NotImplementedException(); // TODO: list(vars) = enumerator.GetCurrent()
}
if (_currentValue != null && _currentKey != null)
{
// special PhpArray enumerator
if (keyVar != null)
{
//cg.EmitSequencePoint(keyVar.PhpSyntax);
var keyTarget = keyVar.BindPlace(cg);
keyTarget.EmitStorePrepare(cg);
keyTarget.EmitStore(cg, cg.EmitGetProperty(enumeratorPlace, _currentKey));
}
//cg.EmitSequencePoint(valueVar.PhpSyntax);
var valueTarget = valueVar.BindPlace(cg);
valueTarget.EmitStorePrepare(cg);
valueTarget.EmitStore(cg, cg.EmitGetProperty(enumeratorPlace, _currentValue));
}
else
{
Debug.Assert(_current != null);
if (keyVar != null)
{
throw new InvalidOperationException();
}
var valueTarget = valueVar.BindPlace(cg);
valueTarget.EmitStorePrepare(cg);
var t = cg.EmitGetProperty(enumeratorPlace, _current); // TOOD: PhpValue.FromClr
valueTarget.EmitStore(cg, t);
}
}