internal static StringBuilder ParseCSDepthNode(string sourceCode) { Int64 startTicks = Log.APPLICATION($"Enter ({sourceCode})", Common.LOG_APPNAME); StringBuilder sb = new StringBuilder(); SyntaxTree tree = CS.CSharpSyntaxTree.ParseText(sourceCode); var walker = new VNC.CodeAnalysis.SyntaxWalkers.CS.VisitAll(SyntaxWalkerDepth.Node); walker.Messages = sb; walker.Visit(tree.GetRoot()); Log.APPLICATION("Exit", Common.LOG_APPNAME, startTicks); return(sb); }
internal static StringBuilder DisplayAllStructuredTriviaCS(string fileNameAndPath) { Int64 startTicks = Log.APPLICATION($"Enter ({fileNameAndPath})", Common.LOG_APPNAME); StringBuilder sb = new StringBuilder(); var sourceCode = ""; using (var sr = new StreamReader(fileNameAndPath)) { sourceCode = sr.ReadToEnd(); } var tree = CS.CSharpSyntaxTree.ParseText(sourceCode); var walker = new VNC.CodeAnalysis.SyntaxWalkers.CS.VisitAll(SyntaxWalkerDepth.StructuredTrivia); walker.Messages = sb; walker.Visit(tree.GetRoot()); Log.APPLICATION("Exit", Common.LOG_APPNAME, startTicks); return(sb); }