0001: /* ====================================================================
0002: * The JRefactory License, Version 1.0
0003: *
0004: * Copyright (c) 2001 JRefactory. All rights reserved.
0005: *
0006: * Redistribution and use in source and binary forms, with or without
0007: * modification, are permitted provided that the following conditions
0008: * are met:
0009: *
0010: * 1. Redistributions of source code must retain the above copyright
0011: * notice, this list of conditions and the following disclaimer.
0012: *
0013: * 2. Redistributions in binary form must reproduce the above copyright
0014: * notice, this list of conditions and the following disclaimer in
0015: * the documentation and/or other materials provided with the
0016: * distribution.
0017: *
0018: * 3. The end-user documentation included with the redistribution,
0019: * if any, must include the following acknowledgment:
0020: * "This product includes software developed by the
0021: * JRefactory (http://www.sourceforge.org/projects/jrefactory)."
0022: * Alternately, this acknowledgment may appear in the software itself,
0023: * if and wherever such third-party acknowledgments normally appear.
0024: *
0025: * 4. The names "JRefactory" must not be used to endorse or promote
0026: * products derived from this software without prior written
0027: * permission. For written permission, please contact seguin@acm.org.
0028: *
0029: * 5. Products derived from this software may not be called "JRefactory",
0030: * nor may "JRefactory" appear in their name, without prior written
0031: * permission of Chris Seguin.
0032: *
0033: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
0034: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0035: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0036: * DISCLAIMED. IN NO EVENT SHALL THE CHRIS SEGUIN OR
0037: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0038: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0039: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
0040: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0041: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
0042: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
0043: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0044: * SUCH DAMAGE.
0045: * ====================================================================
0046: *
0047: * This software consists of voluntary contributions made by many
0048: * individuals on behalf of JRefactory. For more information on
0049: * JRefactory, please see
0050: * <http://www.sourceforge.org/projects/jrefactory>.
0051: */
0052: package org.acm.seguin.tools.stub;
0053:
0054: import org.acm.seguin.pretty.PrintData;
0055: import net.sourceforge.jrefactory.parser.JavaParserVisitor;
0056: import net.sourceforge.jrefactory.ast.Node;
0057: import net.sourceforge.jrefactory.ast.SimpleNode;
0058: import net.sourceforge.jrefactory.ast.ASTInterfaceBody;
0059: import net.sourceforge.jrefactory.ast.ASTTryStatement;
0060: import net.sourceforge.jrefactory.ast.ASTSynchronizedStatement;
0061: import net.sourceforge.jrefactory.ast.ASTThrowStatement;
0062: import net.sourceforge.jrefactory.ast.ASTReturnStatement;
0063: import net.sourceforge.jrefactory.ast.ASTForUpdate;
0064: import net.sourceforge.jrefactory.ast.ASTStatementExpressionList;
0065: import net.sourceforge.jrefactory.ast.ASTForInit;
0066: import net.sourceforge.jrefactory.ast.ASTForStatement;
0067: import net.sourceforge.jrefactory.ast.ASTDoStatement;
0068: import net.sourceforge.jrefactory.ast.ASTWhileStatement;
0069: import net.sourceforge.jrefactory.ast.ASTIfStatement;
0070: import net.sourceforge.jrefactory.ast.ASTSwitchLabel;
0071: import net.sourceforge.jrefactory.ast.ASTSwitchStatement;
0072: import net.sourceforge.jrefactory.ast.ASTEmptyStatement;
0073: import net.sourceforge.jrefactory.ast.ASTBlockStatement;
0074: import net.sourceforge.jrefactory.ast.ASTBlock;
0075: import net.sourceforge.jrefactory.ast.ASTStatement;
0076: import net.sourceforge.jrefactory.ast.ASTAllocationExpression;
0077: import net.sourceforge.jrefactory.ast.ASTArgumentList;
0078: import net.sourceforge.jrefactory.ast.ASTArguments;
0079: import net.sourceforge.jrefactory.ast.ASTNullLiteral;
0080: import net.sourceforge.jrefactory.ast.ASTPrimaryExpression;
0081: import net.sourceforge.jrefactory.ast.ASTCastExpression;
0082: import net.sourceforge.jrefactory.ast.ASTPreDecrementExpression;
0083: import net.sourceforge.jrefactory.ast.ASTPreIncrementExpression;
0084: import net.sourceforge.jrefactory.ast.ASTInstanceOfExpression;
0085: import net.sourceforge.jrefactory.ast.ASTAndExpression;
0086: import net.sourceforge.jrefactory.ast.ASTExclusiveOrExpression;
0087: import net.sourceforge.jrefactory.ast.ASTInclusiveOrExpression;
0088: import net.sourceforge.jrefactory.ast.ASTConditionalAndExpression;
0089: import net.sourceforge.jrefactory.ast.ASTConditionalOrExpression;
0090: import net.sourceforge.jrefactory.ast.ASTConditionalExpression;
0091: import net.sourceforge.jrefactory.ast.ASTExpression;
0092: import net.sourceforge.jrefactory.ast.ASTNameList;
0093: import net.sourceforge.jrefactory.ast.ASTResultType;
0094: import net.sourceforge.jrefactory.ast.ASTFormalParameters;
0095: import net.sourceforge.jrefactory.ast.ASTVariableInitializer;
0096: import net.sourceforge.jrefactory.ast.ASTVariableDeclarator;
0097: import net.sourceforge.jrefactory.ast.ASTInterfaceMemberDeclaration;
0098: import net.sourceforge.jrefactory.ast.ASTClassBodyDeclaration;
0099: import net.sourceforge.jrefactory.ast.ASTClassBody;
0100: import net.sourceforge.jrefactory.ast.ASTTypeDeclaration;
0101: import net.sourceforge.jrefactory.ast.ASTCompilationUnit;
0102: import net.sourceforge.jrefactory.ast.ASTPackageDeclaration;
0103: import net.sourceforge.jrefactory.ast.ASTArrayInitializer;
0104: import net.sourceforge.jrefactory.ast.ASTContinueStatement;
0105: import net.sourceforge.jrefactory.ast.ASTBreakStatement;
0106: import net.sourceforge.jrefactory.ast.ASTStatementExpression;
0107: import net.sourceforge.jrefactory.ast.ASTLocalVariableDeclaration;
0108: import net.sourceforge.jrefactory.ast.ASTBooleanLiteral;
0109: import net.sourceforge.jrefactory.ast.ASTPrimarySuffix;
0110: import net.sourceforge.jrefactory.ast.ASTPrimaryPrefix;
0111: import net.sourceforge.jrefactory.ast.ASTPostfixExpression;
0112: import net.sourceforge.jrefactory.ast.ASTUnaryExpressionNotPlusMinus;
0113: import net.sourceforge.jrefactory.ast.ASTUnaryExpression;
0114: import net.sourceforge.jrefactory.ast.ASTMultiplicativeExpression;
0115: import net.sourceforge.jrefactory.ast.ASTAdditiveExpression;
0116: import net.sourceforge.jrefactory.ast.ASTShiftExpression;
0117: import net.sourceforge.jrefactory.ast.ASTRelationalExpression;
0118: import net.sourceforge.jrefactory.ast.ASTEqualityExpression;
0119: import net.sourceforge.jrefactory.ast.ASTAssignmentOperator;
0120: import net.sourceforge.jrefactory.ast.ASTPrimitiveType;
0121: import net.sourceforge.jrefactory.ast.ASTType;
0122: import net.sourceforge.jrefactory.ast.ASTInitializer;
0123: import net.sourceforge.jrefactory.ast.ASTExplicitConstructorInvocation;
0124: import net.sourceforge.jrefactory.ast.ASTFormalParameter;
0125: import net.sourceforge.jrefactory.ast.ASTFieldDeclaration;
0126: import net.sourceforge.jrefactory.ast.ASTNestedInterfaceDeclaration;
0127: import net.sourceforge.jrefactory.ast.ASTMethodDeclaration;
0128: import net.sourceforge.jrefactory.ast.ASTInterfaceDeclaration;
0129: import net.sourceforge.jrefactory.ast.ASTNestedClassDeclaration;
0130: import net.sourceforge.jrefactory.ast.ASTVariableDeclaratorId;
0131: import net.sourceforge.jrefactory.ast.ASTImportDeclaration;
0132: import net.sourceforge.jrefactory.ast.ASTConstructorDeclaration;
0133: import net.sourceforge.jrefactory.ast.ASTUnmodifiedInterfaceDeclaration;
0134: import net.sourceforge.jrefactory.ast.ASTUnmodifiedClassDeclaration;
0135: import net.sourceforge.jrefactory.ast.ASTLiteral;
0136: import net.sourceforge.jrefactory.ast.ASTClassDeclaration;
0137: import net.sourceforge.jrefactory.ast.ASTMethodDeclarator;
0138: import net.sourceforge.jrefactory.ast.ASTLabeledStatement;
0139: import net.sourceforge.jrefactory.ast.ASTArrayDimsAndInits;
0140: import net.sourceforge.jrefactory.ast.ASTName;
0141: import net.sourceforge.jrefactory.ast.ASTAssertionStatement;
0142: import java.io.*;
0143: import java.util.Enumeration;
0144:
0145: import net.sourceforge.jrefactory.ast.ASTTypeParameterList;
0146: import net.sourceforge.jrefactory.ast.ASTTypeParameter;
0147: import net.sourceforge.jrefactory.ast.ASTTypeArguments;
0148: import net.sourceforge.jrefactory.ast.ASTReferenceTypeList;
0149: import net.sourceforge.jrefactory.ast.ASTReferenceType;
0150: import net.sourceforge.jrefactory.ast.ASTClassOrInterfaceType;
0151: import net.sourceforge.jrefactory.ast.ASTActualTypeArgument;
0152: import net.sourceforge.jrefactory.ast.ASTTypeParameters;
0153: import net.sourceforge.jrefactory.ast.ASTGenericNameList;
0154: import net.sourceforge.jrefactory.ast.ASTEnumDeclaration;
0155: import net.sourceforge.jrefactory.ast.ASTEnumElement;
0156: import net.sourceforge.jrefactory.ast.ASTIdentifier;
0157: import net.sourceforge.jrefactory.ast.ASTAnnotation;
0158: import net.sourceforge.jrefactory.ast.ASTMemberValuePairs;
0159: import net.sourceforge.jrefactory.ast.ASTMemberValuePair;
0160: import net.sourceforge.jrefactory.ast.ASTMemberValue;
0161: import net.sourceforge.jrefactory.ast.ASTMemberValueArrayInitializer;
0162: import net.sourceforge.jrefactory.ast.ASTAnnotationTypeDeclaration;
0163: import net.sourceforge.jrefactory.ast.ASTAnnotationTypeMemberDeclaration;
0164: import net.sourceforge.jrefactory.ast.ASTAnnotationMethodDeclaration;
0165: import net.sourceforge.jrefactory.ast.ASTConstantDeclaration;
0166: import net.sourceforge.jrefactory.ast.ASTAnnotation;
0167: import net.sourceforge.jrefactory.ast.Node;
0168: import net.sourceforge.jrefactory.ast.ASTJSPBody;
0169:
0170: import org.acm.seguin.pretty.jdi.*;
0171:
0172: /**
0173: * This object simply reflects all the processing back to the individual nodes.
0174: *
0175: *@author Chris Seguin
0176: *@author Mike Atkinson
0177: *@created October 13, 1999
0178: *@date March 4, 1999
0179: */
0180: public class StubPrintVisitor implements JavaParserVisitor {
0181: /**
0182: * Constructor for the StubPrintVisitor object
0183: */
0184: public StubPrintVisitor() {
0185: }
0186:
0187: /**
0188: * Description of the Method
0189: *
0190: *@param node Description of Parameter
0191: *@param data Description of Parameter
0192: *@return Description of the Returned Value
0193: */
0194: public Object visit(SimpleNode node, Object data) {
0195: node.childrenAccept(this , data);
0196: return data;
0197: }
0198:
0199: /**
0200: * Description of the Method
0201: *
0202: *@param node Description of Parameter
0203: *@param data Description of Parameter
0204: *@return Description of the Returned Value
0205: */
0206: public Object visit(ASTJSPBody node, Object data) {
0207: node.childrenAccept(this , data);
0208: return data;
0209: }
0210:
0211: public Object visit(ASTTypeParameterList node, Object data) {
0212: PrintData printData = (PrintData) data; // Get the data
0213: node.childrenAccept(this , data); // Accept the children
0214: printData.flush(); // Flush the buffer
0215: return data; // Return the data
0216: }
0217:
0218: public Object visit(ASTTypeParameter node, Object data) {
0219: PrintData printData = (PrintData) data; // Get the data
0220: node.childrenAccept(this , data); // Accept the children
0221: printData.flush(); // Flush the buffer
0222: return data; // Return the data
0223: }
0224:
0225: public Object visit(ASTTypeArguments node, Object data) {
0226: PrintData printData = (PrintData) data; // Get the data
0227: node.childrenAccept(this , data); // Accept the children
0228: printData.flush(); // Flush the buffer
0229: return data; // Return the data
0230: }
0231:
0232: public Object visit(ASTReferenceTypeList node, Object data) {
0233: PrintData printData = (PrintData) data; // Get the data
0234: node.childrenAccept(this , data); // Accept the children
0235: printData.flush(); // Flush the buffer
0236: return data; // Return the data
0237: }
0238:
0239: public Object visit(ASTReferenceType node, Object data) {
0240: PrintData printData = (PrintData) data; // Get the data
0241: node.childrenAccept(this , data); // Accept the children
0242: // Add the array
0243: int count = node.getArrayCount();
0244: for (int ndx = 0; ndx < count; ndx++) {
0245: printData.appendText("[");
0246: printData.appendText("]");
0247: }
0248: printData.flush(); // Flush the buffer
0249: return data; // Return the data
0250: }
0251:
0252: /**
0253: * Description of the Method
0254: *
0255: *@param node Description of Parameter
0256: *@param data Description of Parameter
0257: *@return Description of the Returned Value
0258: */
0259: public Object visit(ASTClassOrInterfaceType node, Object data) {
0260: // Get the data
0261: PrintData printData = (PrintData) data;
0262:
0263: // Print the name of the node
0264: printData.appendText(node.getName());
0265:
0266: // Return the data
0267: return data;
0268: }
0269:
0270: public Object visit(ASTActualTypeArgument node, Object data) {
0271: PrintData printData = (PrintData) data; // Get the data
0272: node.childrenAccept(this , data); // Accept the children
0273: printData.flush(); // Flush the buffer
0274: return data; // Return the data
0275: }
0276:
0277: public Object visit(ASTTypeParameters node, Object data) {
0278: PrintData printData = (PrintData) data; // Get the data
0279: node.childrenAccept(this , data); // Accept the children
0280: printData.flush(); // Flush the buffer
0281: return data; // Return the data
0282: }
0283:
0284: /**
0285: * Description of the Method
0286: *
0287: *@param node Description of Parameter
0288: *@param data Description of Parameter
0289: *@return Description of the Returned Value
0290: */
0291: public Object visit(ASTGenericNameList node, Object data) {
0292: PrintData printData = (PrintData) data; // Get the data
0293: // Traverse the children
0294: int countChildren = node.jjtGetNumChildren();
0295: for (int ndx = 0; ndx < countChildren; ndx++) {
0296: if (ndx > 0) {
0297: printData.appendText(", ");
0298: }
0299: Node child = node.jjtGetChild(ndx);
0300: child.jjtAccept(this , data);
0301: }
0302: return data; // Return the data
0303: }
0304:
0305: public Object visit(ASTEnumDeclaration node, Object data) {
0306: PrintData printData = (PrintData) data; // Get the data
0307: node.childrenAccept(this , data); // Accept the children
0308: printData.flush(); // Flush the buffer
0309: return data; // Return the data
0310: }
0311:
0312: public Object visit(ASTEnumElement node, Object data) {
0313: PrintData printData = (PrintData) data; // Get the data
0314: node.childrenAccept(this , data); // Accept the children
0315: printData.flush(); // Flush the buffer
0316: return data; // Return the data
0317: }
0318:
0319: public Object visit(ASTIdentifier node, Object data) {
0320: PrintData printData = (PrintData) data; // Get the data
0321: node.childrenAccept(this , data); // Accept the children
0322: printData.flush(); // Flush the buffer
0323: return data; // Return the data
0324: }
0325:
0326: public Object visit(ASTAnnotationTypeDeclaration node, Object data) {
0327: PrintData printData = (PrintData) data; // Get the data
0328: node.childrenAccept(this , data); // Accept the children
0329: printData.flush(); // Flush the buffer
0330: return data; // Return the data
0331: }
0332:
0333: public Object visit(ASTAnnotationTypeMemberDeclaration node,
0334: Object data) {
0335: PrintData printData = (PrintData) data; // Get the data
0336: node.childrenAccept(this , data); // Accept the children
0337: printData.flush(); // Flush the buffer
0338: return data; // Return the data
0339: }
0340:
0341: public Object visit(ASTAnnotationMethodDeclaration node, Object data) {
0342: PrintData printData = (PrintData) data; // Get the data
0343: node.childrenAccept(this , data); // Accept the children
0344: printData.flush(); // Flush the buffer
0345: return data; // Return the data
0346: }
0347:
0348: public Object visit(ASTConstantDeclaration node, Object data) {
0349: PrintData printData = (PrintData) data; // Get the data
0350: node.childrenAccept(this , data); // Accept the children
0351: printData.flush(); // Flush the buffer
0352: return data; // Return the data
0353: }
0354:
0355: public Object visit(ASTAnnotation node, Object data) {
0356: PrintData printData = (PrintData) data; // Get the data
0357: node.childrenAccept(this , data); // Accept the children
0358: printData.flush(); // Flush the buffer
0359: return data; // Return the data
0360: }
0361:
0362: public Object visit(ASTMemberValuePairs node, Object data) {
0363: PrintData printData = (PrintData) data; // Get the data
0364: node.childrenAccept(this , data); // Accept the children
0365: printData.flush(); // Flush the buffer
0366: return data; // Return the data
0367: }
0368:
0369: public Object visit(ASTMemberValuePair node, Object data) {
0370: PrintData printData = (PrintData) data; // Get the data
0371: node.childrenAccept(this , data); // Accept the children
0372: printData.flush(); // Flush the buffer
0373: return data; // Return the data
0374: }
0375:
0376: public Object visit(ASTMemberValue node, Object data) {
0377: PrintData printData = (PrintData) data; // Get the data
0378: node.childrenAccept(this , data); // Accept the children
0379: printData.flush(); // Flush the buffer
0380: return data; // Return the data
0381: }
0382:
0383: public Object visit(ASTMemberValueArrayInitializer node, Object data) {
0384: PrintData printData = (PrintData) data; // Get the data
0385: node.childrenAccept(this , data); // Accept the children
0386: printData.flush(); // Flush the buffer
0387: return data; // Return the data
0388: }
0389:
0390: /**
0391: * Description of the Method
0392: *
0393: *@param node Description of Parameter
0394: *@param data Description of Parameter
0395: *@return Description of the Returned Value
0396: */
0397: public Object visit(ASTCompilationUnit node, Object data) {
0398: // Get the data
0399: PrintData printData = (PrintData) data;
0400:
0401: // Accept the children
0402: node.childrenAccept(this , data);
0403:
0404: // Flush the buffer
0405: printData.flush();
0406:
0407: // Return the data
0408: return data;
0409: }
0410:
0411: /**
0412: * Description of the Method
0413: *
0414: *@param node Description of Parameter
0415: *@param data Description of Parameter
0416: *@return Description of the Returned Value
0417: */
0418: public Object visit(ASTPackageDeclaration node, Object data) {
0419: // Get the data
0420: PrintData printData = (PrintData) data;
0421:
0422: // Print any tokens
0423: printData.appendKeyword("package");
0424: printData.space();
0425:
0426: // Traverse the children
0427: node.childrenAccept(this , data);
0428:
0429: // Print any final tokens
0430: printData.appendText(";");
0431: printData.newline();
0432:
0433: // Return the data
0434: return data;
0435: }
0436:
0437: /**
0438: * Description of the Method
0439: *
0440: *@param node Description of Parameter
0441: *@param data Description of Parameter
0442: *@return Description of the Returned Value
0443: */
0444: public Object visit(ASTImportDeclaration node, Object data) {
0445: // Get the data
0446: PrintData printData = (PrintData) data;
0447:
0448: // Print any tokens
0449: printData.appendKeyword("import ");
0450:
0451: // Traverse the children
0452: node.childrenAccept(this , data);
0453:
0454: // Print any final tokens
0455: if (node.isImportingPackage()) {
0456: printData.appendText(".");
0457: printData.appendText("*");
0458: printData.appendText(";");
0459: printData.newline();
0460: } else {
0461: printData.appendText(";");
0462: printData.newline();
0463: }
0464:
0465: // Return the data
0466: return data;
0467: }
0468:
0469: /**
0470: * Description of the Method
0471: *
0472: *@param node Description of Parameter
0473: *@param data Description of Parameter
0474: *@return Description of the Returned Value
0475: */
0476: public Object visit(ASTTypeDeclaration node, Object data) {
0477: if (node.hasAnyChildren()) {
0478: node.childrenAccept(this , data);
0479: } else {
0480: // Get the data
0481: PrintData printData = (PrintData) data;
0482: printData.appendText(";");
0483: printData.newline();
0484: }
0485: return data;
0486: }
0487:
0488: /**
0489: * Description of the Method
0490: *
0491: *@param node Description of Parameter
0492: *@param data Description of Parameter
0493: *@return Description of the Returned Value
0494: */
0495: public Object visit(ASTClassDeclaration node, Object data) {
0496: if (!(node.isPublic() || node.isProtected())) {
0497: return data;
0498: }
0499:
0500: // Get the data
0501: PrintData printData = (PrintData) data;
0502:
0503: // Get the child
0504: //SimpleNode child = (SimpleNode) node.jjtGetFirstChild();
0505: int childNo = node.skipAnnotations();
0506: Node child = node.jjtGetChild(childNo);
0507:
0508: // Indent and insert the modifiers
0509: printData.indent();
0510: printData.appendKeyword(node
0511: .getModifiersString(PrintData.STANDARD_ORDER));
0512:
0513: // Traverse the children
0514: child.jjtAccept(this , data);
0515:
0516: return data;
0517: }
0518:
0519: /**
0520: * Description of the Method
0521: *
0522: *@param node Description of Parameter
0523: *@param data Description of Parameter
0524: *@return Description of the Returned Value
0525: */
0526: public Object visit(ASTUnmodifiedClassDeclaration node, Object data) {
0527: // Get the data
0528: PrintData printData = (PrintData) data;
0529:
0530: // Print any tokens
0531: printData.appendKeyword("class ");
0532: printData.appendText(node.getName());
0533:
0534: // Traverse the children
0535: int lastIndex = node.jjtGetNumChildren();
0536: for (int ndx = 0; ndx < lastIndex; ndx++) {
0537: Node next = node.jjtGetChild(ndx);
0538: if (next instanceof ASTClassOrInterfaceType) {
0539: printData.appendKeyword(" extends ");
0540: next.jjtAccept(this , data);
0541: } else if (next instanceof ASTNameList) {
0542: printData.appendKeyword(" implements ");
0543: next.jjtAccept(this , data);
0544: } else if (next instanceof ASTClassBody) {
0545: next.jjtAccept(this , data);
0546: } else {
0547: // TypeParameters - don't do anything
0548: //next.jjtAccept(this, data);
0549: }
0550: }
0551:
0552: // Return the data
0553: return data;
0554: }
0555:
0556: /**
0557: * Description of the Method
0558: *
0559: *@param node Description of Parameter
0560: *@param data Description of Parameter
0561: *@return Description of the Returned Value
0562: */
0563: public Object visit(ASTClassBody node, Object data) {
0564: // Get the data
0565: PrintData printData = (PrintData) data;
0566:
0567: // Print any tokens
0568: printData.beginBlock(false, false);
0569:
0570: // Traverse the children
0571: node.childrenAccept(this , data);
0572:
0573: // Print any tokens
0574: printData.endBlock(); //false, false);
0575:
0576: // Return the data
0577: return data;
0578: }
0579:
0580: /**
0581: * Description of the Method
0582: *
0583: *@param node Description of Parameter
0584: *@param data Description of Parameter
0585: *@return Description of the Returned Value
0586: */
0587: public Object visit(ASTNestedClassDeclaration node, Object data) {
0588: if (!(node.isPublic() || node.isProtected())) {
0589: return data;
0590: }
0591:
0592: // Get the data
0593: PrintData printData = (PrintData) data;
0594:
0595: // Print any tokens
0596: printData.beginClass();
0597:
0598: // Get the child
0599: SimpleNode child = (SimpleNode) node.jjtGetFirstChild();
0600:
0601: // Indent and include the modifiers
0602: printData.indent();
0603: printData.appendKeyword(node
0604: .getModifiersString(PrintData.STANDARD_ORDER));
0605:
0606: // Traverse the children
0607: node.childrenAccept(this , data);
0608: printData.endClass();
0609:
0610: // Return the data
0611: return data;
0612: }
0613:
0614: /**
0615: * Description of the Method
0616: *
0617: *@param node Description of Parameter
0618: *@param data Description of Parameter
0619: *@return Description of the Returned Value
0620: */
0621: public Object visit(ASTClassBodyDeclaration node, Object data) {
0622: node.childrenAccept(this , data);
0623: return data;
0624: }
0625:
0626: /**
0627: * Description of the Method
0628: *
0629: *@param node Description of Parameter
0630: *@param data Description of Parameter
0631: *@return Description of the Returned Value
0632: */
0633: public Object visit(ASTInterfaceDeclaration node, Object data) {
0634: if (!(node.isPublic() || node.isProtected())) {
0635: return data;
0636: }
0637:
0638: // Get the data
0639: PrintData printData = (PrintData) data;
0640:
0641: // Get the child
0642: int childNo = node.skipAnnotations();
0643: Node child = node.jjtGetChild(childNo);
0644:
0645: // Indent and add the modifiers
0646: printData.indent();
0647: printData.appendKeyword(node
0648: .getModifiersString(PrintData.STANDARD_ORDER));
0649:
0650: // Traverse the children
0651: child.jjtAccept(this , data);
0652: printData.flush(); // Flush the buffer
0653:
0654: return data;
0655: }
0656:
0657: /**
0658: * Description of the Method
0659: *
0660: *@param node Description of Parameter
0661: *@param data Description of Parameter
0662: *@return Description of the Returned Value
0663: */
0664: public Object visit(ASTNestedInterfaceDeclaration node, Object data) {
0665: if (!(node.isPublic() || node.isProtected())) {
0666: return data;
0667: }
0668:
0669: // Get the data
0670: PrintData printData = (PrintData) data;
0671: NestedInterfaceDeclaration intfJDI = new NestedInterfaceDeclaration(
0672: node);
0673:
0674: // Print any tokens
0675: printData.beginInterface();
0676:
0677: // Get the child
0678: SimpleNode child = (SimpleNode) node.jjtGetFirstChild();
0679:
0680: // Force the Javadoc to be included
0681: if (intfJDI.isRequired()) {
0682: intfJDI.finish();
0683: //node.printJavaDocComponents(printData);
0684: }
0685:
0686: // Indent and include the modifiers
0687: printData.indent();
0688: printData.appendKeyword(node
0689: .getModifiersString(PrintData.STANDARD_ORDER));
0690:
0691: // Traverse the children
0692: node.childrenAccept(this , data);
0693:
0694: // Finish this interface
0695: printData.endInterface();
0696:
0697: // Return the data
0698: return data;
0699: }
0700:
0701: /**
0702: * Description of the Method
0703: *
0704: *@param node Description of Parameter
0705: *@param data Description of Parameter
0706: *@return Description of the Returned Value
0707: */
0708: public Object visit(ASTUnmodifiedInterfaceDeclaration node,
0709: Object data) {
0710: // Get the data
0711: PrintData printData = (PrintData) data;
0712:
0713: // Print any tokens
0714: printData.appendKeyword("interface ");
0715: printData.appendText(node.getName());
0716:
0717: // Traverse the children
0718: for (int ndx = 0; ndx < node.jjtGetNumChildren(); ndx++) {
0719: Node next = node.jjtGetChild(ndx);
0720: if (next instanceof ASTGenericNameList) {
0721: printData.appendKeyword(" extends ");
0722: next.jjtAccept(this , data);
0723: } else if (next instanceof ASTInterfaceBody) {
0724: next.jjtAccept(this , data);
0725: } else {
0726: // TypeParameters - don't do anything
0727: //next.jjtAccept(this, data);
0728: }
0729: }
0730: printData.flush(); // Flush the buffer
0731:
0732: // Return the data
0733: return data;
0734: }
0735:
0736: /**
0737: * Description of the Method
0738: *
0739: *@param node Description of Parameter
0740: *@param data Description of Parameter
0741: *@return Description of the Returned Value
0742: */
0743: public Object visit(ASTInterfaceBody node, Object data) {
0744: // Get the data
0745: PrintData printData = (PrintData) data;
0746:
0747: // Begin the block
0748: printData.beginBlock(false, false);
0749:
0750: // Traverse the children
0751: node.childrenAccept(this , data);
0752:
0753: // End the block
0754: printData.endBlock(); //false, false);
0755:
0756: // Return the data
0757: return data;
0758: }
0759:
0760: /**
0761: * Description of the Method
0762: *
0763: *@param node Description of Parameter
0764: *@param data Description of Parameter
0765: *@return Description of the Returned Value
0766: */
0767: public Object visit(ASTInterfaceMemberDeclaration node, Object data) {
0768: for (int ndx = 0; ndx < node.jjtGetNumChildren(); ndx++) {
0769: Node next = node.jjtGetChild(ndx);
0770: if (next instanceof ASTMethodDeclaration) {
0771: ((ASTMethodDeclaration) next).setPublic();
0772: next.jjtAccept(this , data);
0773: }
0774: }
0775: return data;
0776: }
0777:
0778: /**
0779: * Description of the Method
0780: *
0781: *@param node Description of Parameter
0782: *@param data Description of Parameter
0783: *@return Description of the Returned Value
0784: */
0785: public Object visit(ASTFieldDeclaration node, Object data) {
0786: if (!(node.isPublic() || node.isProtected())) {
0787: return data;
0788: }
0789:
0790: // Get the data
0791: PrintData printData = (PrintData) data;
0792: FieldDeclaration fieldJDI = new FieldDeclaration(node);
0793:
0794: // Print any tokens
0795: printData.beginField();
0796: if (fieldJDI.isRequired()) {
0797: fieldJDI.finish();
0798: //node.printJavaDocComponents(printData);
0799: }
0800: printData.indent();
0801: printData.appendKeyword(node
0802: .getModifiersString(PrintData.STANDARD_ORDER));
0803:
0804: // Handle the first two children (which are required)
0805: int childNo = node.skipAnnotations();
0806: Node next = node.jjtGetChild(childNo);
0807: next.jjtAccept(this , data);
0808: printData.space();
0809: next = node.jjtGetChild(childNo + 1);
0810: next.jjtAccept(this , data);
0811:
0812: // Traverse the rest of the children
0813: int lastIndex = node.jjtGetNumChildren();
0814: for (int ndx = childNo + 2; ndx < lastIndex; ndx++) {
0815: printData.appendText(", ");
0816: next = node.jjtGetChild(ndx);
0817: next.jjtAccept(this , data);
0818: }
0819:
0820: // Finish the entry
0821: printData.appendText(";");
0822: printData.newline();
0823: printData.endField();
0824:
0825: // Return the data
0826: return data;
0827: }
0828:
0829: /**
0830: * Description of the Method
0831: *
0832: *@param node Description of Parameter
0833: *@param data Description of Parameter
0834: *@return Description of the Returned Value
0835: */
0836: public Object visit(ASTVariableDeclarator node, Object data) {
0837: // Get the data
0838: PrintData printData = (PrintData) data;
0839:
0840: // Handle the first child (which is required)
0841: Node next = node.jjtGetFirstChild();
0842: next.jjtAccept(this , data);
0843:
0844: // Return the data
0845: return data;
0846: }
0847:
0848: /**
0849: * Description of the Method
0850: *
0851: *@param node Description of Parameter
0852: *@param data Description of Parameter
0853: *@return Description of the Returned Value
0854: */
0855: public Object visit(ASTVariableDeclaratorId node, Object data) {
0856: // Get the data
0857: PrintData printData = (PrintData) data;
0858:
0859: // Handle the first child (which is required)
0860: printData.appendText(node.getName());
0861: int last = node.getArrayCount();
0862: for (int ndx = 0; ndx < last; ndx++) {
0863: printData.appendText("[");
0864: printData.appendText("]");
0865: }
0866:
0867: // Return the data
0868: return data;
0869: }
0870:
0871: /**
0872: * Description of the Method
0873: *
0874: *@param node Description of Parameter
0875: *@param data Description of Parameter
0876: *@return Description of the Returned Value
0877: */
0878: public Object visit(ASTVariableInitializer node, Object data) {
0879: node.childrenAccept(this , data);
0880: return data;
0881: }
0882:
0883: /**
0884: * Description of the Method
0885: *
0886: *@param node Description of Parameter
0887: *@param data Description of Parameter
0888: *@return Description of the Returned Value
0889: */
0890: public Object visit(ASTArrayInitializer node, Object data) {
0891: // Get the data
0892: PrintData printData = (PrintData) data;
0893:
0894: // Handle the first child (which is required)
0895: printData.appendText("{");
0896: int last = node.jjtGetNumChildren();
0897: for (int ndx = 0; ndx < last; ndx++) {
0898: if (ndx > 0) {
0899: printData.appendText(", ");
0900: }
0901: Node child = node.jjtGetChild(ndx);
0902: child.jjtAccept(this , data);
0903: }
0904: if (node.isFinalComma()) {
0905: printData.appendText(",");
0906: }
0907: printData.appendText("}");
0908:
0909: // Return the data
0910: return data;
0911: }
0912:
0913: /**
0914: * Description of the Method
0915: *
0916: *@param node Description of Parameter
0917: *@param data Description of Parameter
0918: *@return Description of the Returned Value
0919: */
0920: public Object visit(ASTMethodDeclaration node, Object data) {
0921: if (!(node.isPublic() || node.isProtected())) {
0922: return data;
0923: }
0924:
0925: // Get the data
0926: PrintData printData = (PrintData) data;
0927:
0928: // Print any tokens
0929: //printData.beginMethod(); //no need for lines between methods
0930: printData.indent();
0931: printData.appendKeyword(node
0932: .getModifiersString(PrintData.STANDARD_ORDER));
0933:
0934: // Handle the first two/three children (which are required)
0935: int childNo = node.skipAnnotations();
0936: Node next = node.jjtGetChild(childNo);
0937: next.jjtAccept(this , data);
0938: printData.space();
0939: if (next instanceof ASTTypeParameters) {
0940: next = node.jjtGetChild(++childNo);
0941: next.jjtAccept(this , data);
0942: printData.space();
0943: }
0944: next = node.jjtGetChild(++childNo);
0945: next.jjtAccept(this , data);
0946:
0947: // Traverse the rest of the children
0948: int lastIndex = node.jjtGetNumChildren();
0949: boolean foundBlock = false;
0950: for (int ndx = childNo + 1; ndx < lastIndex; ndx++) {
0951: next = node.jjtGetChild(ndx);
0952: if (next instanceof ASTNameList) {
0953: printData.appendKeyword(" throws ");
0954: next.jjtAccept(this , data);
0955: } else if (next instanceof ASTBlock) {
0956: foundBlock = true;
0957: printData.appendText("{ ");
0958: next.jjtAccept(this , data);
0959: }
0960: }
0961:
0962: // Finish if it is abstract
0963: if (foundBlock) {
0964: printData.appendText("}");
0965: } else {
0966: printData.appendText(";");
0967: printData.newline();
0968: }
0969:
0970: // Note the end of the method
0971: printData.endMethod();
0972:
0973: // Return the data
0974: return data;
0975: }
0976:
0977: /**
0978: * Description of the Method
0979: *
0980: *@param node Description of Parameter
0981: *@param data Description of Parameter
0982: *@return Description of the Returned Value
0983: */
0984: public Object visit(ASTMethodDeclarator node, Object data) {
0985: // Get the data
0986: PrintData printData = (PrintData) data;
0987:
0988: // Handle the first child (which is required)
0989: printData.appendText(node.getName());
0990: node.childrenAccept(this , data);
0991:
0992: int last = node.getArrayCount();
0993: for (int ndx = 0; ndx < last; ndx++) {
0994: printData.appendText("[");
0995: printData.appendText("]");
0996: }
0997:
0998: // Return the data
0999: return data;
1000: }
1001:
1002: /**
1003: * Description of the Method
1004: *
1005: *@param node Description of Parameter
1006: *@param data Description of Parameter
1007: *@return Description of the Returned Value
1008: */
1009: public Object visit(ASTFormalParameters node, Object data) {
1010: // Get the data
1011: PrintData printData = (PrintData) data;
1012:
1013: // Print any tokens
1014: printData.beginExpression(node.jjtGetNumChildren() > 0);
1015:
1016: // Traverse the children
1017: Node next;
1018: int lastIndex = node.jjtGetNumChildren();
1019: for (int ndx = 0; ndx < lastIndex; ndx++) {
1020: if (ndx > 0) {
1021: printData.appendText(", ");
1022: }
1023: next = node.jjtGetChild(ndx);
1024: next.jjtAccept(this , data);
1025: }
1026:
1027: // Finish it
1028: printData.endExpression(node.jjtGetNumChildren() > 0);
1029:
1030: // Return the data
1031: return data;
1032: }
1033:
1034: /**
1035: * Description of the Method
1036: *
1037: *@param node Description of Parameter
1038: *@param data Description of Parameter
1039: *@return Description of the Returned Value
1040: */
1041: public Object visit(ASTFormalParameter node, Object data) {
1042: // Get the data
1043: PrintData printData = (PrintData) data;
1044:
1045: // Print any tokens
1046: if (node.isUsingFinal()) {
1047: printData.appendKeyword("final ");
1048: }
1049:
1050: // Traverse the children
1051: int childNo = node.skipAnnotations();
1052: Node next = node.jjtGetChild(childNo);
1053: next.jjtAccept(this , data);
1054: printData.space();
1055: next = node.jjtGetChild(childNo + 1);
1056: next.jjtAccept(this , data);
1057:
1058: // Return the data
1059: return data;
1060: }
1061:
1062: /**
1063: * Description of the Method
1064: *
1065: *@param node Description of Parameter
1066: *@param data Description of Parameter
1067: *@return Description of the Returned Value
1068: */
1069: public Object visit(ASTConstructorDeclaration node, Object data) {
1070: if (!(node.isPublic() || node.isProtected())) {
1071: return data;
1072: }
1073:
1074: // Get the data
1075: PrintData printData = (PrintData) data;
1076:
1077: // Print any tokens
1078: printData.beginMethod();
1079: printData.indent();
1080: printData.appendKeyword(node
1081: .getModifiersString(PrintData.STANDARD_ORDER));
1082: printData.appendText(node.getName());
1083:
1084: // Handle the first child (which is required)
1085: int childNo = node.skipAnnotationsAndTypeParameters();
1086: Node next = node.jjtGetChild(childNo);
1087: next.jjtAccept(this , data);
1088:
1089: // Get the last index
1090: int lastIndex = node.jjtGetNumChildren();
1091: int startAt = childNo + 1;
1092:
1093: // Handle the name list if it is present
1094: if (lastIndex > childNo + 1) {
1095: next = node.jjtGetChild(startAt);
1096: if (next instanceof ASTNameList) {
1097: printData.space();
1098: printData.appendKeyword("throws");
1099: printData.space();
1100: next.jjtAccept(this , data);
1101: startAt++;
1102: }
1103: }
1104:
1105: // Print the starting block
1106: printData.beginBlock(false, false);
1107:
1108: // Traverse the rest of the children
1109: boolean foundBlock = false;
1110: for (int ndx = startAt; ndx < lastIndex; ndx++) {
1111: next = node.jjtGetChild(ndx);
1112: next.jjtAccept(this , data);
1113: }
1114:
1115: // Print the end block
1116: printData.endBlock(false, false);
1117: printData.endMethod();
1118:
1119: // Return the data
1120: return data;
1121: }
1122:
1123: /**
1124: * Description of the Method
1125: *
1126: *@param node Description of Parameter
1127: *@param data Description of Parameter
1128: *@return Description of the Returned Value
1129: */
1130: public Object visit(ASTExplicitConstructorInvocation node,
1131: Object data) {
1132: return data;
1133: }
1134:
1135: /**
1136: * Description of the Method
1137: *
1138: *@param node Description of Parameter
1139: *@param data Description of Parameter
1140: *@return Description of the Returned Value
1141: */
1142: public Object visit(ASTInitializer node, Object data) {
1143: return data;
1144: }
1145:
1146: /**
1147: * Description of the Method
1148: *
1149: *@param node Description of Parameter
1150: *@param data Description of Parameter
1151: *@return Description of the Returned Value
1152: */
1153: public Object visit(ASTType node, Object data) {
1154: // Get the data
1155: PrintData printData = (PrintData) data;
1156:
1157: // Traverse the children
1158: node.childrenAccept(this , data);
1159:
1160: // Return the data
1161: return data;
1162: }
1163:
1164: /**
1165: * Description of the Method
1166: *
1167: *@param node Description of Parameter
1168: *@param data Description of Parameter
1169: *@return Description of the Returned Value
1170: */
1171: public Object visit(ASTPrimitiveType node, Object data) {
1172: // Get the data
1173: PrintData printData = (PrintData) data;
1174:
1175: // Print the name of the node
1176: printData.appendKeyword(node.getName());
1177:
1178: // Return the data
1179: return data;
1180: }
1181:
1182: /**
1183: * Description of the Method
1184: *
1185: *@param node Description of Parameter
1186: *@param data Description of Parameter
1187: *@return Description of the Returned Value
1188: */
1189: public Object visit(ASTResultType node, Object data) {
1190: // Get the data
1191: PrintData printData = (PrintData) data;
1192:
1193: // Traverse the children
1194: if (node.hasAnyChildren()) {
1195: node.childrenAccept(this , data);
1196: } else {
1197: printData.appendKeyword("void");
1198: }
1199:
1200: // Return the data
1201: return data;
1202: }
1203:
1204: /**
1205: * Description of the Method
1206: *
1207: *@param node Description of Parameter
1208: *@param data Description of Parameter
1209: *@return Description of the Returned Value
1210: */
1211: public Object visit(ASTName node, Object data) {
1212: // Get the data
1213: PrintData printData = (PrintData) data;
1214:
1215: // Print the name of the node
1216: printData.appendText(node.getName());
1217:
1218: // Return the data
1219: return data;
1220: }
1221:
1222: /**
1223: * Description of the Method
1224: *
1225: *@param node Description of Parameter
1226: *@param data Description of Parameter
1227: *@return Description of the Returned Value
1228: */
1229: public Object visit(ASTNameList node, Object data) {
1230: // Get the data
1231: PrintData printData = (PrintData) data;
1232:
1233: // Traverse the children
1234: int countChildren = node.jjtGetNumChildren();
1235: for (int ndx = 0; ndx < countChildren; ndx++) {
1236: if (ndx > 0) {
1237: printData.appendText(", ");
1238: }
1239: Node child = node.jjtGetChild(ndx);
1240: child.jjtAccept(this , data);
1241: }
1242:
1243: // Return the data
1244: return data;
1245: }
1246:
1247: /**
1248: * Description of the Method
1249: *
1250: *@param node Description of Parameter
1251: *@param data Description of Parameter
1252: *@return Description of the Returned Value
1253: */
1254: public Object visit(ASTExpression node, Object data) {
1255: return data;
1256: }
1257:
1258: /**
1259: * Description of the Method
1260: *
1261: *@param node Description of Parameter
1262: *@param data Description of Parameter
1263: *@return Description of the Returned Value
1264: */
1265: public Object visit(ASTAssignmentOperator node, Object data) {
1266: return data;
1267: }
1268:
1269: /**
1270: * Description of the Method
1271: *
1272: *@param node Description of Parameter
1273: *@param data Description of Parameter
1274: *@return Description of the Returned Value
1275: */
1276: public Object visit(ASTConditionalExpression node, Object data) {
1277: return data;
1278: }
1279:
1280: /**
1281: * Description of the Method
1282: *
1283: *@param node Description of Parameter
1284: *@param data Description of Parameter
1285: *@return Description of the Returned Value
1286: */
1287: public Object visit(ASTConditionalOrExpression node, Object data) {
1288: return data;
1289: }
1290:
1291: /**
1292: * Description of the Method
1293: *
1294: *@param node Description of Parameter
1295: *@param data Description of Parameter
1296: *@return Description of the Returned Value
1297: */
1298: public Object visit(ASTConditionalAndExpression node, Object data) {
1299: return data;
1300: }
1301:
1302: /**
1303: * Description of the Method
1304: *
1305: *@param node Description of Parameter
1306: *@param data Description of Parameter
1307: *@return Description of the Returned Value
1308: */
1309: public Object visit(ASTInclusiveOrExpression node, Object data) {
1310: return data;
1311: }
1312:
1313: /**
1314: * Description of the Method
1315: *
1316: *@param node Description of Parameter
1317: *@param data Description of Parameter
1318: *@return Description of the Returned Value
1319: */
1320: public Object visit(ASTExclusiveOrExpression node, Object data) {
1321: return data;
1322: }
1323:
1324: /**
1325: * Description of the Method
1326: *
1327: *@param node Description of Parameter
1328: *@param data Description of Parameter
1329: *@return Description of the Returned Value
1330: */
1331: public Object visit(ASTAndExpression node, Object data) {
1332: return data;
1333: }
1334:
1335: /**
1336: * Description of the Method
1337: *
1338: *@param node Description of Parameter
1339: *@param data Description of Parameter
1340: *@return Description of the Returned Value
1341: */
1342: public Object visit(ASTEqualityExpression node, Object data) {
1343: return data;
1344: }
1345:
1346: /**
1347: * Description of the Method
1348: *
1349: *@param node Description of Parameter
1350: *@param data Description of Parameter
1351: *@return Description of the Returned Value
1352: */
1353: public Object visit(ASTInstanceOfExpression node, Object data) {
1354: return data;
1355: }
1356:
1357: /**
1358: * Description of the Method
1359: *
1360: *@param node Description of Parameter
1361: *@param data Description of Parameter
1362: *@return Description of the Returned Value
1363: */
1364: public Object visit(ASTRelationalExpression node, Object data) {
1365: return data;
1366: }
1367:
1368: /**
1369: * Description of the Method
1370: *
1371: *@param node Description of Parameter
1372: *@param data Description of Parameter
1373: *@return Description of the Returned Value
1374: */
1375: public Object visit(ASTShiftExpression node, Object data) {
1376: return data;
1377: }
1378:
1379: /**
1380: * Description of the Method
1381: *
1382: *@param node Description of Parameter
1383: *@param data Description of Parameter
1384: *@return Description of the Returned Value
1385: */
1386: public Object visit(ASTAdditiveExpression node, Object data) {
1387: return data;
1388: }
1389:
1390: /**
1391: * Description of the Method
1392: *
1393: *@param node Description of Parameter
1394: *@param data Description of Parameter
1395: *@return Description of the Returned Value
1396: */
1397: public Object visit(ASTMultiplicativeExpression node, Object data) {
1398: return data;
1399: }
1400:
1401: /**
1402: * Description of the Method
1403: *
1404: *@param node Description of Parameter
1405: *@param data Description of Parameter
1406: *@return Description of the Returned Value
1407: */
1408: public Object visit(ASTUnaryExpression node, Object data) {
1409: return data;
1410: }
1411:
1412: /**
1413: * Description of the Method
1414: *
1415: *@param node Description of Parameter
1416: *@param data Description of Parameter
1417: *@return Description of the Returned Value
1418: */
1419: public Object visit(ASTPreIncrementExpression node, Object data) {
1420: return data;
1421: }
1422:
1423: /**
1424: * Description of the Method
1425: *
1426: *@param node Description of Parameter
1427: *@param data Description of Parameter
1428: *@return Description of the Returned Value
1429: */
1430: public Object visit(ASTPreDecrementExpression node, Object data) {
1431: return data;
1432: }
1433:
1434: /**
1435: * Description of the Method
1436: *
1437: *@param node Description of Parameter
1438: *@param data Description of Parameter
1439: *@return Description of the Returned Value
1440: */
1441: public Object visit(ASTUnaryExpressionNotPlusMinus node, Object data) {
1442: return data;
1443: }
1444:
1445: /**
1446: * Description of the Method
1447: *
1448: *@param node Description of Parameter
1449: *@param data Description of Parameter
1450: *@return Description of the Returned Value
1451: */
1452: public Object visit(ASTPostfixExpression node, Object data) {
1453: return data;
1454: }
1455:
1456: /**
1457: * Description of the Method
1458: *
1459: *@param node Description of Parameter
1460: *@param data Description of Parameter
1461: *@return Description of the Returned Value
1462: */
1463: public Object visit(ASTCastExpression node, Object data) {
1464: return data;
1465: }
1466:
1467: /**
1468: * Description of the Method
1469: *
1470: *@param node Description of Parameter
1471: *@param data Description of Parameter
1472: *@return Description of the Returned Value
1473: */
1474: public Object visit(ASTPrimaryExpression node, Object data) {
1475: return data;
1476: }
1477:
1478: /**
1479: * Description of the Method
1480: *
1481: *@param node Description of Parameter
1482: *@param data Description of Parameter
1483: *@return Description of the Returned Value
1484: */
1485: public Object visit(ASTPrimaryPrefix node, Object data) {
1486: return data;
1487: }
1488:
1489: /**
1490: * Description of the Method
1491: *
1492: *@param node Description of Parameter
1493: *@param data Description of Parameter
1494: *@return Description of the Returned Value
1495: */
1496: public Object visit(ASTPrimarySuffix node, Object data) {
1497: return data;
1498: }
1499:
1500: /**
1501: * Description of the Method
1502: *
1503: *@param node Description of Parameter
1504: *@param data Description of Parameter
1505: *@return Description of the Returned Value
1506: */
1507: public Object visit(ASTLiteral node, Object data) {
1508: return data;
1509: }
1510:
1511: /**
1512: * Description of the Method
1513: *
1514: *@param node Description of Parameter
1515: *@param data Description of Parameter
1516: *@return Description of the Returned Value
1517: */
1518: public Object visit(ASTBooleanLiteral node, Object data) {
1519: return data;
1520: }
1521:
1522: /**
1523: * Description of the Method
1524: *
1525: *@param node Description of Parameter
1526: *@param data Description of Parameter
1527: *@return Description of the Returned Value
1528: */
1529: public Object visit(ASTNullLiteral node, Object data) {
1530: return data;
1531: }
1532:
1533: /**
1534: * Description of the Method
1535: *
1536: *@param node Description of Parameter
1537: *@param data Description of Parameter
1538: *@return Description of the Returned Value
1539: */
1540: public Object visit(ASTArguments node, Object data) {
1541: return data;
1542: }
1543:
1544: /**
1545: * Description of the Method
1546: *
1547: *@param node Description of Parameter
1548: *@param data Description of Parameter
1549: *@return Description of the Returned Value
1550: */
1551: public Object visit(ASTArgumentList node, Object data) {
1552: return data;
1553: }
1554:
1555: /**
1556: * Description of the Method
1557: *
1558: *@param node Description of Parameter
1559: *@param data Description of Parameter
1560: *@return Description of the Returned Value
1561: */
1562: public Object visit(ASTAllocationExpression node, Object data) {
1563: return data;
1564: }
1565:
1566: /**
1567: * Description of the Method
1568: *
1569: *@param node Description of Parameter
1570: *@param data Description of Parameter
1571: *@return Description of the Returned Value
1572: */
1573: public Object visit(ASTArrayDimsAndInits node, Object data) {
1574: return data;
1575: }
1576:
1577: /**
1578: * Description of the Method
1579: *
1580: *@param node Description of Parameter
1581: *@param data Description of Parameter
1582: *@return Description of the Returned Value
1583: */
1584: public Object visit(ASTStatement node, Object data) {
1585: return data;
1586: }
1587:
1588: /**
1589: * Description of the Method
1590: *
1591: *@param node Description of Parameter
1592: *@param data Description of Parameter
1593: *@return Description of the Returned Value
1594: */
1595: public Object visit(ASTLabeledStatement node, Object data) {
1596: return data;
1597: }
1598:
1599: /**
1600: * Description of the Method
1601: *
1602: *@param node Description of Parameter
1603: *@param data Description of Parameter
1604: *@return Description of the Returned Value
1605: */
1606: public Object visit(ASTBlock node, Object data) {
1607: return data;
1608: }
1609:
1610: /**
1611: * Description of the Method
1612: *
1613: *@param node Description of Parameter
1614: *@param data Description of Parameter
1615: *@return Description of the Returned Value
1616: */
1617: public Object visit(ASTBlockStatement node, Object data) {
1618: return data;
1619: }
1620:
1621: /**
1622: * Description of the Method
1623: *
1624: *@param node Description of Parameter
1625: *@param data Description of Parameter
1626: *@return Description of the Returned Value
1627: */
1628: public Object visit(ASTLocalVariableDeclaration node, Object data) {
1629: return data;
1630: }
1631:
1632: /**
1633: * Description of the Method
1634: *
1635: *@param node Description of Parameter
1636: *@param data Description of Parameter
1637: *@return Description of the Returned Value
1638: */
1639: public Object visit(ASTEmptyStatement node, Object data) {
1640: return data;
1641: }
1642:
1643: /**
1644: * Description of the Method
1645: *
1646: *@param node Description of Parameter
1647: *@param data Description of Parameter
1648: *@return Description of the Returned Value
1649: */
1650: public Object visit(ASTStatementExpression node, Object data) {
1651: return data;
1652: }
1653:
1654: /**
1655: * Description of the Method
1656: *
1657: *@param node Description of Parameter
1658: *@param data Description of Parameter
1659: *@return Description of the Returned Value
1660: */
1661: public Object visit(ASTSwitchStatement node, Object data) {
1662: return data;
1663: }
1664:
1665: /**
1666: * Description of the Method
1667: *
1668: *@param node Description of Parameter
1669: *@param data Description of Parameter
1670: *@return Description of the Returned Value
1671: */
1672: public Object visit(ASTSwitchLabel node, Object data) {
1673: return data;
1674: }
1675:
1676: /**
1677: * Description of the Method
1678: *
1679: *@param node Description of Parameter
1680: *@param data Description of Parameter
1681: *@return Description of the Returned Value
1682: */
1683: public Object visit(ASTIfStatement node, Object data) {
1684: return data;
1685: }
1686:
1687: /**
1688: * Description of the Method
1689: *
1690: *@param node Description of Parameter
1691: *@param data Description of Parameter
1692: *@return Description of the Returned Value
1693: */
1694: public Object visit(ASTWhileStatement node, Object data) {
1695: return data;
1696: }
1697:
1698: /**
1699: * Description of the Method
1700: *
1701: *@param node Description of Parameter
1702: *@param data Description of Parameter
1703: *@return Description of the Returned Value
1704: */
1705: public Object visit(ASTDoStatement node, Object data) {
1706: return data;
1707: }
1708:
1709: /**
1710: * Description of the Method
1711: *
1712: *@param node Description of Parameter
1713: *@param data Description of Parameter
1714: *@return Description of the Returned Value
1715: */
1716: public Object visit(ASTForStatement node, Object data) {
1717: return data;
1718: }
1719:
1720: /**
1721: * Description of the Method
1722: *
1723: *@param node Description of Parameter
1724: *@param data Description of Parameter
1725: *@return Description of the Returned Value
1726: */
1727: public Object visit(ASTForInit node, Object data) {
1728: return data;
1729: }
1730:
1731: /**
1732: * Description of the Method
1733: *
1734: *@param node Description of Parameter
1735: *@param data Description of Parameter
1736: *@return Description of the Returned Value
1737: */
1738: public Object visit(ASTStatementExpressionList node, Object data) {
1739: return data;
1740: }
1741:
1742: /**
1743: * Description of the Method
1744: *
1745: *@param node Description of Parameter
1746: *@param data Description of Parameter
1747: *@return Description of the Returned Value
1748: */
1749: public Object visit(ASTForUpdate node, Object data) {
1750: return data;
1751: }
1752:
1753: /**
1754: * Description of the Method
1755: *
1756: *@param node Description of Parameter
1757: *@param data Description of Parameter
1758: *@return Description of the Returned Value
1759: */
1760: public Object visit(ASTBreakStatement node, Object data) {
1761: return data;
1762: }
1763:
1764: /**
1765: * Description of the Method
1766: *
1767: *@param node Description of Parameter
1768: *@param data Description of Parameter
1769: *@return Description of the Returned Value
1770: */
1771: public Object visit(ASTContinueStatement node, Object data) {
1772: return data;
1773: }
1774:
1775: /**
1776: * Description of the Method
1777: *
1778: *@param node Description of Parameter
1779: *@param data Description of Parameter
1780: *@return Description of the Returned Value
1781: */
1782: public Object visit(ASTReturnStatement node, Object data) {
1783: return data;
1784: }
1785:
1786: /**
1787: * Description of the Method
1788: *
1789: *@param node Description of Parameter
1790: *@param data Description of Parameter
1791: *@return Description of the Returned Value
1792: */
1793: public Object visit(ASTThrowStatement node, Object data) {
1794: return data;
1795: }
1796:
1797: /**
1798: * Description of the Method
1799: *
1800: *@param node Description of Parameter
1801: *@param data Description of Parameter
1802: *@return Description of the Returned Value
1803: */
1804: public Object visit(ASTSynchronizedStatement node, Object data) {
1805: return data;
1806: }
1807:
1808: /**
1809: * Description of the Method
1810: *
1811: *@param node Description of Parameter
1812: *@param data Description of Parameter
1813: *@return Description of the Returned Value
1814: */
1815: public Object visit(ASTTryStatement node, Object data) {
1816: return data;
1817: }
1818:
1819: /**
1820: * Visit the assertion node
1821: *
1822: *@param node the node
1823: *@param data the data needed to perform the visit
1824: *@return the result of visiting the node
1825: */
1826: public Object visit(ASTAssertionStatement node, Object data) {
1827: return data;
1828: }
1829: }
|