本文整理汇总了C#中clojure.lang.CljCompiler.Ast.Expr.GenDlr方法的典型用法代码示例。如果您正苦于以下问题:C# Expr.GenDlr方法的具体用法?C# Expr.GenDlr怎么用?C# Expr.GenDlr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clojure.lang.CljCompiler.Ast.Expr
的用法示例。
在下文中一共展示了Expr.GenDlr方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenTypedArg
internal static Expression GenTypedArg(GenContext context, Type type, Expr arg)
{
if (Compiler.MaybePrimitiveType(arg) == type)
return ((MaybePrimitiveExpr)arg).GenDlrUnboxed(context);
else
// Java has emitUnboxArg -- should we do something similar?
return arg.GenDlr(context);
}
示例2: GenTypedArg
internal static Expression GenTypedArg(GenContext context, Type type, Expr arg)
{
if (Compiler.MaybePrimitiveType(arg) == type)
return ((MaybePrimitiveExpr)arg).GenDlrUnboxed(context);
else
{
Expression argExpr = arg.GenDlr(context);
return GenMaybeUnboxedArg(type, argExpr);
}
}
示例3: GenAssignDlr
public override Expression GenAssignDlr(GenContext context, Expr val)
{
Expression target = _target.GenDlr(context);
Expression valExpr = val.GenDlr(context);
if (_targetType != null)
{
Expression convTarget = Expression.Convert(target, _targetType);
Expression access = _fieldInfo != null
? Expression.Field(convTarget, _fieldInfo)
: Expression.Property(convTarget, _propertyInfo);
return Expression.Assign(access, valExpr);
}
else
{
// TODO: Shouldn't this cause a reflection warning?
Expression call = Expression.Call(
target,
Compiler.Method_Reflector_SetInstanceFieldOrProperty,
Expression.Constant(_fieldName),
valExpr);
return call;
}
}
示例4: GenerateDlrExpression
internal static Expression GenerateDlrExpression(GenContext context, Expr expr)
{
return expr.GenDlr(context);
}
示例5: GenAssignDlr
public override Expression GenAssignDlr(GenContext context, Expr val)
{
Expression access = GenDlrUnboxed(context);
Expression valExpr = val.GenDlr(context);
return Expression.Assign(access, valExpr);
}
示例6: GenAssignDlr
public Expression GenAssignDlr(GenContext context, Expr val)
{
Expression varExpr = context.FnExpr.GenVar(context, _var);
Expression valExpr = val.GenDlr(context);
return Expression.Call(varExpr, Compiler.Method_Var_set, valExpr);
}