Package org.eclipse.jdt.internal.compiler

Examples of org.eclipse.jdt.internal.compiler.Compiler


                    }
                }
            }
        };

        final Compiler compiler = new Compiler(nameEnvironment, policy, settingsMap, compilerRequestor, problemFactory, false);

        compiler.compile(compilationUnits);

        final CompilationProblem[] result = new CompilationProblem[problems.size()];
        problems.toArray(result);
        return new org.drools.commons.jci.compilers.CompilationResult(result);
    }
View Full Code Here


        // ----------------------------------------------------------------------
        // Compile!
        // ----------------------------------------------------------------------

        CompilerOptions options = new CompilerOptions( settings );
        Compiler compiler = new Compiler( env, policy, options, requestor, problemFactory );

        ICompilationUnit[] units = (ICompilationUnit[])
            compilationUnits.toArray( new ICompilationUnit[ compilationUnits.size() ] );

        compiler.compile( units );

        return errors;
    }
View Full Code Here

            new ICompilationUnit[classNames.length];
        for (int i = 0; i < compilationUnits.length; i++) {
            String className = classNames[i];
            compilationUnits[i] = new CompilationUnit(fileNames[i], className);
        }
        Compiler compiler = new Compiler(env,
                                         policy,
                                         settings,
                                         requestor,
                                         problemFactory,
                                         true);
        compiler.compile(compilationUnits);

        if (!ctxt.keepGenerated()) {
            File javaFile = new File(ctxt.getServletJavaFileName());
            javaFile.delete();
        }
View Full Code Here

                // Not used; we need the corresponding CompilationUnitDeclaration for the source
                // units (the AST parsed from source) which we don't get access to here, so we
                // instead subclass AST to get our hands on them.
            }
        };
        Compiler compiler = new NonGeneratingCompiler(environment, policy, options, requestor,
                problemFactory, outputMap);
        compiler.compile(sourceUnits.toArray(new ICompilationUnit[sourceUnits.size()]));
    }
View Full Code Here

    this.formatter = ToolFactory
        .createCodeFormatter(getFormattingOptions());
    this.compilerNameEnvironment = new NameEnvironment(
        this.byteCodeClassLoader);
    this.compilerRequester = new CompilerRequestor();
    this.compiler = new Compiler(compilerNameEnvironment,
        DefaultErrorHandlingPolicies.proceedWithAllProblems(),
        getCompilerOptions(), compilerRequester,
        new DefaultProblemFactory(Locale.getDefault()));
  }
View Full Code Here

                    }
                }
            }
        };

        final Compiler compiler = new Compiler(nameEnvironment, policy, settingsMap, compilerRequestor, problemFactory, false);

        compiler.compile(compilationUnits);

        final CompilationProblem[] result = new CompilationProblem[problems.size()];
        problems.toArray(result);
        return new org.drools.commons.jci.compilers.CompilationResult(result);
    }
View Full Code Here

            String className = classNames[i];
            compilationUnits[i] = new CompilationUnit(fileNames[i], className);
        }
        CompilerOptions cOptions = new CompilerOptions(settings);
        cOptions.parseLiteralExpressionsAsConstants = true;
        Compiler compiler = new Compiler(env,
                                         policy,
                                         cOptions,
                                         requestor,
                                         problemFactory);
        compiler.compile(compilationUnits);

        if (!ctxt.keepGenerated()) {
            File javaFile = new File(ctxt.getServletJavaFileName());
            javaFile.delete();
        }
View Full Code Here

               new ICompilationUnit[classNames.length];
           for (int i = 0; i < compilationUnits.length; i++) {
               String className = classNames[i];
               compilationUnits[i] = new CompilationUnit(fileNames[i], className);
           }
           Compiler compiler = new Compiler(env,
                                            policy,
                                            coptions,
                                            requestor,
                                            problemFactory);
           compiler.compile(compilationUnits);
  
           List<DotCompilationProblem> dotProblemsList = new ArrayList<DotCompilationProblem> ();
           if (!problemList.isEmpty()) {
               for(IProblem problem : problemList) {
                DotCompilationProblem p = new DotCompilationProblem(new String(problem.getOriginatingFileName()),
View Full Code Here

            String className = classNames[i];
            compilationUnits[i] = new CompilationUnit(fileNames[i], className);
        }
        CompilerOptions cOptions = new CompilerOptions(settings);
        cOptions.parseLiteralExpressionsAsConstants = true;
        Compiler compiler = new Compiler(env,
                                         policy,
                                         cOptions,
                                         requestor,
                                         problemFactory);
        compiler.compile(compilationUnits);

        if (!ctxt.keepGenerated()) {
            File javaFile = new File(ctxt.getServletJavaFileName());
            javaFile.delete();
        }
View Full Code Here

        IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
        CompilerOptions options = getCompilerOptions();
        CompilerRequestor requestor = new CompilerRequestor();
        IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());

        Compiler compiler = new Compiler(env, policy, options, requestor, problemFactory);
        compiler.compile(new ICompilationUnit[] { new CompilationUnit(source) });

        if (requestor.hasErrors()) {
            String sourceCode = source.getSourceCode();
            String[] sourceCodeLines = sourceCode.split("(\r\n|\r|\n)", -1);
            StringBuilder sb = new StringBuilder();
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.Compiler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.