Package org.eclipse.jdt.internal.compiler.env

Examples of org.eclipse.jdt.internal.compiler.env.ICompilationUnit


     * @throws InvalidSyntaxException if the file has syntax errors.
     */
    public static JavaCompilation compile(File file, long version) {
        CompilerOptions options = getDefaultCompilerOptions(version);
        Parser parser = createCommentRecorderParser(options);
        ICompilationUnit cu = createCompilationUnit(FileUtils.getContent(file), file.getName());
        CompilationResult compilationResult = createDefaultCompilationResult(cu, options);
        return new JavaCompilation(parser.parse(cu, compilationResult), parser.scanner);
    }
View Full Code Here


               
                private NameEnvironmentAnswer findType(String className) {

                    try {
                        if (className.equals(targetClassName)) {
                            ICompilationUnit compilationUnit =
                                new CompilationUnit(sourceFile, className);
                            return
                                new NameEnvironmentAnswer(compilationUnit);
                        }
                        String resourceName =
View Full Code Here

                private NameEnvironmentAnswer findType(String className) {

                    InputStream is = null;
                    try {
                        if (className.equals(targetClassName)) {
                            ICompilationUnit compilationUnit =
                                new CompilationUnit(sourceFile, className);
                            return
                                new NameEnvironmentAnswer(compilationUnit, null);
                        }
                        String resourceName =
View Full Code Here

    }

    @Override
    public void process(CompilationUnitDeclaration cud, int i) {
      super.process(cud, i);
      ICompilationUnit icu = cud.compilationResult().compilationUnit;
      CompilationUnitAdapter adapter = (CompilationUnitAdapter) icu;
      CompilationUnit unit = adapter.getUnit();
      unit.setJdtCud(cud);
      if (!cud.compilationResult().hasErrors()) {
        recordBinaryTypes(unit.getCompiledClasses());
View Full Code Here

        // refresh the total number of units known at this stage
        cud.compilationResult.totalUnitsKnown = totalUnits;
      }

      ICompilationUnit cu = cud.compilationResult.compilationUnit;
      String loc = String.valueOf(cu.getFileName());
      TreeLogger logger = threadLogger.branch(TreeLogger.SPAM,
          "Scanning for additional dependencies: " + loc, null);

      // Examine the cud for magic types.
      //
View Full Code Here

      }
      CompilationUnit unit = findCompilationUnit(qname);
      if (unit != null) {
        logger.log(TreeLogger.SPAM, "Found type in compilation unit: "
            + unit.getDisplayLocation());
        ICompilationUnit icu = new CompilationUnitAdapter(unit);
        NameEnvironmentAnswer out = new NameEnvironmentAnswer(icu, null);
        nameEnvironmentAnswerForTypeName.put(qname, out);
        return out;
      } else {
        ClassLoader classLoader = getClassLoader();
View Full Code Here

        createCompiledClass(classFile, results);
      }
      List<CompiledClass> compiledClasses = new ArrayList<CompiledClass>(results.values());
      addBinaryTypes(compiledClasses);

      ICompilationUnit icu = cud.compilationResult().compilationUnit;
      Adapter adapter = (Adapter) icu;
      CompilationUnitBuilder builder = adapter.getBuilder();

      // TODO(rluble): jsni method parsing should probably be done right after Java parsing, at
      // that moment the original list of imports is still present and this hack would not be
View Full Code Here

      }
      List<CompiledClass> compiledClasses = new ArrayList<CompiledClass>(
          results.values());
      addBinaryTypes(compiledClasses);

      ICompilationUnit icu = cud.compilationResult().compilationUnit;
      Adapter adapter = (Adapter) icu;
      CompilationUnitBuilder builder = adapter.getBuilder();
      processor.process(builder, cud, compiledClasses);
    }
View Full Code Here

          unit.compilationResult.totalUnitsKnown = totalUnits;

          this.lookupEnvironment.unitBeingCompleted = null;
        }

        ICompilationUnit cu = unit.compilationResult.compilationUnit;
        String loc = String.valueOf(cu.getFileName());
        TreeLogger branch = logger.branch(TreeLogger.SPAM,
            "Scanning for additional dependencies: " + loc, null);

        // Examine the cud for magic types.
        //
View Full Code Here

        }
        CompilationUnit unit = findCompilationUnit(qname);
        if (unit != null) {
          branch.log(TreeLogger.SPAM, "Found type in compilation unit: "
              + unit.getDisplayLocation());
          ICompilationUnit icu = new CompilationUnitAdapter(unit);
          return new NameEnvironmentAnswer(icu, null);
        } else {
          ClassLoader classLoader = getClassLoader();
          URL resourceURL = classLoader.getResource(className.replace('.', '/')
              + ".class");
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.env.ICompilationUnit

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.