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


C# Ast.PythonVariable类代码示例

本文整理汇总了C#中IronPython.Compiler.Ast.PythonVariable的典型用法代码示例。如果您正苦于以下问题:C# PythonVariable类的具体用法?C# PythonVariable怎么用?C# PythonVariable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PythonVariable类属于IronPython.Compiler.Ast命名空间,在下文中一共展示了PythonVariable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClosureExpression

        public ClosureExpression(Ast.PythonVariable/*!*/ variable, Expression/*!*/ closureCell, ParameterExpression parameter) {
            Assert.NotNull(closureCell);

            _variable = variable;
            _closureCell = closureCell;
            _parameter = parameter;
        }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:7,代码来源:ClosureExpression.cs

示例2: PythonGlobalVariableExpression

        public PythonGlobalVariableExpression(Expression/*!*/ globalExpr, Ast.PythonVariable/*!*/ variable, PythonGlobal/*!*/ global) {
            Assert.NotNull(globalExpr, variable);

            _target = globalExpr;
            _global = global;
            _variable = variable;
        }
开发者ID:atczyc,项目名称:ironruby,代码行数:7,代码来源:PythonGlobalVariableExpression.cs

示例3: GetGlobal

 public override MSAst.Expression GetGlobal(MSAst.Expression globalContext, int arrayIndex, PythonVariable variable, PythonGlobal global) {
     return new LookupGlobalVariable(
         globalContext,
         variable.Name,
         variable.Kind == VariableKind.Local
     );
 }
开发者ID:jschementi,项目名称:iron,代码行数:7,代码来源:LookupCompilationMode.cs

示例4: PythonGlobalVariableExpression

        internal PythonGlobalVariableExpression(Expression/*!*/ globalExpr, Ast.PythonVariable/*!*/ variable, PythonGlobal/*!*/ global, bool lightEh) {
            Assert.NotNull(globalExpr, variable);

            _target = globalExpr;
            _global = global;
            _variable = variable;
            _lightEh = lightEh;
        }
开发者ID:CookieEaters,项目名称:FireHTTP,代码行数:8,代码来源:PythonGlobalVariableExpression.cs

示例5: GetGlobal

        public override MSAst.Expression GetGlobal(MSAst.Expression globalContext, int arrayIndex, PythonVariable variable, PythonGlobal global) {
            Assert.NotNull(global);

            return new PythonGlobalVariableExpression(
                Ast.ArrayIndex(
                    PythonAst._globalArray,
                    Ast.Constant(arrayIndex)
                ),
                variable,
                global
            );
        }
开发者ID:CookieEaters,项目名称:FireHTTP,代码行数:12,代码来源:CollectableCompilationMode.cs

示例6: LiftedParameter

        internal ClosureExpression/*!*/ LiftedParameter(PythonVariable variable, string name) {
            ParameterExpression result = Ast.Variable(typeof(object), name);
            _params.Add(result);

            ClosureExpression closureVar = new ClosureExpression(variable, HiddenVariable(typeof(ClosureCell), name), result);
            EnsureLiftedVars();

            _liftedVars.Add(new DefinitionClosureInfo(closureVar, true));
            return closureVar;
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:10,代码来源:AstGenerator.cs

示例7: LiftedVariable

        internal ClosureExpression/*!*/ LiftedVariable(PythonVariable/*!*/ variable, string/*!*/ name, bool accessInNestedScope) {
            ParameterExpression result = HiddenVariable(typeof(ClosureCell), name);

            ClosureExpression closureVar = new ClosureExpression(variable, result, null);
            EnsureLiftedVars();
            _liftedVars.Add(new DefinitionClosureInfo(closureVar, true));
            return closureVar;
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:8,代码来源:AstGenerator.cs

示例8: GetGlobal

 public abstract MSAst.Expression GetGlobal(MSAst.Expression globalContext, int arrayIndex, PythonVariable variable, PythonGlobal global);
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:1,代码来源:CompilationMode.cs

示例9: Walk

        // ImportStatement
        public override bool Walk(ImportStatement node)
        {
            node.Parent = _currentScope;

            PythonVariable[] variables = new PythonVariable[node.Names.Count];
            for (int i = 0; i < node.Names.Count; i++) {
                string name = node.AsNames[i] != null ? node.AsNames[i] : node.Names[i].Names[0];
                variables[i] = DefineName(name);
                node.Names[i].Parent = _currentScope;
            }
            node.Variables = variables;
            return true;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:14,代码来源:PythonNameBinder.cs

示例10: SetAssigned

 private void SetAssigned(PythonVariable/*!*/ variable, bool value) {
     _bits.Set(variable.Index * 2, value);
 }
开发者ID:CookieEaters,项目名称:FireHTTP,代码行数:3,代码来源:FlowChecker.cs

示例11: TupleIndex

        public int TupleIndex(PythonVariable var) {
            Debug.Assert(_parent._liftedVars != null);

            var vars = _parent._liftedVars;
            for (int i = 0; i < vars.Count; i++) {
                if (vars[i].PythonVariable == var) {
                    return i;
                }
            }
            
            throw new InvalidOperationException();
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:12,代码来源:AstGenerator.cs

示例12: SetParameter

        public void SetParameter(PythonVariable/*!*/ variable, MSAst.Expression/*!*/ parameter) {
            Assert.NotNull(variable, parameter);

            _variables[variable] = parameter;
        }
开发者ID:toddb,项目名称:ironruby,代码行数:5,代码来源:GlobalAllocator.cs

示例13: CreateVariable

        public MSAst.Expression/*!*/ CreateVariable(AstGenerator/*!*/ ag, PythonVariable/*!*/ variable, bool emitDictionary) {
            Assert.NotNull(ag, variable);

            Debug.Assert(variable.Kind != VariableKind.Parameter);

            string name = SymbolTable.IdToString(variable.Name);
            switch (variable.Kind) {
                case VariableKind.Global:
                case VariableKind.GlobalLocal:
                    return _variables[variable] = GetGlobal(name, ag, false);
                case VariableKind.Local:
                case VariableKind.HiddenLocal:
                    if (ag.IsGlobal) {
                        return _variables[variable] = GetGlobal(name, ag, true);
                    } else if (variable.AccessedInNestedScope || (emitDictionary && variable.Kind != VariableKind.HiddenLocal)) {
                        return ag.SetLocalLiftedVariable(variable, ag.LiftedVariable(variable, name, variable.AccessedInNestedScope));
                    } else {
                        return _variables[variable] = ag.Variable(typeof(object), name);
                    }
                default:
                    throw Assert.Unreachable;
            }
        }
开发者ID:toddb,项目名称:ironruby,代码行数:23,代码来源:GlobalAllocator.cs

示例14: TryBindOuter

 internal override bool TryBindOuter(SymbolId name, out PythonVariable variable) {
     // Functions expose their locals to direct access
     ContainsNestedFreeVariables = true;
     return TryGetVariable(name, out variable);
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:5,代码来源:FunctionDefinition.cs

示例15: IsInitialized

 private bool IsInitialized(PythonVariable/*!*/ variable) {
     return _bits.Get(variable.Index * 2 + 1);
 }
开发者ID:CookieEaters,项目名称:FireHTTP,代码行数:3,代码来源:FlowChecker.cs


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