< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java

Print this page




 286     /** The name table.
 287      */
 288     protected Names names;
 289 
 290     /** The attributor.
 291      */
 292     protected Attr attr;
 293 
 294     /** The analyzer
 295      */
 296     protected Analyzer analyzer;
 297 
 298     /** The attributor.
 299      */
 300     protected Check chk;
 301 
 302     /** The flow analyzer.
 303      */
 304     protected Flow flow;
 305 




 306     /** The modules visitor
 307      */
 308     protected Modules modules;
 309 
 310     /** The module finder
 311      */
 312     protected ModuleFinder moduleFinder;
 313 
 314     /** The diagnostics factory
 315      */
 316     protected JCDiagnostic.Factory diags;
 317 
 318     protected DeferredCompletionFailureHandler dcfh;
 319 
 320     /** The type eraser.
 321      */
 322     protected TransTypes transTypes;
 323 
 324     /** The syntactic sugar desweetener.
 325      */


 398         todo = Todo.instance(context);
 399 
 400         fileManager = context.get(JavaFileManager.class);
 401         parserFactory = ParserFactory.instance(context);
 402         compileStates = CompileStates.instance(context);
 403 
 404         try {
 405             // catch completion problems with predefineds
 406             syms = Symtab.instance(context);
 407         } catch (CompletionFailure ex) {
 408             // inlined Check.completionError as it is not initialized yet
 409             log.error(Errors.CantAccess(ex.sym, ex.getDetailValue()));
 410         }
 411         source = Source.instance(context);
 412         preview = Preview.instance(context);
 413         attr = Attr.instance(context);
 414         analyzer = Analyzer.instance(context);
 415         chk = Check.instance(context);
 416         gen = Gen.instance(context);
 417         flow = Flow.instance(context);

 418         transTypes = TransTypes.instance(context);
 419         lower = Lower.instance(context);
 420         annotate = Annotate.instance(context);
 421         types = Types.instance(context);
 422         taskListener = MultiTaskListener.instance(context);
 423         modules = Modules.instance(context);
 424         moduleFinder = ModuleFinder.instance(context);
 425         diags = Factory.instance(context);
 426         dcfh = DeferredCompletionFailureHandler.instance(context);
 427 
 428         finder.sourceCompleter = sourceCompleter;
 429         modules.findPackageInFile = this::findPackageInFile;
 430         moduleFinder.moduleNameFromSourceReader = this::readModuleName;
 431 
 432         options = Options.instance(context);
 433 
 434         verbose       = options.isSet(VERBOSE);
 435         sourceOutput  = options.isSet(PRINTSOURCE); // used to be -s
 436         lineDebugInfo = options.isUnset(G_CUSTOM) ||
 437                         options.isSet(G_CUSTOM, "lines");


1540             TreeMaker localMake = make.forToplevel(env.toplevel);
1541 
1542             if (env.tree.hasTag(JCTree.Tag.PACKAGEDEF) || env.tree.hasTag(JCTree.Tag.MODULEDEF)) {
1543                 if (!(sourceOutput)) {
1544                     if (shouldStop(CompileState.LOWER))
1545                         return;
1546                     List<JCTree> def = lower.translateTopLevelClass(env, env.tree, localMake);
1547                     if (def.head != null) {
1548                         Assert.check(def.tail.isEmpty());
1549                         results.add(new Pair<>(env, (JCClassDecl)def.head));
1550                     }
1551                 }
1552                 return;
1553             }
1554 
1555             if (shouldStop(CompileState.TRANSTYPES))
1556                 return;
1557 
1558             env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
1559             compileStates.put(env, CompileState.TRANSTYPES);


