Ejemplo n.º 1
0
        public void SillyDeserialization()
        {
            var loader = new DOMLoader();
            var module = loader.load(dataStream1);

            Assert.That(module, Is.Not.Null);
        }
Ejemplo n.º 2
0
        public void TestParentFill()
        {
            var loader = new DOMLoader();
            var module = loader.load(dataStream1);

            module.walkDFS(x =>
              {
            if(x != module)
              Assert.That(x.Parent, Is.Not.Null);
              });
        }
Ejemplo n.º 3
0
        public static int Main(string[] args)
        {
            if(args.Length < 1)
            {
              Console.WriteLine("Not enough arguments. Use hsc.exe <file-to-compile> instead.");
              return 1;
            }

            var input = args[0];

            Process parser = new Process();
            parser.StartInfo.UseShellExecute = false;
            parser.StartInfo.FileName = "Parser";
            parser.StartInfo.Arguments = input;
            parser.StartInfo.RedirectStandardOutput = true;
            parser.StartInfo.RedirectStandardError = true;

            parser.Start();
            parser.WaitForExit();

            if(parser.ExitCode != 0)
            {
              // var output = parser.StandardOutput.
              Console.WriteLine("Parser finished with error:");
              string line;
              while ((line = parser.StandardError.ReadLine()) != null)
              {
            Console.WriteLine(line);
              }
              return 1;
            }

            var loader = new DOMLoader();

            var module = loader.load(parser.StandardOutput);

            Console.WriteLine("Successfully parsed! {0}", module);

            return 0;
        }
Ejemplo n.º 4
0
        public void TestVisitDFS()
        {
            var loader = new DOMLoader();
            var module = loader.load(dataStream1);

            module.visitDFSEnd(new EchoVisitor());
        }