Ejemplo n.º 1
0
        public CompileStatus CompileFiles()
        {
            ClassManager      classManager      = new ClassManager();
            CompileStatus     status            = new CompileStatus(Args.ExitOnFirstError);
            ICodeGenerator    codeGenerator     = new JavaScriptCodeGenerator();
            TypeManager       typeManager       = new TypeManager();
            EntryPointManager entryPointManager = new EntryPointManager(status, Args.EntryPointClass);

            try
            {
                codeGenerator.Initiate();

                {
                    ClepsClassNamesCollectorVisitor classSkeletonGenerator = new ClepsClassNamesCollectorVisitor(status, classManager, codeGenerator);
                    ParseFilesWithGenerator(classSkeletonGenerator, status);
                }
                {
                    ClepsMemberGeneratorVisitor memberGenerator = new ClepsMemberGeneratorVisitor(status, classManager, codeGenerator, entryPointManager);
                    ParseFilesWithGenerator(memberGenerator, status);
                }
                {
                    ClepsFunctionBodyGeneratorVisitor functionBodyGenerator = new ClepsFunctionBodyGeneratorVisitor(status, classManager, codeGenerator, typeManager);
                    ParseFilesWithGenerator(functionBodyGenerator, status);
                }

                string entryClassName = entryPointManager.GetChosenEntryPointOrNull();

                if (!String.IsNullOrWhiteSpace(entryClassName))
                {
                    codeGenerator.AddEntryPoint(entryClassName, EntryPointManager.EntryPointName);
                }

                codeGenerator.Output(Args.OutputDirectory, Args.OutputFileName, status);
            }
            catch (CompilerLogException)
            {
                //Supress compiler errors
            }
            finally
            {
                codeGenerator.Close();
            }

            return(status);
        }
Ejemplo n.º 2
0
        public CompileStatus CompileFiles()
        {
            ClassManager classManager = new ClassManager();
            CompileStatus status = new CompileStatus(Args.ExitOnFirstError);
            ICodeGenerator codeGenerator = new JavaScriptCodeGenerator();
            TypeManager typeManager = new TypeManager();
            EntryPointManager entryPointManager = new EntryPointManager(status, Args.EntryPointClass);

            try
            {
                codeGenerator.Initiate();

                {
                    ClepsClassNamesCollectorVisitor classSkeletonGenerator = new ClepsClassNamesCollectorVisitor(status, classManager, codeGenerator);
                    ParseFilesWithGenerator(classSkeletonGenerator, status);
                }
                {
                    ClepsMemberGeneratorVisitor memberGenerator = new ClepsMemberGeneratorVisitor(status, classManager, codeGenerator, entryPointManager);
                    ParseFilesWithGenerator(memberGenerator, status);
                }
                {
                    ClepsFunctionBodyGeneratorVisitor functionBodyGenerator = new ClepsFunctionBodyGeneratorVisitor(status, classManager, codeGenerator, typeManager);
                    ParseFilesWithGenerator(functionBodyGenerator, status);
                }

                string entryClassName = entryPointManager.GetChosenEntryPointOrNull();

                if (!String.IsNullOrWhiteSpace(entryClassName))
                {
                    codeGenerator.AddEntryPoint(entryClassName, EntryPointManager.EntryPointName);
                }

                codeGenerator.Output(Args.OutputDirectory, Args.OutputFileName, status);
            }
            catch (CompilerLogException)
            {
                //Supress compiler errors
            }
            finally
            {
                codeGenerator.Close();
            }

            return status;
        }
Ejemplo n.º 3
0
 public ClepsMemberGeneratorVisitor(CompileStatus status, ClassManager classManager, ICodeGenerator codeGenerator, EntryPointManager entryPointManager) : base(status, classManager, codeGenerator)
 {
     EntryPointManager = entryPointManager;
 }