< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java

Print this page




 445             printAnnotations(tree.mods.annotations);
 446             if (tree.getModuleType() == ModuleKind.OPEN) {
 447                 print("open ");
 448             }
 449             print("module ");
 450             printExpr(tree.qualId);
 451             if (tree.directives == null) {
 452                 print(";");
 453             } else {
 454                 printBlock(tree.directives);
 455             }
 456             println();
 457         } catch (IOException e) {
 458             throw new UncheckedIOException(e);
 459         }
 460     }
 461 
 462     @Override
 463     public void visitExports(JCExports tree) {
 464         try {
 465             if (tree.hasTag(EXPORTS)) {
 466                 print("exports ");
 467             } else {
 468                 print("opens ");


 469             }










 470             printExpr(tree.qualid);
 471             if (tree.moduleNames != null) {
 472                 print(" to ");
 473                 printExprs(tree.moduleNames);
 474             }
 475             print(";");
 476         } catch (IOException e) {
 477             throw new UncheckedIOException(e);
 478         }
 479     }
 480 
 481     @Override
 482     public void visitProvides(JCProvides tree) {
 483         try {
 484             print("provides ");
 485             printExpr(tree.serviceName);
 486             print(" with ");
 487             printExprs(tree.implNames);
 488             print(";");
 489         } catch (IOException e) {


1476             if (tree.underlyingType.hasTag(SELECT)) {
1477                 JCFieldAccess access = (JCFieldAccess) tree.underlyingType;
1478                 printExpr(access.selected, TreeInfo.postfixPrec);
1479                 print(".");
1480                 printTypeAnnotations(tree.annotations);
1481                 print(access.name);
1482             } else if (tree.underlyingType.hasTag(TYPEARRAY)) {
1483                 printBaseElementType(tree);
1484                 printBrackets(tree);
1485             } else {
1486                 printTypeAnnotations(tree.annotations);
1487                 printExpr(tree.underlyingType);
1488             }
1489         } catch (IOException e) {
1490             throw new UncheckedIOException(e);
1491         }
1492     }
1493 
1494     public void visitTree(JCTree tree) {
1495         try {
1496             print("(UNKNOWN: " + tree + ")");
1497             println();
1498         } catch (IOException e) {
1499             throw new UncheckedIOException(e);
1500         }
1501     }
1502 
1503 }


 445             printAnnotations(tree.mods.annotations);
 446             if (tree.getModuleType() == ModuleKind.OPEN) {
 447                 print("open ");
 448             }
 449             print("module ");
 450             printExpr(tree.qualId);
 451             if (tree.directives == null) {
 452                 print(";");
 453             } else {
 454                 printBlock(tree.directives);
 455             }
 456             println();
 457         } catch (IOException e) {
 458             throw new UncheckedIOException(e);
 459         }
 460     }
 461 
 462     @Override
 463     public void visitExports(JCExports tree) {
 464         try {

 465             print("exports ");
 466             printExpr(tree.qualid);
 467             if (tree.moduleNames != null) {
 468                 print(" to ");
 469                 printExprs(tree.moduleNames);
 470             }
 471             print(";");
 472         } catch (IOException e) {
 473             throw new UncheckedIOException(e);
 474         }
 475     }
 476 
 477     @Override
 478     public void visitOpens(JCOpens tree) {
 479         try {
 480             print("opens ");
 481             printExpr(tree.qualid);
 482             if (tree.moduleNames != null) {
 483                 print(" to ");
 484                 printExprs(tree.moduleNames);
 485             }
 486             print(";");
 487         } catch (IOException e) {
 488             throw new UncheckedIOException(e);
 489         }
 490     }
 491 
 492     @Override
 493     public void visitProvides(JCProvides tree) {
 494         try {
 495             print("provides ");
 496             printExpr(tree.serviceName);
 497             print(" with ");
 498             printExprs(tree.implNames);
 499             print(";");
 500         } catch (IOException e) {


1487             if (tree.underlyingType.hasTag(SELECT)) {
1488                 JCFieldAccess access = (JCFieldAccess) tree.underlyingType;
1489                 printExpr(access.selected, TreeInfo.postfixPrec);
1490                 print(".");
1491                 printTypeAnnotations(tree.annotations);
1492                 print(access.name);
1493             } else if (tree.underlyingType.hasTag(TYPEARRAY)) {
1494                 printBaseElementType(tree);
1495                 printBrackets(tree);
1496             } else {
1497                 printTypeAnnotations(tree.annotations);
1498                 printExpr(tree.underlyingType);
1499             }
1500         } catch (IOException e) {
1501             throw new UncheckedIOException(e);
1502         }
1503     }
1504 
1505     public void visitTree(JCTree tree) {
1506         try {
1507             print("(UNKNOWN: " + tree.getTag() + ")");
1508             println();
1509         } catch (IOException e) {
1510             throw new UncheckedIOException(e);
1511         }
1512     }
1513 
1514 }
< prev index next >