Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 jdk.compiler.jmod - Compiler Tool
JDK 11 jdk.compiler.jmod is the JMOD file for JDK 11 Compiler tool, which can be invoked by the "javac" command.
JDK 11 Compiler tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.compiler.jmod.
JDK 11 Compiler tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Compiler source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.compiler.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/source/util/TreeScanner.java
/* * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.source.util; import com.sun.source.tree.*; /** * A TreeVisitor that visits all the child tree nodes. * To visit nodes of a particular type, just override the * corresponding visitXYZ method. * Inside your method, call super.visitXYZ to visit descendant * nodes. * * <p>The default implementation of the visitXYZ methods will determine * a result as follows: * <ul> * <li>If the node being visited has no children, the result will be {@code null}. * <li>If the node being visited has one child, the result will be the * result of calling {@code scan} on that child. The child may be a simple node * or itself a list of nodes. * <li> If the node being visited has more than one child, the result will * be determined by calling {@code scan} each child in turn, and then combining the * result of each scan after the first with the cumulative result * so far, as determined by the {@link #reduce} method. Each child may be either * a simple node of a list of nodes. The default behavior of the {@code reduce} * method is such that the result of the visitXYZ method will be the result of * the last child scanned. * </ul> * * <p>Here is an example to count the number of identifier nodes in a tree: * <pre> * class CountIdentifiers extends TreeScanner<Integer,Void> { * {@literal @}Override * public Integer visitIdentifier(IdentifierTree node, Void p) { * return 1; * } * {@literal @}Override * public Integer reduce(Integer r1, Integer r2) { * return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2); * } * } * </pre> * * @param <R> the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param <P> the type of the additional parameter to this visitor's * methods. Use {@code Void} for visitors that do not need an * additional parameter. * * @author Peter von der Ahé * @author Jonathan Gibbons * @since 1.6 */ public class TreeScanner<R,P> implements TreeVisitor<R,P> { /** * Scans a single node. * @param tree the node to be scanned * @param p a parameter value passed to the visit method * @return the result value from the visit method */ public R scan(Tree tree, P p) { return (tree == null) ? null : tree.accept(this, p); } private R scanAndReduce(Tree node, P p, R r) { return reduce(scan(node, p), r); } /** * Scans a sequence of nodes. * @param nodes the nodes to be scanned * @param p a parameter value to be passed to the visit method for each node * @return the combined return value from the visit methods. * The values are combined using the {@link #reduce reduce} method. */ public R scan(Iterable<? extends Tree> nodes, P p) { R r = null; if (nodes != null) { boolean first = true; for (Tree node : nodes) { r = (first ? scan(node, p) : scanAndReduce(node, p, r)); first = false; } } return r; } private R scanAndReduce(Iterable<? extends Tree> nodes, P p, R r) { return reduce(scan(nodes, p), r); } /** * Reduces two results into a combined result. * The default implementation is to return the first parameter. * The general contract of the method is that it may take any action whatsoever. * @param r1 the first of the values to be combined * @param r2 the second of the values to be combined * @return the result of combining the two parameters */ public R reduce(R r1, R r2) { return r1; } /* *************************************************************************** * Visitor methods ****************************************************************************/ /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitCompilationUnit(CompilationUnitTree node, P p) { R r = scan(node.getPackage(), p); r = scanAndReduce(node.getImports(), p, r); r = scanAndReduce(node.getTypeDecls(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitPackage(PackageTree node, P p) { R r = scan(node.getAnnotations(), p); r = scanAndReduce(node.getPackageName(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitImport(ImportTree node, P p) { return scan(node.getQualifiedIdentifier(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitClass(ClassTree node, P p) { R r = scan(node.getModifiers(), p); r = scanAndReduce(node.getTypeParameters(), p, r); r = scanAndReduce(node.getExtendsClause(), p, r); r = scanAndReduce(node.getImplementsClause(), p, r); r = scanAndReduce(node.getMembers(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitMethod(MethodTree node, P p) { R r = scan(node.getModifiers(), p); r = scanAndReduce(node.getReturnType(), p, r); r = scanAndReduce(node.getTypeParameters(), p, r); r = scanAndReduce(node.getParameters(), p, r); r = scanAndReduce(node.getReceiverParameter(), p, r); r = scanAndReduce(node.getThrows(), p, r); r = scanAndReduce(node.getBody(), p, r); r = scanAndReduce(node.getDefaultValue(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitVariable(VariableTree node, P p) { R r = scan(node.getModifiers(), p); r = scanAndReduce(node.getType(), p, r); r = scanAndReduce(node.getNameExpression(), p, r); r = scanAndReduce(node.getInitializer(), p, r); return r; } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitEmptyStatement(EmptyStatementTree node, P p) { return null; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitBlock(BlockTree node, P p) { return scan(node.getStatements(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitDoWhileLoop(DoWhileLoopTree node, P p) { R r = scan(node.getStatement(), p); r = scanAndReduce(node.getCondition(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitWhileLoop(WhileLoopTree node, P p) { R r = scan(node.getCondition(), p); r = scanAndReduce(node.getStatement(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitForLoop(ForLoopTree node, P p) { R r = scan(node.getInitializer(), p); r = scanAndReduce(node.getCondition(), p, r); r = scanAndReduce(node.getUpdate(), p, r); r = scanAndReduce(node.getStatement(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) { R r = scan(node.getVariable(), p); r = scanAndReduce(node.getExpression(), p, r); r = scanAndReduce(node.getStatement(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitLabeledStatement(LabeledStatementTree node, P p) { return scan(node.getStatement(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitSwitch(SwitchTree node, P p) { R r = scan(node.getExpression(), p); r = scanAndReduce(node.getCases(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitCase(CaseTree node, P p) { R r = scan(node.getExpression(), p); r = scanAndReduce(node.getStatements(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitSynchronized(SynchronizedTree node, P p) { R r = scan(node.getExpression(), p); r = scanAndReduce(node.getBlock(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitTry(TryTree node, P p) { R r = scan(node.getResources(), p); r = scanAndReduce(node.getBlock(), p, r); r = scanAndReduce(node.getCatches(), p, r); r = scanAndReduce(node.getFinallyBlock(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitCatch(CatchTree node, P p) { R r = scan(node.getParameter(), p); r = scanAndReduce(node.getBlock(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitConditionalExpression(ConditionalExpressionTree node, P p) { R r = scan(node.getCondition(), p); r = scanAndReduce(node.getTrueExpression(), p, r); r = scanAndReduce(node.getFalseExpression(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitIf(IfTree node, P p) { R r = scan(node.getCondition(), p); r = scanAndReduce(node.getThenStatement(), p, r); r = scanAndReduce(node.getElseStatement(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitExpressionStatement(ExpressionStatementTree node, P p) { return scan(node.getExpression(), p); } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitBreak(BreakTree node, P p) { return null; } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitContinue(ContinueTree node, P p) { return null; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitReturn(ReturnTree node, P p) { return scan(node.getExpression(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitThrow(ThrowTree node, P p) { return scan(node.getExpression(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitAssert(AssertTree node, P p) { R r = scan(node.getCondition(), p); r = scanAndReduce(node.getDetail(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitMethodInvocation(MethodInvocationTree node, P p) { R r = scan(node.getTypeArguments(), p); r = scanAndReduce(node.getMethodSelect(), p, r); r = scanAndReduce(node.getArguments(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitNewClass(NewClassTree node, P p) { R r = scan(node.getEnclosingExpression(), p); r = scanAndReduce(node.getIdentifier(), p, r); r = scanAndReduce(node.getTypeArguments(), p, r); r = scanAndReduce(node.getArguments(), p, r); r = scanAndReduce(node.getClassBody(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitNewArray(NewArrayTree node, P p) { R r = scan(node.getType(), p); r = scanAndReduce(node.getDimensions(), p, r); r = scanAndReduce(node.getInitializers(), p, r); r = scanAndReduce(node.getAnnotations(), p, r); for (Iterable< ? extends Tree> dimAnno : node.getDimAnnotations()) { r = scanAndReduce(dimAnno, p, r); } return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitLambdaExpression(LambdaExpressionTree node, P p) { R r = scan(node.getParameters(), p); r = scanAndReduce(node.getBody(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitParenthesized(ParenthesizedTree node, P p) { return scan(node.getExpression(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitAssignment(AssignmentTree node, P p) { R r = scan(node.getVariable(), p); r = scanAndReduce(node.getExpression(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { R r = scan(node.getVariable(), p); r = scanAndReduce(node.getExpression(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitUnary(UnaryTree node, P p) { return scan(node.getExpression(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitBinary(BinaryTree node, P p) { R r = scan(node.getLeftOperand(), p); r = scanAndReduce(node.getRightOperand(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitTypeCast(TypeCastTree node, P p) { R r = scan(node.getType(), p); r = scanAndReduce(node.getExpression(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitInstanceOf(InstanceOfTree node, P p) { R r = scan(node.getExpression(), p); r = scanAndReduce(node.getType(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitArrayAccess(ArrayAccessTree node, P p) { R r = scan(node.getExpression(), p); r = scanAndReduce(node.getIndex(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitMemberSelect(MemberSelectTree node, P p) { return scan(node.getExpression(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitMemberReference(MemberReferenceTree node, P p) { R r = scan(node.getQualifierExpression(), p); r = scanAndReduce(node.getTypeArguments(), p, r); return r; } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitIdentifier(IdentifierTree node, P p) { return null; } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitLiteral(LiteralTree node, P p) { return null; } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitPrimitiveType(PrimitiveTypeTree node, P p) { return null; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitArrayType(ArrayTypeTree node, P p) { return scan(node.getType(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitParameterizedType(ParameterizedTypeTree node, P p) { R r = scan(node.getType(), p); r = scanAndReduce(node.getTypeArguments(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitUnionType(UnionTypeTree node, P p) { return scan(node.getTypeAlternatives(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitIntersectionType(IntersectionTypeTree node, P p) { return scan(node.getBounds(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitTypeParameter(TypeParameterTree node, P p) { R r = scan(node.getAnnotations(), p); r = scanAndReduce(node.getBounds(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitWildcard(WildcardTree node, P p) { return scan(node.getBound(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitModifiers(ModifiersTree node, P p) { return scan(node.getAnnotations(), p); } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitAnnotation(AnnotationTree node, P p) { R r = scan(node.getAnnotationType(), p); r = scanAndReduce(node.getArguments(), p, r); return r; } /** * {@inheritDoc} This implementation scans the children in left to right order. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitAnnotatedType(AnnotatedTypeTree node, P p) { R r = scan(node.getAnnotations(), p); r = scanAndReduce(node.getUnderlyingType(), p, r); return r; } @Override public R visitModule(ModuleTree node, P p) { R r = scan(node.getAnnotations(), p); r = scanAndReduce(node.getName(), p, r); r = scanAndReduce(node.getDirectives(), p, r); return r; } @Override public R visitExports(ExportsTree node, P p) { R r = scan(node.getPackageName(), p); r = scanAndReduce(node.getModuleNames(), p, r); return r; } @Override public R visitOpens(OpensTree node, P p) { R r = scan(node.getPackageName(), p); r = scanAndReduce(node.getModuleNames(), p, r); return r; } @Override public R visitProvides(ProvidesTree node, P p) { R r = scan(node.getServiceName(), p); r = scanAndReduce(node.getImplementationNames(), p, r); return r; } @Override public R visitRequires(RequiresTree node, P p) { return scan(node.getModuleName(), p); } @Override public R visitUses(UsesTree node, P p) { return scan(node.getServiceName(), p); } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitOther(Tree node, P p) { return null; } /** * {@inheritDoc} This implementation returns {@code null}. * * @param node {@inheritDoc} * @param p {@inheritDoc} * @return the result of scanning */ @Override public R visitErroneous(ErroneousTree node, P p) { return null; } }
⏎ com/sun/source/util/TreeScanner.java
Or download all of them as a single archive file:
File name: jdk.compiler-11.0.1-src.zip File size: 1347269 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.crypto.cryptoki.jmod - Crypto KI Module
2020-08-13, 94444👍, 0💬
Popular Posts:
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...
Where to find answers to frequently asked questions on Downloading and Installing ojdbc.jar - JDBC D...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...