static void compare_logs2(string path1, string path2) { Console.WriteLine("testing the multivisitor with files {0} and {1}", path1, path2); using (Reader file1 = new Reader(path1)) { using (Reader file2 = new Reader(path2)) { Log log1 = new Log(); Log log2 = new Log(); Util.TxtLocation loc1 = new Util.TxtLocation(path1); Util.TxtLocation loc2 = new Util.TxtLocation(path2); VectorLogger logger1 = new VectorLogger(log1, loc1, new SafeVectorVisitor(null)); VectorLogger logger2 = new VectorLogger(log2, loc2, new SafeVectorVisitor(null)); VectorMultiVisitor mv = new VectorMultiVisitor(logger1, logger2); Parser p1 = new Parser(file1, mv, loc1); p1.SafeRead(); LogComparer.compare_logs(log1, log2); } } Console.WriteLine(); }
static void compare_logs(string path) { Console.WriteLine("comparing the visitation logs for the parser and dynamic visitor for file {0}", path); Log log1 = new Log(); using (Reader file = new Reader(path)) { Util.TxtLocation loc = new Util.TxtLocation(path); VectorLogger logger = new VectorLogger(log1, loc, new SafeVectorVisitor(null)); Parser p = new Parser(file, logger, loc); p.SafeRead(); } Log log2 = new Log(); using (Reader file = new Reader(path)) { VectBox top = new VectBox(); VectBuilder builder = new VectBuilder(top); Parser p = new Parser(file, builder); Util.TxtLocation loc = new Util.TxtLocation(path); p.SafeRead(); VectorLogger logger = new VectorLogger(log2, loc, new SafeVectorVisitor(null)); if (top.value != null) DynamicVisitor.accept(top.value, logger); } LogComparer.compare_logs(log1, log2); Console.WriteLine(); }