当前位置: 首页>>代码示例>>C#>>正文


C# expr类代码示例

本文整理汇总了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);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:10,代码来源:_ast.cs

示例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);
     }
 }
开发者ID:Northcode,项目名称:nvm,代码行数:33,代码来源:ILGenerator.cs

示例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) };
     }
 }
开发者ID:Northcode,项目名称:nvm,代码行数:15,代码来源:ILGenerator.cs

示例4: BinOp

 internal BinOp(BinaryExpression expr, @operator op)
     : this() {
     _left = Convert(expr.Left);
     _right = Convert(expr.Right);
     _op = op;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:6,代码来源:_ast.cs

示例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);
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:8,代码来源:_ast.cs

示例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;
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:11,代码来源:_ast.cs

示例7: Index

 internal Index(expr expr)
     : this() {
     _value = expr;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:4,代码来源:_ast.cs

示例8: Yield

 internal Yield(YieldExpression expr)
     : this() {
     // expr.Expression is never null
     _value = Convert(expr.Expression);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs

示例9: Repr

 internal Repr(BackQuoteExpression expr)
     : this() {
     _value = Convert(expr.Expression);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:4,代码来源:_ast.cs

示例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);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:9,代码来源:_ast.cs

示例11: AugAssign

 internal AugAssign(AugmentedAssignStatement stmt)
     : this() {
     _target = Convert(stmt.Left, Store.Instance);
     _value = Convert(stmt.Right);
     _op = (@operator)Convert(stmt.Operator);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:6,代码来源:_ast.cs

示例12: keyword

 internal keyword(IronPython.Compiler.Ast.Arg arg)
     : this() {
     _arg = arg.Name;
     _value = Convert(arg.Expression);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs

示例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);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:9,代码来源:_ast.cs

示例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;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:7,代码来源:_ast.cs

示例15: ListComp

 internal ListComp(ListComprehension comp)
     : this() {
     _elt = Convert(comp.Item);
     _generators = Convert(comp.Iterators);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs


注:本文中的expr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。