I would like to start using NRefactory 5 for parsing CSharp files, to do refactoring.
But the documentation is scarce. So I tried and failed:
I started with the following code to see if I could get a AstNode
tree from a cs file.
I would expect the parsing to generates some nodes for me, but no. Can somebody guide me ?
TextReader reader = File.OpenText(fname);
CompilationUnit compilationUnit;
CSharpParser parser = new CSharpParser();
compilationUnit = parser.Parse(reader, fname);
AstNode node = compilationUnit.GetNextNode();
System.Collections.Generic.IEnumerable<AstNode> desc =
compilationUnit.Descendants;
foreach (AstNode jo in desc)
{
System.Console.WriteLine("At least something here");
}