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


C# CompilationUnit.AcceptChildren方法代码示例

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


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

示例1: VisitCompilationUnit

		public object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
		{
			module = new B.Module();
			module.LexicalInfo = new B.LexicalInfo(fileName, 1, 1);
			compilationUnit.AcceptChildren(this, data);
			if (entryPointMethod != null) {
				bool allMembersAreStatic = true;
				foreach (B.TypeMember member in entryPointMethod.DeclaringType.Members) {
					allMembersAreStatic &= member.IsStatic;
				}
				if (allMembersAreStatic) {
					entryPointMethod.DeclaringType.Attributes.Add(MakeAttribute(("module")));
				} else {
					lastLexicalInfo = entryPointMethod.LexicalInfo;
					B.Expression expr = MakeReferenceExpression(entryPointMethod.DeclaringType.Name + ".Main");
					B.MethodInvocationExpression mie = new B.MethodInvocationExpression(lastLexicalInfo, expr);
					if (entryPointMethod.Parameters.Count > 0) {
						mie.Arguments.Add(MakeReferenceExpression("argv"));
					}
					B.SimpleTypeReference ret = entryPointMethod.ReturnType as B.SimpleTypeReference;
					if (ret.Name == "void" || ret.Name == "System.Void")
						module.Globals.Add(new B.ExpressionStatement(mie));
					else
						module.Globals.Add(new B.ReturnStatement(lastLexicalInfo, mie, null));
				}
			}
			B.Module tmp = module;
			module = null;
			return tmp;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:30,代码来源:ConvertVisitorGlobal.cs

示例2: VisitCompilationUnit

        public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
        {
            Contract.Requires(compilationUnit != null);

            // Visit children (E.g. TypeDcelarion objects)
            compilationUnit.AcceptChildren(this, data);

            return null;
        }
开发者ID:chinaniit,项目名称:KnockoutGenerator,代码行数:9,代码来源:AstVisitor.cs

示例3: VisitCompilationUnit

        public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
        {
            Contract.Requires(compilationUnit != null);

            DictClass = new Dictionary<string, ClassStructure>();
            // Visit children (E.g. TypeDcelarion objects)
            compilationUnit.AcceptChildren(this, data);

            return null;
        }
开发者ID:hikaruyh88,项目名称:ProjectAnalyzeV3.0,代码行数:10,代码来源:CounterVisitor.cs

示例4: TrackedVisitCompilationUnit

 public override object TrackedVisitCompilationUnit(CompilationUnit compilationUnit, object data)
 {
     compilationUnit.AcceptChildren(this, data);
     return null;
 }
开发者ID:L3tum,项目名称:BesiegeScriptingMod,代码行数:5,代码来源:NRefactoryToPythonConverter.cs

示例5: VisitCompilationUnit

 public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
 {
     if (compilationUnit == null) {
         throw new ArgumentNullException("compilationUnit");
     }
     CodeNamespace globalNamespace = new CodeNamespace("Global");
     //namespaces.Add(globalNamespace);
     namespaceDeclarations.Push(globalNamespace);
     compilationUnit.AcceptChildren(this, data);
     codeCompileUnit.Namespaces.Add(globalNamespace);
     return globalNamespace;
 }
开发者ID:almazik,项目名称:ILSpy,代码行数:12,代码来源:CodeDOMOutputVisitor.cs

示例6: TrackedVisitCompilationUnit

		public override object TrackedVisitCompilationUnit(CompilationUnit compilationUnit, object data)
		{
			// Visit the child items of the compilation unit.
			compilationUnit.AcceptChildren(this, data);
			return null;
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:6,代码来源:NRefactoryToPythonConverter.cs

示例7: VisitCompilationUnit

 public virtual object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
 {
     Debug.Assert((compilationUnit != null));
     return compilationUnit.AcceptChildren(this, data);
 }
开发者ID:pusp,项目名称:o2platform,代码行数:5,代码来源:AbstractASTVisitor.cs

示例8: VisitCompilationUnit

 public virtual bool VisitCompilationUnit(CompilationUnit compilationUnit, object d)
 {
     if ((compilationUnit == null)) {
         return SetFailure();
     }
     if ((d == null)) {
         return SetFailure();
     }
     if(compilationUnit.GetType() != d.GetType()) {return SetFailure();}
     var data = (CompilationUnit)d;
     if (!IsMatch(compilationUnit, data)) {
         return SetFailure();
     }
     return compilationUnit.AcceptChildren(this, d);
 }
开发者ID:jbuedel,项目名称:AgentRalphPlugin,代码行数:15,代码来源:AstComparisonVisitor.Generated.cs

示例9: VisitCompilationUnit

 public override object VisitCompilationUnit (CompilationUnit node, object data)
 {
     node.AcceptChildren (this, null);
     return null;
 }
开发者ID:hallvar,项目名称:Joddes.CS,代码行数:5,代码来源:JsSourceInspector.cs


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