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


C# INode.AcceptVisitor方法代码示例

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


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

示例1: Run

		public void Run(INode typeDeclaration)
		{
			typeDeclaration.AcceptVisitor(this, null);
			foreach (VariableDeclaration decl in fields) {
				decl.Name = prefix + decl.Name;
			}
		}
开发者ID:ThomasZitzler,项目名称:ILSpy,代码行数:7,代码来源:PrefixFieldsVisitor.cs

示例2: ToText

		public static string ToText(INode node)
		{
			var output = new CSharpOutputVisitor();
			node.AcceptVisitor(output, null);

			return output.Text;
		}
开发者ID:neiz,项目名称:ravendb,代码行数:7,代码来源:QueryParsingUtils.cs

示例3: TrackedVisit

		public object TrackedVisit(INode node, object data)
		{
			BeginNode(node);
			object ret = node.AcceptVisitor(callVisitor, data);
			EndNode(node);
			return ret;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:NodeInformVisitor.cs

示例4: OutputNode

		public string OutputNode (ProjectDom dom, INode node, string indent)
		{
			CSharpOutputVisitor outputVisitor = new CSharpOutputVisitor ();
			CSharpFormatter.SetFormatOptions (outputVisitor, dom != null && dom.Project != null ? dom.Project.Policies : null);
			int col = CSharpFormatter.GetColumn (indent, 0, 4);
			outputVisitor.OutputFormatter.IndentationLevel = System.Math.Max (0, col / 4);
			node.AcceptVisitor (outputVisitor, null);
			return outputVisitor.Text;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:CSharpNRefactoryASTProvider.cs

示例5: GenerateCode

		protected override string GenerateCode(INode unit, bool installSpecials)
		{
			CSharpOutputVisitor visitor = new CSharpOutputVisitor();
			
			if (installSpecials) {
				SpecialNodesInserter.Install(this.specialsList, visitor);
			}
			
			unit.AcceptVisitor(visitor, null);
			return visitor.Text;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:11,代码来源:CSharpMethodExtractor.cs

示例6: GenerateCode

        private static string GenerateCode(INode unit/*, bool installSpecials*/)
        {
            CSharpOutputVisitor visitor = new CSharpOutputVisitor();

            //			if (installSpecials)
            //			{
            //				SpecialNodesInserter.Install(this.specialsList, visitor);
            //			}

            unit.AcceptVisitor(visitor, null);
            return visitor.Text;
        }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:12,代码来源:INodeExt.cs

示例7: CreateCode

		string CreateCode(INode node, IOutputAstVisitor outputVisitor)
		{
			using (SpecialNodesInserter.Install(specials, outputVisitor)) {
				node.AcceptVisitor(outputVisitor, null);
			}
			return outputVisitor.Text;
		}
开发者ID:XQuantumForceX,项目名称:Reflexil,代码行数:7,代码来源:CodeSnippetConverter.cs

示例8: GetString

		public string GetString (INode domVisitable, OutputSettings settings)
		{
			if (domVisitable == null)
				return nullString;
			string result = (string)domVisitable.AcceptVisitor (OutputVisitor, settings);
			if (settings is OutputSettings) 
				((OutputSettings)settings).PostProcess (domVisitable, ref result);
			return result;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:Ambience.cs

示例9: Evaluate

		TypedValue Evaluate(INode expression, bool permRef, object data = null)
		{
			// Try to get the value from cache
			// (the cache is cleared when the process is resumed)
			TypedValue val;
			if (context.Process.ExpressionsCache.TryGetValue(expression, out val)) {
				if (val == null || !val.Value.IsInvalid)
					return val;
			}
			
			System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
			watch.Start();
			try {
				val = (TypedValue)expression.AcceptVisitor(this, data);
				if (val != null && permRef)
					val = new TypedValue(val.Value.GetPermanentReference(), val.Type);
			} catch (GetValueException e) {
				e.Expression = expression;
				throw;
			} catch (NotImplementedException e) {
				throw new GetValueException(expression, "Language feature not implemented: " + e.Message);
			} finally {
				watch.Stop();
				context.Process.TraceMessage("Evaluated: {0} in {1} ms total", expression.PrettyPrint(), watch.ElapsedMilliseconds);
			}
			
			if (val != null && val.Value.IsInvalid)
				throw new DebuggerException("Expression \"" + expression.PrettyPrint() + "\" is invalid right after evaluation");
			
			// Add the result to cache
			context.Process.ExpressionsCache[expression] = val;
			
			return val;
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:34,代码来源:ExpressionEvaluator.cs

示例10: RenameVariable

		static void RenameVariable(INode method, string from, ref int index)
		{
			index += 1;
			method.AcceptVisitor(new RenameLocalVariableVisitor(from, from + "__" + index, StringComparer.Ordinal), null);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:ToVBNetRenameConflictingVariables.cs

示例11: ChangeInvocationName

 private INode ChangeInvocationName(string newName, INode node)
 {
     RenameIdentifierVisitor v = new RenameIdentifierVisitor("NewMethod", newName, StringComparer.InvariantCulture);
     node.AcceptVisitor(v, null);
     return node;
 }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:6,代码来源:QuickFixInfo.cs

示例12: EmitBlockOrIndentedLine

 void EmitBlockOrIndentedLine (INode node)
 {
     bool block = node is BlockStatement;
     if (!block) {
         NewLine ();
         Indent ();
     } else {
         Write (" ");
     }
     node.AcceptVisitor (this, null);
     if (!block)
         Outdent ();
 }
开发者ID:hallvar,项目名称:Joddes.CS,代码行数:13,代码来源:JsEmitter.cs

示例13: EmitLambda

 void EmitLambda (List<ParameterDeclarationExpression> parameters, INode body, INode context, Mono.Collections.Generic.Collection<ParameterDefinition> paramdefinitions)
 {
     PushLocals ();
     if (paramdefinitions == null) {
         AddLocals (parameters);
     } else {
         for (var i = 0; i < paramdefinitions.Count; i++) {
             ParameterDefinition p = paramdefinitions[i];
             //Console.WriteLine ("AddLocal: {0}: {1}", parameters[i].ParameterName, p.ParameterType);
             Locals.Add (parameters[i].ParameterName, p.ParameterType);
         }
     }
     
     bool block = body is BlockStatement;
     
     Write ("");
     var savedPos = Output.Length;
     var savedThisCount = ThisRefCountInMethods;
     
     Write ("function");
     EmitMethodParameters (parameters, context);
     Write (" ");
     if (!block) {
         Write ("{ ");
     }
     if (body.Parent is LambdaExpression && !block)
         Write ("return ");
     body.AcceptVisitor (this, null);
     if (!block) {
         Write (" }");
     }
     
     //if (ThisRefCountInMethods > savedThisCount) {
         //Output.Insert(savedPos, RUNTIME_HELPER_NAME + ".bind(this)(");
         Write (".bind(this)");
     //}
     
     PopLocals ();
 }
开发者ID:hallvar,项目名称:Joddes.CS,代码行数:39,代码来源:JsEmitter.cs

示例14: StatementUsesExpr

 private bool StatementUsesExpr(INode node, IdentifierExpression ie)
 {
     FindReferenceVisitor visitor = new FindReferenceVisitor(true, ie.Identifier, node.StartLocation, node.EndLocation);
     node.AcceptVisitor(visitor, null);
     return visitor.Identifiers.Count > 0;
 }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:6,代码来源:FindSpecificCatchClauses.cs

示例15: GetExtractableChildren

 public static List<INode> GetExtractableChildren(INode node)
 {
     var v = new GetImmediateChildrenVisitor();
     node.AcceptVisitor(v, null);
     return v.Children;
 }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:6,代码来源:OscillatingExtractMethodRefactoringExpansion.cs


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