Accept() public méthode

public Accept ( NodeVisitor visitor ) : void
visitor NodeVisitor
Résultat void
Exemple #1
0
        public virtual void Run()
        {
            program = new Program(Path.GetFileName(outputFileName), target);
            foreach (string reference in references) {
                LoadAssembly(reference, false);
            }
            foreach (string reference in softReferences) {
                LoadAssembly(reference, true);
            }

            foreach (string fileName in inputFiles) {
                StreamReader reader = new StreamReader(fileName);
                Parser parser = new Parser(program, reader, fileName, report);
                parser.Parse();
            }
            if (report.Errors > 0)
                Environment.Exit(1);

            ArrayList visitors = new ArrayList();
            visitors.Add(new TypeCreatingVisitor(report));
            visitors.Add(new TypeElementCreatingVisitor(report));
            visitors.Add(new TypeCheckingVisitor(report));
            visitors.Add(new CodeGeneratingVisitor(report));
            foreach (NodeVisitor visitor in visitors) {
                program.Accept(visitor);
                if (report.Errors > 0)
                    Environment.Exit(1);
            }

            program.Assembly.Save(outputFileName);
        }