private static void GenerateIntermediateCode(string sourceFile, Node root)
 {
     var asmName = sourceFile.Substring(sourceFile.LastIndexOf("\\", StringComparison.Ordinal) + 1).Replace(".tn", "");
     var cg = new CodeGenerator(asmName);
     cg.Generate(root);
     cg.WriteAssembly();
 }
        private static void CompileAndBuildExecutable()
        {
            var scan = new Scanner();
            scan.SetSource(File.ReadAllText(FILE_LOCATION), 0);

            var parser = new Parser(scan);
            parser.Parse();

            var root = parser.SyntaxTreeRoot;
            var mgr = new ScopeManager();

            var first = new FirstPass(root, mgr);
            var second = new SecondPass(root, mgr);
            first.Run();
            second.Run();

            const string asmName = "sample1-test";
            var cg = new CodeGenerator(asmName);
            cg.Generate(root);
            cg.WriteAssembly();
        }