Package org.eclipse.jdt.internal.compiler.batch

Examples of org.eclipse.jdt.internal.compiler.batch.CompilationUnit


        String code = context.getContents();
        if (code == null) {
            return null;
        }

        CompilationUnit sourceUnit = new CompilationUnit(code.toCharArray(),
                context.file.getName(), "UTF-8"); //$NON-NLS-1$
        CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
        CompilationUnitDeclaration unit;
        try {
            unit = mParser.parse(sourceUnit, compilationResult);
View Full Code Here


            String contents = context.getContents();
            if (contents == null) {
                continue;
            }
            File file = context.file;
            CompilationUnit unit = new CompilationUnit(contents.toCharArray(), file.getPath(),
                    UTF_8);
            sources.add(unit);
            mSourceUnits.put(file, unit);
        }
        List<String> classPath = computeClassPath(contexts);
View Full Code Here

                }
            }
        }

        if (sourceUnit == null) {
            sourceUnit = new CompilationUnit(code.toCharArray(), context.file.getName(), UTF_8);
        }
        try {
            CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
            return getParser().parse(sourceUnit, compilationResult);
        } catch (AbortCompilation e) {
View Full Code Here

                }
            }
        }

        if (sourceUnit == null) {
            sourceUnit = new CompilationUnit(code.toCharArray(), context.file.getName(), UTF_8);
        }
        try {
            CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
            return getParser().parse(sourceUnit, compilationResult);
        } catch (AbortCompilation e) {
View Full Code Here

            String contents = context.getContents();
            if (contents == null) {
                continue;
            }
            File file = context.file;
            CompilationUnit unit = new CompilationUnit(contents.toCharArray(), file.getPath(),
                    UTF_8);
            sources.add(unit);
            mSourceUnits.put(file, unit);
        }
        List<String> classPath = computeClassPath(contexts);
        mCompiled = Maps.newHashMapWithExpectedSize(mSourceUnits.size());
        try {
            parse(createCompilerOptions(), sources, classPath, mCompiled, mClient);
        } catch (Throwable t) {
            mClient.log(t, "ECJ compiler crashed");
        }

        if (DEBUG_DUMP_PARSE_ERRORS) {
            for (CompilationUnitDeclaration unit : mCompiled.values()) {
                // so maybe I don't need my map!!
                CategorizedProblem[] problems = unit.compilationResult()
                        .getAllProblems();
                if (problems != null) {
                    for (IProblem problem : problems) {
                        if (problem == null || !problem.isError()) {
                            continue;
View Full Code Here

            String contents = context.getContents();
            if (contents == null) {
                continue;
            }
            File file = context.file;
            CompilationUnit unit = new CompilationUnit(contents.toCharArray(), file.getPath(),
                    UTF_8);
            sources.add(unit);
            mSourceUnits.put(file, unit);
        }
        List<String> classPath = computeClassPath(contexts);
        mCompiled = Maps.newHashMapWithExpectedSize(mSourceUnits.size());
        try {
            parse(createCompilerOptions(), sources, classPath, mCompiled, mClient);
        } catch (Throwable t) {
            mClient.log(t, "ECJ compiler crashed");
        }

        if (DEBUG_DUMP_PARSE_ERRORS) {
            for (CompilationUnitDeclaration unit : mCompiled.values()) {
                // so maybe I don't need my map!!
                CategorizedProblem[] problems = unit.compilationResult()
                        .getAllProblems();
                if (problems != null) {
                    for (IProblem problem : problems) {
                        if (problem == null || !problem.isError()) {
                            continue;
View Full Code Here

                }
            }
        }

        if (sourceUnit == null) {
            sourceUnit = new CompilationUnit(code.toCharArray(), context.file.getName(), UTF_8);
        }
        try {
            CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
            return getParser().parse(sourceUnit, compilationResult);
        } catch (AbortCompilation e) {
View Full Code Here

          DefaultErrorHandlingPolicies.proceedWithAllProblems(),
          compilerOptions,
          new DefaultProblemFactory()
        ), compilerOptions.parseLiteralExpressionsAsConstants);
      parser.javadocParser.checkDocComment = true;
      CompilationUnit sourceUnit = new CompilationUnit(source.getRawInput().toCharArray(), source.getName(), "UTF-8");
      CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
      parser.parse(sourceUnit, compilationResult);
    }
  }
View Full Code Here

        DefaultErrorHandlingPolicies.proceedWithAllProblems(),
        compilerOptions,
        new DefaultProblemFactory()
      ), compilerOptions.parseLiteralExpressionsAsConstants);
    parser.javadocParser.checkDocComment = true;
    CompilationUnit sourceUnit = new CompilationUnit(source.getRawInput().toCharArray(), source.getName(), "UTF-8");
    CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
    CompilationUnitDeclaration cud = parser.parse(sourceUnit, compilationResult);
   
    if (cud.hasErrors()) return null;
    return cud;
View Full Code Here

        DefaultErrorHandlingPolicies.proceedWithAllProblems(),
        compilerOptions,
        new DefaultProblemFactory()
      ), compilerOptions.parseLiteralExpressionsAsConstants);
    parser.javadocParser.checkDocComment = true;
    CompilationUnit sourceUnit = new CompilationUnit(source.getRawInput().toCharArray(), source.getName(), "UTF-8");
    CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
    CompilationUnitDeclaration cud = parser.parse(sourceUnit, compilationResult);
   
    if (cud.hasErrors()) return null;
   
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.batch.CompilationUnit

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.