1560 
1561             if (Feature.LAMBDA.allowedInSource(source) && scanner.hasLambdas) {
1562                 if (shouldStop(CompileState.UNLAMBDA))
1563                     return;
1564 
1565                 env.tree = LambdaToMethod.instance(context).translateTopLevelClass(env, env.tree, localMake);
1566                 compileStates.put(env, CompileState.UNLAMBDA);
1567             }
1568 
1569             if (shouldStop(CompileState.LOWER))
1570                 return;
1571 
1572             if (sourceOutput) {
1573                 //emit standard Java source file, only for compilation
1574                 //units enumerated explicitly on the command line
1575                 JCClassDecl cdef = (JCClassDecl)env.tree;
1576                 if (untranslated instanceof JCClassDecl &&
1577                     rootClasses.contains((JCClassDecl)untranslated)) {
1578                     results.add(new Pair<>(env, cdef));
1579                 }




 286     /** The name table.
 287      */
 288     protected Names names;
 289 
 290     /** The attributor.
 291      */
 292     protected Attr attr;
 293 
 294     /** The analyzer
 295      */
 296     protected Analyzer analyzer;
 297 
 298     /** The attributor.
 299      */
 300     protected Check chk;
 301 
 302     /** The flow analyzer.
 303      */
 304     protected Flow flow;
 305 
 306     /** The intrinsics analyzer.
 307      */
 308     protected IntrinsicsVisitor intrinsicsVisitor;
 309 
 310     /** The modules visitor
 311      */
 312     protected Modules modules;
 313 
 314     /** The module finder
 315      */
 316     protected ModuleFinder moduleFinder;
 317 
 318     /** The diagnostics factory
 319      */
 320     protected JCDiagnostic.Factory diags;
 321 
 322     protected DeferredCompletionFailureHandler dcfh;
 323 
 324     /** The type eraser.
 325      */
 326     protected TransTypes transTypes;
 327 
 328     /** The syntactic sugar desweetener.
 329      */


 402         todo = Todo.instance(context);
 403 
 404         fileManager = context.get(JavaFileManager.class);
 405         parserFactory = ParserFactory.instance(context);
 406         compileStates = CompileStates.instance(context);
 407 
 408         try {
 409             // catch completion problems with predefineds
 410             syms = Symtab.instance(context);
 411         } catch (CompletionFailure ex) {
 412             // inlined Check.completionError as it is not initialized yet
 413             log.error(Errors.CantAccess(ex.sym, ex.getDetailValue()));
 414         }
 415         source = Source.instance(context);
 416         preview = Preview.instance(context);
 417         attr = Attr.instance(context);
 418         analyzer = Analyzer.instance(context);
 419         chk = Check.instance(context);
 420         gen = Gen.instance(context);
 421         flow = Flow.instance(context);
 422         intrinsicsVisitor = IntrinsicsVisitor.instance(context);
 423         transTypes = TransTypes.instance(context);
 424         lower = Lower.instance(context);
 425         annotate = Annotate.instance(context);
 426         types = Types.instance(context);
 427         taskListener = MultiTaskListener.instance(context);
 428         modules = Modules.instance(context);
 429         moduleFinder = ModuleFinder.instance(context);
 430         diags = Factory.instance(context);
 431         dcfh = DeferredCompletionFailureHandler.instance(context);
 432 
 433         finder.sourceCompleter = sourceCompleter;
 434         modules.findPackageInFile = this::findPackageInFile;
 435         moduleFinder.moduleNameFromSourceReader = this::readModuleName;
 436 
 437         options = Options.instance(context);
 438 
 439         verbose       = options.isSet(VERBOSE);
 440         sourceOutput  = options.isSet(PRINTSOURCE); // used to be -s
 441         lineDebugInfo = options.isUnset(G_CUSTOM) ||
 442                         options.isSet(G_CUSTOM, "lines");


1545             TreeMaker localMake = make.forToplevel(env.toplevel);
1546 
1547             if (env.tree.hasTag(JCTree.Tag.PACKAGEDEF) || env.tree.hasTag(JCTree.Tag.MODULEDEF)) {
1548                 if (!(sourceOutput)) {
1549                     if (shouldStop(CompileState.LOWER))
1550                         return;
1551                     List<JCTree> def = lower.translateTopLevelClass(env, env.tree, localMake);
1552                     if (def.head != null) {
1553                         Assert.check(def.tail.isEmpty());
1554                         results.add(new Pair<>(env, (JCClassDecl)def.head));
1555                     }
1556                 }
1557                 return;
1558             }
1559 
1560             if (shouldStop(CompileState.TRANSTYPES))
1561                 return;
1562 
1563             env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
1564             compileStates.put(env, CompileState.TRANSTYPES);
1565 
1566             env.tree = intrinsicsVisitor.analyzeTree(env.tree, env);
1567 
1568             if (Feature.LAMBDA.allowedInSource(source) && scanner.hasLambdas) {
1569                 if (shouldStop(CompileState.UNLAMBDA))
1570                     return;
1571 
1572                 env.tree = LambdaToMethod.instance(context).translateTopLevelClass(env, env.tree, localMake);
1573                 compileStates.put(env, CompileState.UNLAMBDA);
1574             }
1575 
1576             if (shouldStop(CompileState.LOWER))
1577                 return;
1578 
1579             if (sourceOutput) {
1580                 //emit standard Java source file, only for compilation
1581                 //units enumerated explicitly on the command line
1582                 JCClassDecl cdef = (JCClassDecl)env.tree;
1583                 if (untranslated instanceof JCClassDecl &&
1584                     rootClasses.contains((JCClassDecl)untranslated)) {
1585                     results.add(new Pair<>(env, cdef));
1586                 }


< prev index next >