Example #1
0
        static syntax_tree_node ParseFile(string fname)
        {
            Compiler c = new Compiler();

            var err = new List<Error>();

            var txt = System.IO.File.ReadAllText(fname);

            var cu = c.ParsersController.Compile(fname, txt, err, PascalABCCompiler.Parsers.ParseMode.ForFormatter);

            if (cu == null)
            {
                Console.WriteLine("Не распарсилось");
            }
            return cu;
        }
        // PascalABCSaushkinParser reference needed!!! DO NOT REMOVE!!!

        static syntax_tree_node ParseFile(string fname)
        {
            Compiler c = new Compiler();
           // c.SyntaxTreeChanger = new YieldDesugarSyntaxTreeConverter();
            var opts = new CompilerOptions(fname, CompilerOptions.OutputType.ConsoleApplicaton);
            
            var res = c.Compile(opts);

            var err = new List<Error>();

            var txt = System.IO.File.ReadAllText(fname);

            var cu = c.ParsersController.Compile(fname, txt, err, PascalABCCompiler.Parsers.ParseMode.Normal);

            if (cu == null)
            {
                Console.WriteLine("Не распарсилось");
            }
            return cu;
        }
 public void LoadCompiler()
 {
     compilerReloading = true;
     compiler = new Compiler(SourceFilesProvider, ChangeCompilerState);
     compilerReloading = false;
 }