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


C# Statement.Walk方法代码示例

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


在下文中一共展示了Statement.Walk方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoAnalyze

        private Module DoAnalyze(Modules modules, string name, Statement root)
        {
            GlobalSuite global = new GlobalSuite(root);
            module = new Module(modules, name, global, scopes);

            ModuleScope modsc;
            module.ModuleScope = modsc = new ModuleScope(module, null, global);

            PushScope(modsc);

            root.Walk(this);

            foreach (FieldAssignment fer in this.fields) {
                fer.Infer(module);
            }
            return module;
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:17,代码来源:Analyzer.cs

示例2: FindControlFlow

            public static bool FindControlFlow(Statement statement, out bool foundLoopControl)
            {
                // No return in null statement
                if (statement == null) {
                    foundLoopControl = false;
                    return false;
                }

                // find it now.
                ControlFlowFinder rf = new ControlFlowFinder();
                statement.Walk(rf);
                foundLoopControl = rf.foundLoopControl;
                return rf.found;
            }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:14,代码来源:Statements.cs

示例3: CheckMightNeedLocalsDictionary

 public static bool CheckMightNeedLocalsDictionary(Statement s)
 {
     MightNeedLocalsWalker w = new MightNeedLocalsWalker();
     s.Walk(w);
     return w.MightNeedLocals;
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:6,代码来源:ScopeStatement.cs

示例4: WalkClassBody

		void WalkClassBody(IClass c, Statement classBody)
		{
			currentClass = c;
			classBody.Walk(this);
			currentClass = null;
		}
开发者ID:siegfriedpammer,项目名称:SharpDevelop,代码行数:6,代码来源:PythonAstWalker.cs

示例5: Walk

		/// <summary>
		/// Walks the python statement returned from the parser.
		/// </summary>
		public void Walk(Statement statement)
		{
			statement.Walk(this);
		}
开发者ID:siegfriedpammer,项目名称:SharpDevelop,代码行数:7,代码来源:PythonAstWalker.cs

示例6: WalkScopes

 private ScopeNode WalkScopes(Statement Statement)
 {
     Statement.Walk(this);
     return root;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:5,代码来源:ScopeWalker.cs

示例7: DoBind

        private GlobalSuite DoBind(Statement root)
        {
            GlobalSuite global = new GlobalSuite(root);
            current = global;

            // Detect all local names
            root.Walk(this);

            // Binding the free variables
            foreach (ScopeStatement scope in processed) {
                scope.BindNames(global, this);
            }

            // Validate
            foreach (ScopeStatement scope in processed) {
                if ((scope.ScopeInfo &
                    (ScopeStatement.ScopeAttributes.ContainsFreeVariables |
                    ScopeStatement.ScopeAttributes.ContainsImportStar |
                    ScopeStatement.ScopeAttributes.ContainsUnqualifiedExec |
                    ScopeStatement.ScopeAttributes.ContainsNestedFreeVariables)) == 0) {
                    continue;
                }

                FunctionDefinition func;
                if ((func = scope as FunctionDefinition) != null) {
                    if (func.ContainsImportStar && func.IsClosure) {
                        ReportSyntaxError(String.Format("import * is not allowed in function '{0}' because it is a nested function", func.Name.GetString()), func);
                    }
                    if (func.ContainsImportStar && func.Parent is FunctionDefinition) {
                        ReportSyntaxError(String.Format("import * is not allowed in function '{0}' because it is a nested function", func.Name.GetString()), func);
                    }
                    if (func.ContainsImportStar && func.ContainsNestedFreeVariables) {
                        ReportSyntaxError(String.Format("import * is not allowed in function '{0}' because it contains a nested function with free variables", func.Name.GetString()), func);
                    }
                    if (func.ContainsUnqualifiedExec && func.ContainsNestedFreeVariables) {
                        ReportSyntaxError(String.Format("unqualified exec is not allowed in function '{0}' it contains a nested function with free variables", func.Name.GetString()), func);
                    }
                    if (func.ContainsUnqualifiedExec && func.IsClosure) {
                        ReportSyntaxError(String.Format("unqualified exec is not allowed in function '{0}' it is a nested function", func.Name.GetString()), func);
                    }
                }

                ClassDefinition cls;
                if ((cls = scope as ClassDefinition) != null) {
                    if (cls.ContainsImportStar) {
                        // warning
                    }

                }
            }
            return global;
        }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:52,代码来源:Binder.cs


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