本文整理汇总了C#中Mono.CSharp.BuilderContext类的典型用法代码示例。如果您正苦于以下问题:C# BuilderContext类的具体用法?C# BuilderContext怎么用?C# BuilderContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuilderContext类属于Mono.CSharp命名空间,在下文中一共展示了BuilderContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FlagsHandle
internal FlagsHandle (BuilderContext ec, Options mask, Options val)
{
this.ec = ec;
invmask = ~mask;
oldval = ec.flags & mask;
ec.flags = (ec.flags & invmask) | (val & mask);
}
示例2: MakeExpression
public override SLE.Expression MakeExpression (BuilderContext ctx)
{
return MakeExpression (ctx, mg.InstanceExpression, mg.BestCandidate, arguments);
}
示例3: MakeExpression
public override SLE.Expression MakeExpression(BuilderContext ctx)
{
return SLE.Expression.Convert (obj.Expression, type.GetMetaInfo ());
}
示例4: MakeExpression
public override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)
{
return System.Linq.Expressions.Expression.Constant (GetTypedValue (), type.GetMetaInfo ());
}
示例5: MakeExpression
public override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)
{
return System.Linq.Expressions.Expression.Constant (GetValue ());
}
示例6: MakeExpression
public override SLE.Expression MakeExpression (BuilderContext ctx)
{
using (ctx.With (BuilderContext.Options.AllCheckStateFlags, true)) {
return Expr.MakeExpression (ctx);
}
}
示例7: MakeExpression
public override SLE.Expression MakeExpression (BuilderContext ctx)
{
#if STATIC
return base.MakeExpression (ctx);
#else
return SLE.Expression.Block (expr.MakeExpression (ctx), SLE.Expression.Default (type.GetMetaInfo ()));
#endif
}
示例8: MakeExpression
public static System.Linq.Expressions.Expression[] MakeExpression (Arguments args, BuilderContext ctx)
{
if (args == null || args.Count == 0)
return null;
// TODO: implement
if (args.reordered != null)
throw new NotImplementedException ();
var exprs = new System.Linq.Expressions.Expression [args.Count];
for (int i = 0; i < exprs.Length; ++i) {
Argument a = (Argument) args.args [i];
exprs[i] = a.Expr.MakeExpression (ctx);
}
return exprs;
}
示例9: MakeExpression
public override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)
{
if (typed && obj.Expression.Type != type)
return System.Linq.Expressions.Expression.Convert (obj.Expression, type);
return obj.Expression;
}
示例10: MakeExpression
//
// Implemented by all expressions which support conversion from
// compiler expression to invokable runtime expression. Used by
// dynamic C# binder.
//
public virtual SLE.Expression MakeExpression(BuilderContext ctx)
{
throw new NotImplementedException ("MakeExpression for " + GetType ());
}
示例11: MakeExpression
public override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)
{
return Invocation.MakeExpression (ctx, InstanceExpr, method, arguments);
}
示例12: MakeAssignExpression
public SLE.Expression MakeAssignExpression(BuilderContext ctx)
{
return MakeExpression (ctx);
}
示例13: MakeExpression
public static System.Linq.Expressions.Expression[] MakeExpression (Arguments args, BuilderContext ctx)
{
if (args == null || args.Count == 0)
return null;
var exprs = new System.Linq.Expressions.Expression [args.Count];
for (int i = 0; i < exprs.Length; ++i) {
Argument a = args.args [i];
exprs[i] = a.Expr.MakeExpression (ctx);
}
return exprs;
}
示例14: MakeAssignExpression
public SLE.Expression MakeAssignExpression(BuilderContext ctx)
{
return obj.Expression;
}
示例15: MakeExpression
public override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)
{
var tassign = target as IDynamicAssign;
if (tassign == null)
throw new InternalErrorException (target.GetType () + " does not support dynamic assignment");
var target_object = tassign.MakeAssignExpression (ctx, source);
//
// Some hacking is needed as DLR does not support void type and requires
// always have object convertible return type to support caching and chaining
//
// We do this by introducing an explicit block which returns RHS value when
// available or null
//
if (target_object.NodeType == System.Linq.Expressions.ExpressionType.Block)
return target_object;
System.Linq.Expressions.UnaryExpression source_object;
if (ctx.HasSet (BuilderContext.Options.CheckedScope)) {
source_object = System.Linq.Expressions.Expression.ConvertChecked (source.MakeExpression (ctx), target_object.Type);
} else {
source_object = System.Linq.Expressions.Expression.Convert (source.MakeExpression (ctx), target_object.Type);
}
return System.Linq.Expressions.Expression.Assign (target_object, source_object);
}