public VisitSyntaxTree ( SyntaxTree syntaxTree ) : void | ||
syntaxTree | SyntaxTree | |
return | void |
public virtual void VisitSyntaxTree(SyntaxTree syntaxTree)
{
// don't do node tracking as we visit all children directly
foreach (AstNode node in syntaxTree.Children) {
node.AcceptVisitor(this);
MaybeNewLinesAfterUsings(node);
}
}
private void FormatDocument_Click( object sender, RoutedEventArgs e ) { CSharpFormattingOptions policy = FormattingOptionsFactory.CreateAllman(); CSharpParser parser = new CSharpParser(); SyntaxTree tree = parser.Parse( scriptTextBox.Text ); StringWriter writer = new StringWriter(); CSharpOutputVisitor outputVisitor = new CSharpOutputVisitor( writer, policy ); outputVisitor.VisitSyntaxTree( tree ); scriptTextBox.Text = writer.ToString(); }