本文整理汇总了C#中NodeVisitor类的典型用法代码示例。如果您正苦于以下问题:C# NodeVisitor类的具体用法?C# NodeVisitor怎么用?C# NodeVisitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeVisitor类属于命名空间,在下文中一共展示了NodeVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitTreeNodes
public static void VisitTreeNodes(TreeNodeCollection nodes, NodeVisitor visitNode)
{
foreach (TreeNode n in nodes) {
visitNode(n);
VisitTreeNodes(n.Nodes, visitNode);
}
}
示例2: Visit
/// <summary>Visits the iterator expression and the iterated object expression.</summary>
/// <remarks>
/// Visits the iterator expression and the iterated object expression.
/// There is no body-expression for this loop type.
/// </remarks>
public override void Visit(NodeVisitor v)
{
if (v.Visit(this))
{
iterator.Visit(v);
iteratedObject.Visit(v);
}
}
示例3: accept
public void accept(NodeVisitor visitor)
{
foreach (Statement child in Children)
{
child.accept(visitor);
}
visitor.visit(this);
}
示例4: Accept
public override void Accept(NodeVisitor visitor)
{
if (call == null) {
visitor.VisitAssign(this);
}
else {
call.Accept(visitor);
}
}
示例5: Visit
public override void Visit(NodeVisitor v)
{
if (v.Visit(this))
{
foreach (Node kid in this)
{
((AstNode)kid).Visit(v);
}
}
}
示例6: ConvertRoslynToCCI
public static void ConvertRoslynToCCI(
IMetadataHost host,
Microsoft.CodeAnalysis.CSharp.SyntaxTree tree,
Microsoft.CodeAnalysis.CSharp.Semantics.SemanticModel semanticModel,
out IModule module,
out ISourceLocationProvider sourceLocationProvider) {
sourceLocationProvider = new SourceLocationProvider();
var transformer = new NodeVisitor(host, semanticModel, sourceLocationProvider);
var assembly = (Module)transformer.Visit(tree.GetRoot());
assembly.Location = Path.GetFullPath(tree.FilePath);
module = assembly;
}
示例7: Visit
/// <summary>
/// Visits this node, then each label in the label-list, and finally the
/// statement.
/// </summary>
/// <remarks>
/// Visits this node, then each label in the label-list, and finally the
/// statement.
/// </remarks>
public override void Visit(NodeVisitor v)
{
if (v.Visit(this))
{
foreach (AstNode label in labels)
{
label.Visit(v);
}
statement.Visit(v);
}
}
示例8: VisitNodes
VisitNodes(ArrayList nodes, NodeVisitor v)
{
if (nodes == null)
{
return;
}
for (int i = 0; i < nodes.Count; ++i)
{
ProgressNode node = (ProgressNode)nodes[i];
Dbg.Assert(node != null, "nodes should not contain null elements");
if (!v.Visit(node, nodes, i))
{
return;
}
if (node.Children != null)
{
VisitNodes(node.Children, v);
}
}
}
示例9: Visit
/// <summary>
/// Visits this node, then the switch-expression, then the cases
/// in lexical order.
/// </summary>
/// <remarks>
/// Visits this node, then the switch-expression, then the cases
/// in lexical order.
/// </remarks>
public override void Visit(NodeVisitor v)
{
if (v.Visit(this))
{
expression.Visit(v);
foreach (SwitchCase sc in GetCases())
{
sc.Visit(v);
}
}
}
示例10: Accept
public override void Accept(NodeVisitor visitor)
{
visitor.VisitParameterDeclaration(this);
}
示例11: Visit
/// <summary>Visits this node, then visits its element expressions in order.</summary>
/// <remarks>
/// Visits this node, then visits its element expressions in order.
/// Any empty elements are represented by
/// <see cref="EmptyExpression">EmptyExpression</see>
/// objects, so the callback will never be passed
/// <code>null</code>
/// .
/// </remarks>
public override void Visit(NodeVisitor v)
{
if (v.Visit(this))
{
foreach (AstNode e in GetElements())
{
e.Visit(v);
}
}
}
示例12: Accept
public abstract void Accept(NodeVisitor visitor);
示例13: Accept
public override void Accept(NodeVisitor visitor)
{
visitor.VisitSourceFile(this);
}
示例14: Accept
public override void Accept(NodeVisitor visitor)
{
visitor.VisitTypeSpecifier(this);
}
示例15: Accept
public override void Accept(NodeVisitor visitor)
{
visitor.Visit (this);
}