/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** Prints out a tree as an indented Java source program.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
this.sourceOutput = sourceOutput;
}
/** Set when we are producing source output. If we're not
* producing source output, we can sometimes give more detail in
* the output even though that detail would not be valid java
* source.
*/
private final boolean sourceOutput;
/** The output stream on which trees are printed.
*/
/** Indentation width (can be reassigned from outside).
*/
/** The current left margin.
*/
/** The enclosing class name.
*/
/** A hashtable mapping trees to their documentation comments
* (can be null)
*/
/** Align code to be indented to left margin.
*/
}
/** Increase left margin by indentation width.
*/
void indent() {
}
/** Decrease left margin by indentation width.
*/
void undent() {
}
/** Enter a new precedence level. Emit a `(' if new precedence level
* is less than precedence level so far.
* @param contextPrec The precedence level in force so far.
* @param ownPrec The new precedence level.
*/
}
/** Leave precedence level. Emit a `(' if inner precedence level
* is less than precedence level we revert to.
* @param contextPrec The precedence level we revert to.
* @param ownPrec The inner precedence level.
*/
}
/** Print string, replacing all non-ascii character with unicode escapes.
*/
}
/** Print new line.
*/
}
/**************************************************************************
* Traversal methods
*************************************************************************/
/** Exception to propogate IOException through visitXXX methods */
super(e.getMessage(), e);
}
}
/** Visitor argument: the current precedence level.
*/
int prec;
/** Visitor method: print expression tree.
* @param prec The current precedence level.
*/
try {
else {
}
} catch (UncheckedIOException ex) {
throw e;
} finally {
}
}
/** Derived visitor method: print expression tree at minimum precedence level
* for expression.
*/
}
/** Derived visitor method: print statement tree.
*/
}
/** Derived visitor method: print list of expression trees, separated by given string.
* @param sep the separator string
*/
}
}
}
/** Derived visitor method: print list of expression trees, separated by commas.
*/
}
/** Derived visitor method: print list of statements, each on a separate line.
*/
align();
println();
}
}
/** Print a set of modifiers.
*/
}
println();
align();
}
}
/** Print documentation comment, if it exists
* @param tree The tree for which a documentation comment should be printed.
*/
if (docComments != null) {
int pos = 0;
align();
print(" *");
}
align();
}
}
}
//where
return pos;
}
/** If type parameter list is non-empty, print it enclosed in "<...>" brackets.
*/
print("<");
print(">");
}
}
/** Print a block.
*/
print("{");
println();
indent();
undent();
align();
print("}");
}
/** Print a block.
*/
print("{");
println();
indent();
boolean first = true;
if (isEnumerator(l.head)) {
if (!first) {
print(",");
println();
}
align();
first = false;
}
}
print(";");
println();
if (!isEnumerator(l.head)) {
align();
println();
}
}
undent();
align();
print("}");
}
/** Is the given tree an enumerator definition? */
}
/** Print unit consisting of package clause and import statements in toplevel,
* followed by class definition. if class definition == null,
* print all definitions in toplevel.
* @param tree The toplevel tree
* @param cdef The class definition, which is assumed to be part of the
* toplevel tree.
*/
print("package ");
print(";");
println();
}
boolean firstImport = true;
l = l.tail) {
if (firstImport) {
firstImport = false;
println();
}
}
} else {
}
}
println();
}
}
// where
class UsedVisitor extends TreeScanner {
}
boolean result = false;
}
}
UsedVisitor v = new UsedVisitor();
return v.result;
}
/**************************************************************************
* Visitor methods
*************************************************************************/
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("import ");
print(";");
println();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(" extends ");
}
} else {
else
print(" extends ");
}
print(" implements ");
}
}
print(" ");
} else {
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
// when producing source output, omit anonymous constructors
enclClassName == null &&
sourceOutput) return;
} else {
}
print("(");
print(")");
print(" throws ");
}
print(" default ");
}
print(" ");
} else {
print(";");
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
}
print("/*public static final*/ ");
print(" /*enum*/ ");
print("(");
print(")");
}
print(" ");
}
return;
}
print(" /* = ");
print(" */");
}
} else {
} else {
}
print(" = ");
}
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(";");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("do ");
align();
print(" while ");
} else {
print("(");
print(")");
}
print(";");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("while ");
} else {
print("(");
print(")");
}
print(" ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("for (");
}
} else {
}
}
print("; ");
print("; ");
print(") ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("for (");
print(" : ");
print(") ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("switch ");
} else {
print("(");
print(")");
}
print(" {");
println();
align();
print("}");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("default");
} else {
print("case ");
}
print(": ");
println();
indent();
undent();
align();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("synchronized ");
} else {
print("(");
print(")");
}
print(" ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("try ");
print("(");
boolean first = true;
if (!first) {
println();
indent();
}
first = false;
}
print(") ");
}
}
print(" finally ");
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(" catch (");
print(") ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(" ? ");
print(" : ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("if ");
} else {
print("(");
print(")");
}
print(" ");
print(" else ");
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("break");
print(";");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("continue");
print(";");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("return");
print(" ");
}
print(";");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("throw ");
print(";");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("assert ");
print(" : ");
}
print(";");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(".<");
} else {
print("<");
print(">");
}
} else {
}
print("(");
print(")");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(".");
}
print("new ");
print("<");
print(">");
}
print("(");
print(")");
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("new ");
else
print("[");
print("]");
}
if (elem instanceof JCArrayTypeTree)
}
print("{");
print("}");
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("(");
print(")");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(" = ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
switch(tag) {
default: throw new Error();
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} else {
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("(");
print(")");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(" instanceof ");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("[");
print("]");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
break;
break;
break;
break;
print("\'" +
"\'");
break;
break;
print("null");
break;
default:
break;
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("byte");
break;
print("char");
break;
print("short");
break;
print("int");
break;
print("long");
break;
print("float");
break;
print("double");
break;
print("boolean");
break;
print("void");
break;
default:
print("error");
break;
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
// Prints the inner element type of a nested array
}
// prints the brackets of a nested array in reverse order
while (true) {
print("[]");
}
}
try {
print("<");
print(">");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print(" extends ");
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("(ERROR)");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
print("@");
print("(");
print(")");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
try {
println();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
}