0001: /*
0002: * xtc - The eXTensible Compiler
0003: * Copyright (C) 2007 New York University
0004: *
0005: * This program is free software; you can redistribute it and/or
0006: * modify it under the terms of the GNU General Public License
0007: * version 2 as published by the Free Software Foundation.
0008: *
0009: * This program is distributed in the hope that it will be useful,
0010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012: * GNU General Public License for more details.
0013: *
0014: * You should have received a copy of the GNU General Public License
0015: * along with this program; if not, write to the Free Software
0016: * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
0017: * USA.
0018: */
0019: package xtc.typical;
0020:
0021: import xtc.tree.Visitor;
0022: import xtc.tree.GNode;
0023: import xtc.tree.Node;
0024:
0025: /**
0026: * Visitor to set flags indicating which liraries are used.
0027: *
0028: * @author Anh Le
0029: * @version $Revision: 1.1 $
0030: */
0031: public class FlagSetter extends Visitor {
0032:
0033: /** A variable to check if List is used. */
0034: public boolean isListUsed;
0035:
0036: /** A variable to check if ArrayList is used. */
0037: public boolean isArrayListUsed;
0038:
0039: /** A variable to check if BigInteger is used. */
0040: public boolean isBigIntegerUsed;
0041:
0042: /** A variable to check if Pair is used. */
0043: public boolean isPairUsed;
0044:
0045: /** A variable to check if Node is used. */
0046: public boolean isNodeUsed;
0047:
0048: /** A variable to check if GNode is used. */
0049: public boolean isGNodeUsed;
0050:
0051: /** A variable to check if Primitives is used. */
0052: public boolean isPrimitivesUsed;
0053:
0054: /** A variable to check if Record is used. */
0055: public boolean isRecordUsed;
0056:
0057: /** A variable to check if Variant is used. */
0058: public boolean isVariantUsed;
0059:
0060: /** A variable to check if Tuple is used. */
0061: public boolean isTupleUsed;
0062:
0063: /** A variable to check if Reduction is used. */
0064: public boolean isReductionUsed;
0065:
0066: /** A variable to check if Name is used. */
0067: public boolean isNameUsed;
0068:
0069: /** A variable to check if Scope is used. */
0070: public boolean isScopeUsed;
0071:
0072: /** A variable to check if ScopeKind is used. */
0073: public boolean isScopeKindUsed;
0074:
0075: /** A variable to check if Analyzer is used. */
0076: public boolean isAnalyzerUsed;
0077:
0078: /**
0079: * Create a new flag settor.
0080: *
0081: * @param n The root of the expression.
0082: *
0083: */
0084: public FlagSetter(GNode n) {
0085: // Set all flag to false
0086: isListUsed = false;
0087: isArrayListUsed = false;
0088: isBigIntegerUsed = false;
0089: isPairUsed = false;
0090: isNodeUsed = false;
0091: isGNodeUsed = false;
0092: isPrimitivesUsed = false;
0093: isRecordUsed = false;
0094: isVariantUsed = false;
0095: isTupleUsed = false;
0096: isReductionUsed = false;
0097: isNameUsed = false;
0098: isScopeUsed = false;
0099: isScopeKindUsed = false;
0100: isAnalyzerUsed = false;
0101:
0102: // Dispatch
0103: dispatch(n);
0104: }
0105:
0106: /**
0107: * Check the name of a used library and set the corresponding flag variable.
0108: *
0109: * @param name The name of the library.
0110: */
0111: private void checkName(String name) {
0112: if ("List".equals(name))
0113: isListUsed = true;
0114: else if ("ArrayList".equals(name))
0115: isArrayListUsed = true;
0116: else if ("BigInteger".equals(name))
0117: isBigIntegerUsed = true;
0118: else if ("Pair".equals(name))
0119: isPairUsed = true;
0120: else if ("Node".equals(name))
0121: isNodeUsed = true;
0122: else if ("GNode".equals(name))
0123: isGNodeUsed = true;
0124: else if ("Primitives".equals(name))
0125: isPrimitivesUsed = true;
0126: else if ("Record".equals(name))
0127: isRecordUsed = true;
0128: else if ("Variant".equals(name))
0129: isVariantUsed = true;
0130: else if ("Tuple".equals(name))
0131: isTupleUsed = true;
0132: else if ("Reduction".equals(name))
0133: isReductionUsed = true;
0134: else if ("Name".equals(name))
0135: isNameUsed = true;
0136: else if ("Scope".equals(name))
0137: isScopeUsed = true;
0138: else if ("ScopeKind".equals(name))
0139: isScopeKindUsed = true;
0140: else if ("Analyzer".equals(name))
0141: isAnalyzerUsed = true;
0142: }
0143:
0144: /**
0145: * Set flags in ConstructorDeclaration .
0146: *
0147: * @param n The node
0148: */
0149: public void visitConstructorDeclaration(GNode n) {
0150: dispatch(n.getGeneric(1));
0151: dispatch(n.getGeneric(3));
0152: dispatch(n.getGeneric(5));
0153: }
0154:
0155: /**
0156: * Set flags in FieldDeclaration .
0157: *
0158: * @param n The node
0159: */
0160: public void visitFieldDeclaration(GNode n) {
0161: dispatch(n.getGeneric(1));
0162: dispatch(n.getGeneric(2));
0163: }
0164:
0165: /**
0166: * Set flags in TypeParameter .
0167: *
0168: * @param n The node
0169: */
0170: public void visitTypeParameter(GNode n) {
0171: checkName(n.getString(0));
0172: dispatch(n.getGeneric(1));
0173: }
0174:
0175: /**
0176: * Set flags in TypeInstantiation .
0177: *
0178: * @param n The node
0179: */
0180: public void visitTypeInstantiation(GNode n) {
0181: checkName(n.getString(0));
0182: dispatch(n.getGeneric(1));
0183: }
0184:
0185: /**
0186: * Set flags in EnumConstant.
0187: *
0188: * @param n The node
0189: */
0190: public void visitEnumConstant(GNode n) {
0191: dispatch(n.getGeneric(0));
0192: dispatch(n.getGeneric(2));
0193: dispatch(n.getGeneric(3));
0194: }
0195:
0196: /**
0197: * Set flags in QualifiedIdentifier.
0198: *
0199: * @param n The node
0200: */
0201: public void visitQualifiedIdentifier(GNode n) {
0202: for (int i = 0; i < n.size(); i++) {
0203: checkName(n.getString(i));
0204: }
0205: }
0206:
0207: /**
0208: * Set flags in PrimaryIdentifier.
0209: *
0210: * @param n The node
0211: */
0212: public void visitPrimaryIdentifier(GNode n) {
0213: checkName(n.getString(0));
0214: }
0215:
0216: /**
0217: * Set flags in PrimaryIdentifier.
0218: *
0219: * @param n The node
0220: */
0221: public void visitDeclarator(GNode n) {
0222: dispatch(n.getGeneric(2));
0223: }
0224:
0225: /**
0226: * Set flags in AnnotationDeclaration.
0227: *
0228: * @param n The node
0229: */
0230: public void visitAnnotationDeclaration(GNode n) {
0231: dispatch(n.getGeneric(2));
0232: }
0233:
0234: /**
0235: * Set flags in SelectionExpression.
0236: *
0237: * @param n The node
0238: */
0239: public void visitSelectionExpression(GNode n) {
0240: dispatch(n.getGeneric(0));
0241: }
0242:
0243: /**
0244: * Set flags in PostfixExpression.
0245: *
0246: * @param n The node
0247: */
0248: public void visitPostfixExpression(GNode n) {
0249: dispatch(n.getGeneric(0));
0250: }
0251:
0252: /**
0253: * Set flags in Type.
0254: *
0255: * @param n The node
0256: */
0257: public void visitType(GNode n) {
0258: dispatch(n.getGeneric(0));
0259: }
0260:
0261: /**
0262: * Set flags in CallExpression.
0263: *
0264: * @param n The node
0265: */
0266: public void visitCallExpression(GNode n) {
0267: dispatch(n.getGeneric(0));
0268: dispatch(n.getGeneric(1));
0269: dispatch(n.getGeneric(3));
0270: }
0271:
0272: /**
0273: * Set flags in Expression.
0274: *
0275: * @param n The node
0276: */
0277: public void visitExpression(GNode n) {
0278: dispatch(n.getGeneric(0));
0279: dispatch(n.getGeneric(2));
0280: }
0281:
0282: /**
0283: * Set flags in EqualityExpression.
0284: *
0285: * @param n The node
0286: */
0287: public void visitEqualityExpression(GNode n) {
0288: dispatch(n.getGeneric(0));
0289: dispatch(n.getGeneric(2));
0290: }
0291:
0292: /**
0293: * Set flags in RelationalExpression.
0294: *
0295: * @param n The node
0296: */
0297: public void visitRelationalExpression(GNode n) {
0298: dispatch(n.getGeneric(0));
0299: dispatch(n.getGeneric(2));
0300: }
0301:
0302: /**
0303: * Set flags in ShiftExpression.
0304: *
0305: * @param n The node
0306: */
0307: public void visitShiftExpression(GNode n) {
0308: dispatch(n.getGeneric(0));
0309: dispatch(n.getGeneric(2));
0310: }
0311:
0312: /**
0313: * Set flags in AdditiveExpression.
0314: *
0315: * @param n The node
0316: */
0317: public void visitAdditiveExpression(GNode n) {
0318: dispatch(n.getGeneric(0));
0319: dispatch(n.getGeneric(2));
0320: }
0321:
0322: /**
0323: * Set flags in MultiplicativeExpression.
0324: *
0325: * @param n The node
0326: */
0327: public void visitMultiplicativeExpression(GNode n) {
0328: dispatch(n.getGeneric(0));
0329: dispatch(n.getGeneric(2));
0330: }
0331:
0332: /**
0333: * Set flags in ClassDeclaration.
0334: *
0335: * @param n The node
0336: */
0337: public void visitClassDeclaration(GNode n) {
0338: dispatch(n.getGeneric(2));
0339: dispatch(n.getGeneric(3));
0340: dispatch(n.getGeneric(4));
0341: dispatch(n.getGeneric(5));
0342: }
0343:
0344: /**
0345: * Set flags in InterfaceDeclaration.
0346: *
0347: * @param n The node
0348: */
0349: public void visitInterfaceDeclaration(GNode n) {
0350: dispatch(n.getGeneric(2));
0351: dispatch(n.getGeneric(3));
0352: dispatch(n.getGeneric(4));
0353: }
0354:
0355: /**
0356: * Set flags in EnumDeclaration.
0357: *
0358: * @param n The node
0359: */
0360: public void visitEnumDeclaration(GNode n) {
0361: dispatch(n.getGeneric(2));
0362: dispatch(n.getGeneric(3));
0363: dispatch(n.getGeneric(4));
0364: }
0365:
0366: /**
0367: * Set flags in EnhancedForControl.
0368: *
0369: * @param n The node
0370: */
0371: public void visitEnhancedForControl(GNode n) {
0372: dispatch(n.getGeneric(1));
0373: dispatch(n.getGeneric(3));
0374: }
0375:
0376: /**
0377: * Set flags in AnnotationMethod.
0378: *
0379: * @param n The node
0380: */
0381: public void visitAnnotationMethod(GNode n) {
0382: dispatch(n.getGeneric(1));
0383: dispatch(n.getGeneric(3));
0384: }
0385:
0386: /**
0387: * Set flags in MethodDeclaration.
0388: *
0389: * @param n The node
0390: */
0391: public void visitMethodDeclaration(GNode n) {
0392: dispatch(n.getGeneric(1));
0393: dispatch(n.getGeneric(2));
0394: dispatch(n.getGeneric(4));
0395: dispatch(n.getGeneric(7));
0396: }
0397:
0398: /**
0399: * Set flags in BlockDeclaration.
0400: *
0401: * @param n The node
0402: */
0403: public void visitBlockDeclaration(GNode n) {
0404: dispatch(n.getGeneric(1));
0405: }
0406:
0407: /**
0408: * Set flags in LabeledStatement.
0409: *
0410: * @param n The node
0411: */
0412: public void visitLabeledStatement(GNode n) {
0413: dispatch(n.getGeneric(1));
0414: }
0415:
0416: /**
0417: * Set flags in UnaryExpression.
0418: *
0419: * @param n The node
0420: */
0421: public void visitUnaryExpression(GNode n) {
0422: dispatch(n.getGeneric(1));
0423: }
0424:
0425: /**
0426: * Set flags in FormalParameter.
0427: *
0428: * @param n The node
0429: */
0430: public void visitFormalParameter(GNode n) {
0431: dispatch(n.getGeneric(1));
0432: }
0433:
0434: /**
0435: * Set flags in ElementValuePair.
0436: *
0437: * @param n The node
0438: */
0439: public void visitElementValuePair(GNode n) {
0440: dispatch(n.getGeneric(1));
0441: }
0442:
0443: /**
0444: * Set flags in WildcardBound.
0445: *
0446: * @param n The node
0447: */
0448: public void visitWildcardBound(GNode n) {
0449: dispatch(n.getGeneric(1));
0450: }
0451:
0452: /**
0453: * Set flags in this node.
0454: *
0455: * @param n The node
0456: */
0457: public void visitClassBody(GNode n) {
0458: for (int i = 0; i < n.size(); i++) {
0459: dispatch(n.getGeneric(i));
0460: }
0461: }
0462:
0463: /**
0464: * Set flags in this node.
0465: *
0466: * @param n The node
0467: */
0468: public void visitExtension(GNode n) {
0469: for (int i = 0; i < n.size(); i++) {
0470: dispatch(n.getGeneric(i));
0471: }
0472: }
0473:
0474: /**
0475: * Set flags in this node.
0476: *
0477: * @param n The node
0478: */
0479: public void visitImplementation(GNode n) {
0480: for (int i = 0; i < n.size(); i++) {
0481: dispatch(n.getGeneric(i));
0482: }
0483: }
0484:
0485: /**
0486: * Set flags in this node.
0487: *
0488: * @param n The node
0489: */
0490: public void visitBlock(GNode n) {
0491: for (int i = 0; i < n.size(); i++) {
0492: dispatch(n.getGeneric(i));
0493: }
0494: }
0495:
0496: /**
0497: * Set flags in this node.
0498: *
0499: * @param n The node
0500: */
0501: public void visitConditionalStatement(GNode n) {
0502: for (int i = 0; i < n.size(); i++) {
0503: dispatch(n.getGeneric(i));
0504: }
0505: }
0506:
0507: /**
0508: * Set flags in this node.
0509: *
0510: * @param n The node
0511: */
0512: public void visitForStatement(GNode n) {
0513: for (int i = 0; i < n.size(); i++) {
0514: dispatch(n.getGeneric(i));
0515: }
0516: }
0517:
0518: /**
0519: * Set flags in this node.
0520: *
0521: * @param n The node
0522: */
0523: public void visitWhileStatement(GNode n) {
0524: for (int i = 0; i < n.size(); i++) {
0525: dispatch(n.getGeneric(i));
0526: }
0527: }
0528:
0529: /**
0530: * Set flags in this node.
0531: *
0532: * @param n The node
0533: */
0534: public void visitDoWhileStatement(GNode n) {
0535: for (int i = 0; i < n.size(); i++) {
0536: dispatch(n.getGeneric(i));
0537: }
0538: }
0539:
0540: /**
0541: * Set flags in this node.
0542: *
0543: * @param n The node
0544: */
0545: public void visitTryCatchFinallyStatement(GNode n) {
0546: for (int i = 0; i < n.size(); i++) {
0547: dispatch(n.getGeneric(i));
0548: }
0549: }
0550:
0551: /**
0552: * Set flags in this node.
0553: *
0554: * @param n The node
0555: */
0556: public void visitSwitchStatement(GNode n) {
0557: for (int i = 0; i < n.size(); i++) {
0558: dispatch(n.getGeneric(i));
0559: }
0560: }
0561:
0562: /**
0563: * Set flags in this node.
0564: *
0565: * @param n The node
0566: */
0567: public void visitSynchronizedStatement(GNode n) {
0568: for (int i = 0; i < n.size(); i++) {
0569: dispatch(n.getGeneric(i));
0570: }
0571: }
0572:
0573: /**
0574: * Set flags in this node.
0575: *
0576: * @param n The node
0577: */
0578: public void visitReturnStatement(GNode n) {
0579: for (int i = 0; i < n.size(); i++) {
0580: dispatch(n.getGeneric(i));
0581: }
0582: }
0583:
0584: /**
0585: * Set flags in this node.
0586: *
0587: * @param n The node
0588: */
0589: public void visitThrowStatement(GNode n) {
0590: for (int i = 0; i < n.size(); i++) {
0591: dispatch(n.getGeneric(i));
0592: }
0593: }
0594:
0595: /**
0596: * Set flags in this node.
0597: *
0598: * @param n The node
0599: */
0600: public void visitExpressionStatement(GNode n) {
0601: for (int i = 0; i < n.size(); i++) {
0602: dispatch(n.getGeneric(i));
0603: }
0604: }
0605:
0606: /**
0607: * Set flags in this node.
0608: *
0609: * @param n The node
0610: */
0611: public void visitAssertStatement(GNode n) {
0612: for (int i = 0; i < n.size(); i++) {
0613: dispatch(n.getGeneric(i));
0614: }
0615: }
0616:
0617: /**
0618: * Set flags in this node.
0619: *
0620: * @param n The node
0621: */
0622: public void visitBasicForControl(GNode n) {
0623: for (int i = 0; i < n.size(); i++) {
0624: dispatch(n.getGeneric(i));
0625: }
0626: }
0627:
0628: /**
0629: * Set flags in this node.
0630: *
0631: * @param n The node
0632: */
0633: public void visitCatchClause(GNode n) {
0634: for (int i = 0; i < n.size(); i++) {
0635: dispatch(n.getGeneric(i));
0636: }
0637: }
0638:
0639: /**
0640: * Set flags in this node.
0641: *
0642: * @param n The node
0643: */
0644: public void visitCaseClause(GNode n) {
0645: for (int i = 0; i < n.size(); i++) {
0646: dispatch(n.getGeneric(i));
0647: }
0648: }
0649:
0650: /**
0651: * Set flags in this node.
0652: *
0653: * @param n The node
0654: */
0655: public void visitDefaultClause(GNode n) {
0656: for (int i = 0; i < n.size(); i++) {
0657: dispatch(n.getGeneric(i));
0658: }
0659: }
0660:
0661: /**
0662: * Set flags in this node.
0663: *
0664: * @param n The node
0665: */
0666: public void visitExpressionList(GNode n) {
0667: for (int i = 0; i < n.size(); i++) {
0668: dispatch(n.getGeneric(i));
0669: }
0670: }
0671:
0672: /**
0673: * Set flags in this node.
0674: *
0675: * @param n The node
0676: */
0677: public void visitConditionalExpression(GNode n) {
0678: for (int i = 0; i < n.size(); i++) {
0679: dispatch(n.getGeneric(i));
0680: }
0681: }
0682:
0683: /**
0684: * Set flags in this node.
0685: *
0686: * @param n The node
0687: */
0688: public void visitLogicalOrExpression(GNode n) {
0689: for (int i = 0; i < n.size(); i++) {
0690: dispatch(n.getGeneric(i));
0691: }
0692: }
0693:
0694: /**
0695: * Set flags in this node.
0696: *
0697: * @param n The node
0698: */
0699: public void visitLogicalAndExpression(GNode n) {
0700: for (int i = 0; i < n.size(); i++) {
0701: dispatch(n.getGeneric(i));
0702: }
0703: }
0704:
0705: /**
0706: * Set flags in this node.
0707: *
0708: * @param n The node
0709: */
0710: public void visitBitwiseOrExpression(GNode n) {
0711: for (int i = 0; i < n.size(); i++) {
0712: dispatch(n.getGeneric(i));
0713: }
0714: }
0715:
0716: /**
0717: * Set flags in this node.
0718: *
0719: * @param n The node
0720: */
0721: public void visitBitwiseXorExpression(GNode n) {
0722: for (int i = 0; i < n.size(); i++) {
0723: dispatch(n.getGeneric(i));
0724: }
0725: }
0726:
0727: /**
0728: * Set flags in this node.
0729: *
0730: * @param n The node
0731: */
0732: public void visitBitwiseAndExpression(GNode n) {
0733: for (int i = 0; i < n.size(); i++) {
0734: dispatch(n.getGeneric(i));
0735: }
0736: }
0737:
0738: /**
0739: * Set flags in this node.
0740: *
0741: * @param n The node
0742: */
0743: public void visitInstanceOfExpression(GNode n) {
0744: for (int i = 0; i < n.size(); i++) {
0745: dispatch(n.getGeneric(i));
0746: }
0747: }
0748:
0749: /**
0750: * Set flags in this node.
0751: *
0752: * @param n The node
0753: */
0754: public void visitBitwiseNegationExpression(GNode n) {
0755: for (int i = 0; i < n.size(); i++) {
0756: dispatch(n.getGeneric(i));
0757: }
0758: }
0759:
0760: /**
0761: * Set flags in this node.
0762: *
0763: * @param n The node
0764: */
0765: public void visitLogicalNegationExpression(GNode n) {
0766: for (int i = 0; i < n.size(); i++) {
0767: dispatch(n.getGeneric(i));
0768: }
0769: }
0770:
0771: /**
0772: * Set flags in this node.
0773: *
0774: * @param n The node
0775: */
0776: public void visitBasicCastExpression(GNode n) {
0777: for (int i = 0; i < n.size(); i++) {
0778: dispatch(n.getGeneric(i));
0779: }
0780: }
0781:
0782: /**
0783: * Set flags in this node.
0784: *
0785: * @param n The node
0786: */
0787: public void visitCastExpression(GNode n) {
0788: for (int i = 0; i < n.size(); i++) {
0789: dispatch(n.getGeneric(i));
0790: }
0791: }
0792:
0793: /**
0794: * Set flags in this node.
0795: *
0796: * @param n The node
0797: */
0798: public void visitSuperExpression(GNode n) {
0799: for (int i = 0; i < n.size(); i++) {
0800: dispatch(n.getGeneric(i));
0801: }
0802: }
0803:
0804: /**
0805: * Set flags in this node.
0806: *
0807: * @param n The node
0808: */
0809: public void visitSubscriptExpression(GNode n) {
0810: for (int i = 0; i < n.size(); i++) {
0811: dispatch(n.getGeneric(i));
0812: }
0813: }
0814:
0815: /**
0816: * Set flags in this node.
0817: *
0818: * @param n The node
0819: */
0820: public void visitNewClassExpression(GNode n) {
0821: for (int i = 0; i < n.size(); i++) {
0822: dispatch(n.getGeneric(i));
0823: }
0824: }
0825:
0826: /**
0827: * Set flags in this node.
0828: *
0829: * @param n The node
0830: */
0831: public void visitClassLiteralExpression(GNode n) {
0832: for (int i = 0; i < n.size(); i++) {
0833: dispatch(n.getGeneric(i));
0834: }
0835: }
0836:
0837: /**
0838: * Set flags in this node.
0839: *
0840: * @param n The node
0841: */
0842: public void visitThisExpression(GNode n) {
0843: for (int i = 0; i < n.size(); i++) {
0844: dispatch(n.getGeneric(i));
0845: }
0846: }
0847:
0848: /**
0849: * Set flags in this node.
0850: *
0851: * @param n The node
0852: */
0853: public void visitNewArrayExpression(GNode n) {
0854: for (int i = 0; i < n.size(); i++) {
0855: dispatch(n.getGeneric(i));
0856: }
0857: }
0858:
0859: /**
0860: * Set flags in this node.
0861: *
0862: * @param n The node
0863: */
0864: public void visitConcreteDimensions(GNode n) {
0865: for (int i = 0; i < n.size(); i++) {
0866: dispatch(n.getGeneric(i));
0867: }
0868: }
0869:
0870: /**
0871: * Set flags in this node.
0872: *
0873: * @param n The node
0874: */
0875: public void visitArrayInitializer(GNode n) {
0876: for (int i = 0; i < n.size(); i++) {
0877: dispatch(n.getGeneric(i));
0878: }
0879: }
0880:
0881: /**
0882: * Set flags in this node.
0883: *
0884: * @param n The node
0885: */
0886: public void visitArguments(GNode n) {
0887: for (int i = 0; i < n.size(); i++) {
0888: dispatch(n.getGeneric(i));
0889: }
0890: }
0891:
0892: /**
0893: * Set flags in this node.
0894: *
0895: * @param n The node
0896: */
0897: public void visitFormalParameters(GNode n) {
0898: for (int i = 0; i < n.size(); i++) {
0899: dispatch(n.getGeneric(i));
0900: }
0901: }
0902:
0903: /**
0904: * Set flags in this node.
0905: *
0906: * @param n The node
0907: */
0908: public void visitDeclarators(GNode n) {
0909: for (int i = 0; i < n.size(); i++) {
0910: dispatch(n.getGeneric(i));
0911: }
0912: }
0913:
0914: /**
0915: * Set flags in this node.
0916: *
0917: * @param n The node
0918: */
0919: public void visitAnnotations(GNode n) {
0920: for (int i = 0; i < n.size(); i++) {
0921: dispatch(n.getGeneric(i));
0922: }
0923: }
0924:
0925: /**
0926: * Set flags in this node.
0927: *
0928: * @param n The node
0929: */
0930: public void visitAnnotation(GNode n) {
0931: for (int i = 0; i < n.size(); i++) {
0932: dispatch(n.getGeneric(i));
0933: }
0934: }
0935:
0936: /**
0937: * Set flags in this node.
0938: *
0939: * @param n The node
0940: */
0941: public void visitElementValuePairs(GNode n) {
0942: for (int i = 0; i < n.size(); i++) {
0943: dispatch(n.getGeneric(i));
0944: }
0945: }
0946:
0947: /**
0948: * Set flags in this node.
0949: *
0950: * @param n The node
0951: */
0952: public void visitDefaultValue(GNode n) {
0953: for (int i = 0; i < n.size(); i++) {
0954: dispatch(n.getGeneric(i));
0955: }
0956: }
0957:
0958: /**
0959: * Set flags in this node.
0960: *
0961: * @param n The node
0962: */
0963: public void visitEnumConstants(GNode n) {
0964: for (int i = 0; i < n.size(); i++) {
0965: dispatch(n.getGeneric(i));
0966: }
0967: }
0968:
0969: /**
0970: * Set flags in this node.
0971: *
0972: * @param n The node
0973: */
0974: public void visitEnumMembers(GNode n) {
0975: for (int i = 0; i < n.size(); i++) {
0976: dispatch(n.getGeneric(i));
0977: }
0978: }
0979:
0980: /**
0981: * Set flags in this node.
0982: *
0983: * @param n The node
0984: */
0985: public void visitTypeParameters(GNode n) {
0986: for (int i = 0; i < n.size(); i++) {
0987: dispatch(n.getGeneric(i));
0988: }
0989: }
0990:
0991: /**
0992: * Set flags in this node.
0993: *
0994: * @param n The node
0995: */
0996: public void visitBound(GNode n) {
0997: for (int i = 0; i < n.size(); i++) {
0998: dispatch(n.getGeneric(i));
0999: }
1000: }
1001:
1002: /**
1003: * Set flags in this node.
1004: *
1005: * @param n The node
1006: */
1007: public void visitTypeArguments(GNode n) {
1008: for (int i = 0; i < n.size(); i++) {
1009: dispatch(n.getGeneric(i));
1010: }
1011: }
1012:
1013: /**
1014: * Set flags in this node.
1015: *
1016: * @param n The node
1017: */
1018: public void visitWildcard(GNode n) {
1019: for (int i = 0; i < n.size(); i++) {
1020: dispatch(n.getGeneric(i));
1021: }
1022: }
1023:
1024: /**
1025: * Set flags in this node.
1026: *
1027: * @param n The node
1028: */
1029: public void visitInstantiatedType(GNode n) {
1030: for (int i = 0; i < n.size(); i++) {
1031: dispatch(n.getGeneric(i));
1032: }
1033: }
1034:
1035: /**
1036: * Set flags in the other nodes.
1037: *
1038: * @param n The node
1039: */
1040: public void visit(GNode n) {
1041: // do nothing
1042: }
1043:
1044: }
|