private static CstNode TestParsing(string code) {
     var processor = new JavaCstGenerator();
     var cst = processor.GenerateTreeFromCodeText(code, true);
     var code2 = cst.Code;
     Assert.That(code2, Is.EqualTo(code));
     Console.WriteLine(cst);
     return cst;
 }
        public void ParseJavaSource() {
            var dirInfo = new DirectoryInfo(@"C:\Users\exKAZUu\Desktop\src");
            if (!dirInfo.Exists) {
                return;
            }

            var javaFiles = dirInfo.GetFiles("*.java", SearchOption.AllDirectories);
            var processor = new JavaCstGenerator();
            var stopwatch = new Stopwatch();
            stopwatch.Start();
            foreach (var javaFile in javaFiles) {
                Console.WriteLine(javaFile);
                var code = javaFile.OpenText().ReadToEnd();
                var cst = processor.GenerateTreeFromCodeText(code);
                var code2 = cst.Code;
                Assert.That(code2, Is.EqualTo(code));
            }
            stopwatch.Stop();
            Console.WriteLine(stopwatch.Elapsed);
        }
 public void ParseBrokenCodeIgnoringException() {
     var code = @"class A {{ }";
     var processor = new JavaCstGenerator();
     processor.GenerateTreeFromCodeText(code, false);
 }
 public void ParseBrokenCode() {
     var code = @"class A {{ }";
     var processor = new JavaCstGenerator();
     processor.GenerateTreeFromCodeText(code, true);
 }
 public void ParseBrokenCode() {
     var code = @"class A {{ }";
     var processor = new JavaCstGenerator();
     Assert.Throws<ParseException>(() => processor.GenerateTreeFromCodeText(code, true));
 }