本文整理汇总了C#中IAstNode.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# IAstNode.Accept方法的具体用法?C# IAstNode.Accept怎么用?C# IAstNode.Accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAstNode
的用法示例。
在下文中一共展示了IAstNode.Accept方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AstEquals
public static void AstEquals(IAstNode astExpected, IAstNode astActual, bool showOffsets = false)
{
var dumper = new DumpAstVisitor(showOffsets);
var expectedCode = astExpected.Accept(dumper);
var actualCode = astActual.Accept(dumper);
Check.That(actualCode).IsEqualTo(expectedCode);
Console.WriteLine(expectedCode);
}
示例2: Accept
private void Accept(SqlAstVisitor visitor, IList<ITransformer> tranformers, IAstNode parent)
{
Debug.WriteLine(parent.Level+"\t"+parent.ParentNode + "\t" + parent +"\t" + parent.OriginalValue);
foreach (ITransformer transformer in tranformers)
{
parent.Transform(transformer);
}
parent.Accept(visitor);
IList<IAstNode> childs = parent.ChildNodes;
if (childs == null)
{
return;
}
foreach(IAstNode child in childs)
{
Accept(visitor, tranformers, child);
}
}
示例3: Generate
internal static void Generate(IAstNode p, TextWriter streamWriter, string nspace)
{
p.Accept(new ProtoGenerator(streamWriter,nspace));
}
示例4: Output2MySql
protected internal virtual string Output2MySql(IAstNode node, string sql)
{
var sb = new StringBuilder(sql.Length);
node.Accept(new MySqlOutputAstVisitor(sb));
return sb.ToString();
}
示例5: Generate
public void Generate(IAstNode rootNode, TextWriter textWriter)
{
MdlGeneratorAstVisitor generatorAstVisitor = new MdlGeneratorAstVisitor(textWriter);
rootNode.Accept(generatorAstVisitor);
}
示例6: Resolve
public IExpression Resolve(IAstNode node)
{
return node
.Accept(new ConstantParsingVisitor())
.Accept(new BindingVisitor(this))
.Accept(new ConversionVisitor(this));
}
示例7: ToString
public static string ToString(IAstNode ast, bool showOffsets = false)
{
var dumper = new DumpAstVisitor(showOffsets);
var code = ast.Accept(dumper);
return code;
}