< prev index next >

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

Print this page




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                 }
1580                 return;




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


< prev index next >