本文整理汇总了C#中expr类的典型用法代码示例。如果您正苦于以下问题:C# expr类的具体用法?C# expr怎么用?C# expr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
expr类属于命名空间,在下文中一共展示了expr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GeneratorExp
internal GeneratorExp(GeneratorExpression expr)
: this() {
ExtractListComprehensionIterators walker = new ExtractListComprehensionIterators();
expr.Function.Body.Walk(walker);
ComprehensionIterator[] iters = walker.Iterators;
Debug.Assert(iters.Length != 0, "A generator expression cannot have zero iterators.");
iters[0] = new ComprehensionFor(((ComprehensionFor)iters[0]).Left, expr.Iterable);
_elt = Convert(walker.Yield.Expression);
_generators = Convert(iters);
}
示例2: GenerateExpr
private void GenerateExpr(expr expr, ILGenerator ilGenerator)
{
if (expr is int_lit)
{
int_lit e = expr as int_lit;
ilGenerator.Emit(OpCodes.Ldc_I4, e.value);
}
else if (expr is float_lit)
{
float_lit e = expr as float_lit;
ilGenerator.Emit(OpCodes.Ldc_R4, e.value);
}
else if (expr is bool_lit)
{
bool_lit e = expr as bool_lit;
ilGenerator.Emit(OpCodes.Ldc_I4, (e.value ? 1 : 0));
}
else if (expr is string_lit)
{
string_lit e = expr as string_lit;
ilGenerator.Emit(OpCodes.Ldstr, e.value);
}
else if (expr is byte_lit)
{
byte_lit e = expr as byte_lit;
ilGenerator.Emit(OpCodes.Ldc_I4, e.value);
}
else if (expr is getvar)
{
getvar e = expr as getvar;
LoadLocal(e.name, ilGenerator);
}
}
示例3: GetExprTypes
private Type[] GetExprTypes(expr expr)
{
if (expr is expr_list)
{
return (expr as expr_list).list.Select(e => GetExprType(e)).ToArray();
}
else if (expr == null)
{
return null;
}
else
{
return new Type[] { GetExprType(expr) };
}
}
示例4: BinOp
internal BinOp(BinaryExpression expr, @operator op)
: this() {
_left = Convert(expr.Left);
_right = Convert(expr.Right);
_op = op;
}
示例5: Assign
internal Assign(AssignmentStatement stmt)
: this() {
_targets = PythonOps.MakeEmptyList(stmt.Left.Count);
foreach (Compiler.Ast.Expression expr in stmt.Left)
_targets.Add(Convert(expr, Store.Instance));
_value = Convert(stmt.Right);
}
示例6: Print
internal Print(PrintStatement stmt)
: this() {
if (stmt.Destination != null)
_dest = Convert(stmt.Destination);
_values = PythonOps.MakeEmptyList(stmt.Expressions.Count);
foreach (Compiler.Ast.Expression expr in stmt.Expressions)
_values.Add(Convert(expr));
_nl = !stmt.TrailingComma;
}
示例7: Index
internal Index(expr expr)
: this() {
_value = expr;
}
示例8: Yield
internal Yield(YieldExpression expr)
: this() {
// expr.Expression is never null
_value = Convert(expr.Expression);
}
示例9: Repr
internal Repr(BackQuoteExpression expr)
: this() {
_value = Convert(expr.Expression);
}
示例10: Slice
public Slice(SliceExpression expr)
: this() {
if (expr.SliceStart != null)
_lower = Convert(expr.SliceStart);
if (expr.SliceStop != null)
_upper = Convert(expr.SliceStop);
if (expr.StepProvided && expr.SliceStep != null)
_step = Convert(expr.SliceStep);
}
示例11: AugAssign
internal AugAssign(AugmentedAssignStatement stmt)
: this() {
_target = Convert(stmt.Left, Store.Instance);
_value = Convert(stmt.Right);
_op = (@operator)Convert(stmt.Operator);
}
示例12: keyword
internal keyword(IronPython.Compiler.Ast.Arg arg)
: this() {
_arg = arg.Name;
_value = Convert(arg.Expression);
}
示例13: Raise
internal Raise(RaiseStatement stmt)
: this() {
if (stmt.ExceptType != null)
_type = Convert(stmt.ExceptType);
if (stmt.Value != null)
_inst = Convert(stmt.Value);
if (stmt.Traceback != null)
_tback = Convert(stmt.Traceback);
}
示例14: Lambda
internal Lambda(LambdaExpression lambda)
: this() {
FunctionDef def = (FunctionDef)Convert(lambda.Function);
_args = def.args;
Debug.Assert(def.body.Count == 1, "LambdaExpression body should be one Return statement.");
_body = ((Return)def.body[0]).value;
}
示例15: ListComp
internal ListComp(ListComprehension comp)
: this() {
_elt = Convert(comp.Item);
_generators = Convert(comp.Iterators);
}