internal static StringBuilder DisplayAllStructuredTriviaVB(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 = VB.VisualBasicSyntaxTree.ParseText(sourceCode); //var walker = new VNC.CodeAnalysis.SyntaxWalkers.VB.AllStructuredTrivia(); var walker = new VNC.CodeAnalysis.SyntaxWalkers.VB.VisitAll(SyntaxWalkerDepth.StructuredTrivia); walker.Messages = sb; walker.Visit(tree.GetRoot()); var crc32 = walker.GetCRC32(); sb.AppendFormat("CRC32:({0})", crc32); Log.APPLICATION("Exit", Common.LOG_APPNAME, startTicks); return(sb); }
internal static StringBuilder ParseVBDepthNode(string sourceCode, User_Interface.User_Controls.wucConfigurationOptions configurationOptions) { Int64 startTicks = Log.APPLICATION($"Enter ({sourceCode})", Common.LOG_APPNAME); StringBuilder sb = new StringBuilder(); SyntaxTree tree = VB.VisualBasicSyntaxTree.ParseText(sourceCode); var walker = new VNC.CodeAnalysis.SyntaxWalkers.VB.VisitAll(SyntaxWalkerDepth.Node); walker._configurationOptions = configurationOptions.GetConfigurationInfo(); walker.Messages = sb; walker.Visit(tree.GetRoot()); var crc32 = walker.GetCRC32(); sb.AppendFormat("CRC32:({0})", crc32); Log.APPLICATION("Exit", Common.LOG_APPNAME, startTicks); return(sb); }