0001: /*
0002: * GrammarAnalyzer.java
0003: *
0004: * THIS FILE HAS BEEN GENERATED AUTOMATICALLY. DO NOT EDIT!
0005: *
0006: * This work is free software; you can redistribute it and/or modify
0007: * it under the terms of the GNU General Public License as published
0008: * by the Free Software Foundation; either version 2 of the License,
0009: * or (at your option) any later version.
0010: *
0011: * This work is distributed in the hope that it will be useful, but
0012: * WITHOUT ANY WARRANTY; without even the implied warranty of
0013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0014: * General Public License for more details.
0015: *
0016: * You should have received a copy of the GNU General Public License
0017: * along with this program; if not, write to the Free Software
0018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
0019: * USA
0020: *
0021: * As a special exception, the copyright holders of this library give
0022: * you permission to link this library with independent modules to
0023: * produce an executable, regardless of the license terms of these
0024: * independent modules, and to copy and distribute the resulting
0025: * executable under terms of your choice, provided that you also meet,
0026: * for each linked independent module, the terms and conditions of the
0027: * license of that module. An independent module is a module which is
0028: * not derived from or based on this library. If you modify this
0029: * library, you may extend this exception to your version of the
0030: * library, but you are not obligated to do so. If you do not wish to
0031: * do so, delete this exception statement from your version.
0032: *
0033: * Copyright (c) 2003 Per Cederberg. All rights reserved.
0034: */
0035:
0036: package net.percederberg.grammatica;
0037:
0038: import net.percederberg.grammatica.parser.Analyzer;
0039: import net.percederberg.grammatica.parser.Node;
0040: import net.percederberg.grammatica.parser.ParseException;
0041: import net.percederberg.grammatica.parser.Production;
0042: import net.percederberg.grammatica.parser.Token;
0043:
0044: /**
0045: * A class providing callback methods for the parser.
0046: *
0047: * @author Per Cederberg, <per at percederberg dot net>
0048: * @version 1.2
0049: */
0050: abstract class GrammarAnalyzer extends Analyzer {
0051:
0052: /**
0053: * Called when entering a parse tree node.
0054: *
0055: * @param node the node being entered
0056: *
0057: * @throws ParseException if the node analysis discovered errors
0058: */
0059: protected void enter(Node node) throws ParseException {
0060: switch (node.getId()) {
0061: case GrammarConstants.HEADER:
0062: enterHeader((Token) node);
0063: break;
0064: case GrammarConstants.TOKENS:
0065: enterTokens((Token) node);
0066: break;
0067: case GrammarConstants.PRODUCTIONS:
0068: enterProductions((Token) node);
0069: break;
0070: case GrammarConstants.IGNORE:
0071: enterIgnore((Token) node);
0072: break;
0073: case GrammarConstants.ERROR:
0074: enterError((Token) node);
0075: break;
0076: case GrammarConstants.UNTERMINATED_DIRECTIVE:
0077: enterUnterminatedDirective((Token) node);
0078: break;
0079: case GrammarConstants.EQUALS:
0080: enterEquals((Token) node);
0081: break;
0082: case GrammarConstants.LEFT_PAREN:
0083: enterLeftParen((Token) node);
0084: break;
0085: case GrammarConstants.RIGHT_PAREN:
0086: enterRightParen((Token) node);
0087: break;
0088: case GrammarConstants.LEFT_BRACE:
0089: enterLeftBrace((Token) node);
0090: break;
0091: case GrammarConstants.RIGHT_BRACE:
0092: enterRightBrace((Token) node);
0093: break;
0094: case GrammarConstants.LEFT_BRACKET:
0095: enterLeftBracket((Token) node);
0096: break;
0097: case GrammarConstants.RIGHT_BRACKET:
0098: enterRightBracket((Token) node);
0099: break;
0100: case GrammarConstants.QUESTION_MARK:
0101: enterQuestionMark((Token) node);
0102: break;
0103: case GrammarConstants.PLUS_SIGN:
0104: enterPlusSign((Token) node);
0105: break;
0106: case GrammarConstants.ASTERISK:
0107: enterAsterisk((Token) node);
0108: break;
0109: case GrammarConstants.VERTICAL_BAR:
0110: enterVerticalBar((Token) node);
0111: break;
0112: case GrammarConstants.SEMICOLON:
0113: enterSemicolon((Token) node);
0114: break;
0115: case GrammarConstants.IDENTIFIER:
0116: enterIdentifier((Token) node);
0117: break;
0118: case GrammarConstants.QUOTED_STRING:
0119: enterQuotedString((Token) node);
0120: break;
0121: case GrammarConstants.REGEXP:
0122: enterRegexp((Token) node);
0123: break;
0124: case GrammarConstants.GRAMMAR:
0125: enterGrammar((Production) node);
0126: break;
0127: case GrammarConstants.HEADER_PART:
0128: enterHeaderPart((Production) node);
0129: break;
0130: case GrammarConstants.HEADER_DECLARATION:
0131: enterHeaderDeclaration((Production) node);
0132: break;
0133: case GrammarConstants.TOKEN_PART:
0134: enterTokenPart((Production) node);
0135: break;
0136: case GrammarConstants.TOKEN_DECLARATION:
0137: enterTokenDeclaration((Production) node);
0138: break;
0139: case GrammarConstants.TOKEN_VALUE:
0140: enterTokenValue((Production) node);
0141: break;
0142: case GrammarConstants.TOKEN_HANDLING:
0143: enterTokenHandling((Production) node);
0144: break;
0145: case GrammarConstants.PRODUCTION_PART:
0146: enterProductionPart((Production) node);
0147: break;
0148: case GrammarConstants.PRODUCTION_DECLARATION:
0149: enterProductionDeclaration((Production) node);
0150: break;
0151: case GrammarConstants.PRODUCTION:
0152: enterProduction((Production) node);
0153: break;
0154: case GrammarConstants.PRODUCTION_ATOM:
0155: enterProductionAtom((Production) node);
0156: break;
0157: }
0158: }
0159:
0160: /**
0161: * Called when exiting a parse tree node.
0162: *
0163: * @param node the node being exited
0164: *
0165: * @return the node to add to the parse tree, or
0166: * null if no parse tree should be created
0167: *
0168: * @throws ParseException if the node analysis discovered errors
0169: */
0170: protected Node exit(Node node) throws ParseException {
0171: switch (node.getId()) {
0172: case GrammarConstants.HEADER:
0173: return exitHeader((Token) node);
0174: case GrammarConstants.TOKENS:
0175: return exitTokens((Token) node);
0176: case GrammarConstants.PRODUCTIONS:
0177: return exitProductions((Token) node);
0178: case GrammarConstants.IGNORE:
0179: return exitIgnore((Token) node);
0180: case GrammarConstants.ERROR:
0181: return exitError((Token) node);
0182: case GrammarConstants.UNTERMINATED_DIRECTIVE:
0183: return exitUnterminatedDirective((Token) node);
0184: case GrammarConstants.EQUALS:
0185: return exitEquals((Token) node);
0186: case GrammarConstants.LEFT_PAREN:
0187: return exitLeftParen((Token) node);
0188: case GrammarConstants.RIGHT_PAREN:
0189: return exitRightParen((Token) node);
0190: case GrammarConstants.LEFT_BRACE:
0191: return exitLeftBrace((Token) node);
0192: case GrammarConstants.RIGHT_BRACE:
0193: return exitRightBrace((Token) node);
0194: case GrammarConstants.LEFT_BRACKET:
0195: return exitLeftBracket((Token) node);
0196: case GrammarConstants.RIGHT_BRACKET:
0197: return exitRightBracket((Token) node);
0198: case GrammarConstants.QUESTION_MARK:
0199: return exitQuestionMark((Token) node);
0200: case GrammarConstants.PLUS_SIGN:
0201: return exitPlusSign((Token) node);
0202: case GrammarConstants.ASTERISK:
0203: return exitAsterisk((Token) node);
0204: case GrammarConstants.VERTICAL_BAR:
0205: return exitVerticalBar((Token) node);
0206: case GrammarConstants.SEMICOLON:
0207: return exitSemicolon((Token) node);
0208: case GrammarConstants.IDENTIFIER:
0209: return exitIdentifier((Token) node);
0210: case GrammarConstants.QUOTED_STRING:
0211: return exitQuotedString((Token) node);
0212: case GrammarConstants.REGEXP:
0213: return exitRegexp((Token) node);
0214: case GrammarConstants.GRAMMAR:
0215: return exitGrammar((Production) node);
0216: case GrammarConstants.HEADER_PART:
0217: return exitHeaderPart((Production) node);
0218: case GrammarConstants.HEADER_DECLARATION:
0219: return exitHeaderDeclaration((Production) node);
0220: case GrammarConstants.TOKEN_PART:
0221: return exitTokenPart((Production) node);
0222: case GrammarConstants.TOKEN_DECLARATION:
0223: return exitTokenDeclaration((Production) node);
0224: case GrammarConstants.TOKEN_VALUE:
0225: return exitTokenValue((Production) node);
0226: case GrammarConstants.TOKEN_HANDLING:
0227: return exitTokenHandling((Production) node);
0228: case GrammarConstants.PRODUCTION_PART:
0229: return exitProductionPart((Production) node);
0230: case GrammarConstants.PRODUCTION_DECLARATION:
0231: return exitProductionDeclaration((Production) node);
0232: case GrammarConstants.PRODUCTION:
0233: return exitProduction((Production) node);
0234: case GrammarConstants.PRODUCTION_ATOM:
0235: return exitProductionAtom((Production) node);
0236: }
0237: return node;
0238: }
0239:
0240: /**
0241: * Called when adding a child to a parse tree node.
0242: *
0243: * @param node the parent node
0244: * @param child the child node, or null
0245: *
0246: * @throws ParseException if the node analysis discovered errors
0247: */
0248: protected void child(Production node, Node child)
0249: throws ParseException {
0250:
0251: switch (node.getId()) {
0252: case GrammarConstants.GRAMMAR:
0253: childGrammar(node, child);
0254: break;
0255: case GrammarConstants.HEADER_PART:
0256: childHeaderPart(node, child);
0257: break;
0258: case GrammarConstants.HEADER_DECLARATION:
0259: childHeaderDeclaration(node, child);
0260: break;
0261: case GrammarConstants.TOKEN_PART:
0262: childTokenPart(node, child);
0263: break;
0264: case GrammarConstants.TOKEN_DECLARATION:
0265: childTokenDeclaration(node, child);
0266: break;
0267: case GrammarConstants.TOKEN_VALUE:
0268: childTokenValue(node, child);
0269: break;
0270: case GrammarConstants.TOKEN_HANDLING:
0271: childTokenHandling(node, child);
0272: break;
0273: case GrammarConstants.PRODUCTION_PART:
0274: childProductionPart(node, child);
0275: break;
0276: case GrammarConstants.PRODUCTION_DECLARATION:
0277: childProductionDeclaration(node, child);
0278: break;
0279: case GrammarConstants.PRODUCTION:
0280: childProduction(node, child);
0281: break;
0282: case GrammarConstants.PRODUCTION_ATOM:
0283: childProductionAtom(node, child);
0284: break;
0285: }
0286: }
0287:
0288: /**
0289: * Called when entering a parse tree node.
0290: *
0291: * @param node the node being entered
0292: *
0293: * @throws ParseException if the node analysis discovered errors
0294: */
0295: protected void enterHeader(Token node) throws ParseException {
0296: }
0297:
0298: /**
0299: * Called when exiting a parse tree node.
0300: *
0301: * @param node the node being exited
0302: *
0303: * @return the node to add to the parse tree, or
0304: * null if no parse tree should be created
0305: *
0306: * @throws ParseException if the node analysis discovered errors
0307: */
0308: protected Node exitHeader(Token node) throws ParseException {
0309: return node;
0310: }
0311:
0312: /**
0313: * Called when entering a parse tree node.
0314: *
0315: * @param node the node being entered
0316: *
0317: * @throws ParseException if the node analysis discovered errors
0318: */
0319: protected void enterTokens(Token node) throws ParseException {
0320: }
0321:
0322: /**
0323: * Called when exiting a parse tree node.
0324: *
0325: * @param node the node being exited
0326: *
0327: * @return the node to add to the parse tree, or
0328: * null if no parse tree should be created
0329: *
0330: * @throws ParseException if the node analysis discovered errors
0331: */
0332: protected Node exitTokens(Token node) throws ParseException {
0333: return node;
0334: }
0335:
0336: /**
0337: * Called when entering a parse tree node.
0338: *
0339: * @param node the node being entered
0340: *
0341: * @throws ParseException if the node analysis discovered errors
0342: */
0343: protected void enterProductions(Token node) throws ParseException {
0344: }
0345:
0346: /**
0347: * Called when exiting a parse tree node.
0348: *
0349: * @param node the node being exited
0350: *
0351: * @return the node to add to the parse tree, or
0352: * null if no parse tree should be created
0353: *
0354: * @throws ParseException if the node analysis discovered errors
0355: */
0356: protected Node exitProductions(Token node) throws ParseException {
0357: return node;
0358: }
0359:
0360: /**
0361: * Called when entering a parse tree node.
0362: *
0363: * @param node the node being entered
0364: *
0365: * @throws ParseException if the node analysis discovered errors
0366: */
0367: protected void enterIgnore(Token node) throws ParseException {
0368: }
0369:
0370: /**
0371: * Called when exiting a parse tree node.
0372: *
0373: * @param node the node being exited
0374: *
0375: * @return the node to add to the parse tree, or
0376: * null if no parse tree should be created
0377: *
0378: * @throws ParseException if the node analysis discovered errors
0379: */
0380: protected Node exitIgnore(Token node) throws ParseException {
0381: return node;
0382: }
0383:
0384: /**
0385: * Called when entering a parse tree node.
0386: *
0387: * @param node the node being entered
0388: *
0389: * @throws ParseException if the node analysis discovered errors
0390: */
0391: protected void enterError(Token node) throws ParseException {
0392: }
0393:
0394: /**
0395: * Called when exiting a parse tree node.
0396: *
0397: * @param node the node being exited
0398: *
0399: * @return the node to add to the parse tree, or
0400: * null if no parse tree should be created
0401: *
0402: * @throws ParseException if the node analysis discovered errors
0403: */
0404: protected Node exitError(Token node) throws ParseException {
0405: return node;
0406: }
0407:
0408: /**
0409: * Called when entering a parse tree node.
0410: *
0411: * @param node the node being entered
0412: *
0413: * @throws ParseException if the node analysis discovered errors
0414: */
0415: protected void enterUnterminatedDirective(Token node)
0416: throws ParseException {
0417: }
0418:
0419: /**
0420: * Called when exiting a parse tree node.
0421: *
0422: * @param node the node being exited
0423: *
0424: * @return the node to add to the parse tree, or
0425: * null if no parse tree should be created
0426: *
0427: * @throws ParseException if the node analysis discovered errors
0428: */
0429: protected Node exitUnterminatedDirective(Token node)
0430: throws ParseException {
0431:
0432: return node;
0433: }
0434:
0435: /**
0436: * Called when entering a parse tree node.
0437: *
0438: * @param node the node being entered
0439: *
0440: * @throws ParseException if the node analysis discovered errors
0441: */
0442: protected void enterEquals(Token node) throws ParseException {
0443: }
0444:
0445: /**
0446: * Called when exiting a parse tree node.
0447: *
0448: * @param node the node being exited
0449: *
0450: * @return the node to add to the parse tree, or
0451: * null if no parse tree should be created
0452: *
0453: * @throws ParseException if the node analysis discovered errors
0454: */
0455: protected Node exitEquals(Token node) throws ParseException {
0456: return node;
0457: }
0458:
0459: /**
0460: * Called when entering a parse tree node.
0461: *
0462: * @param node the node being entered
0463: *
0464: * @throws ParseException if the node analysis discovered errors
0465: */
0466: protected void enterLeftParen(Token node) throws ParseException {
0467: }
0468:
0469: /**
0470: * Called when exiting a parse tree node.
0471: *
0472: * @param node the node being exited
0473: *
0474: * @return the node to add to the parse tree, or
0475: * null if no parse tree should be created
0476: *
0477: * @throws ParseException if the node analysis discovered errors
0478: */
0479: protected Node exitLeftParen(Token node) throws ParseException {
0480: return node;
0481: }
0482:
0483: /**
0484: * Called when entering a parse tree node.
0485: *
0486: * @param node the node being entered
0487: *
0488: * @throws ParseException if the node analysis discovered errors
0489: */
0490: protected void enterRightParen(Token node) throws ParseException {
0491: }
0492:
0493: /**
0494: * Called when exiting a parse tree node.
0495: *
0496: * @param node the node being exited
0497: *
0498: * @return the node to add to the parse tree, or
0499: * null if no parse tree should be created
0500: *
0501: * @throws ParseException if the node analysis discovered errors
0502: */
0503: protected Node exitRightParen(Token node) throws ParseException {
0504: return node;
0505: }
0506:
0507: /**
0508: * Called when entering a parse tree node.
0509: *
0510: * @param node the node being entered
0511: *
0512: * @throws ParseException if the node analysis discovered errors
0513: */
0514: protected void enterLeftBrace(Token node) throws ParseException {
0515: }
0516:
0517: /**
0518: * Called when exiting a parse tree node.
0519: *
0520: * @param node the node being exited
0521: *
0522: * @return the node to add to the parse tree, or
0523: * null if no parse tree should be created
0524: *
0525: * @throws ParseException if the node analysis discovered errors
0526: */
0527: protected Node exitLeftBrace(Token node) throws ParseException {
0528: return node;
0529: }
0530:
0531: /**
0532: * Called when entering a parse tree node.
0533: *
0534: * @param node the node being entered
0535: *
0536: * @throws ParseException if the node analysis discovered errors
0537: */
0538: protected void enterRightBrace(Token node) throws ParseException {
0539: }
0540:
0541: /**
0542: * Called when exiting a parse tree node.
0543: *
0544: * @param node the node being exited
0545: *
0546: * @return the node to add to the parse tree, or
0547: * null if no parse tree should be created
0548: *
0549: * @throws ParseException if the node analysis discovered errors
0550: */
0551: protected Node exitRightBrace(Token node) throws ParseException {
0552: return node;
0553: }
0554:
0555: /**
0556: * Called when entering a parse tree node.
0557: *
0558: * @param node the node being entered
0559: *
0560: * @throws ParseException if the node analysis discovered errors
0561: */
0562: protected void enterLeftBracket(Token node) throws ParseException {
0563: }
0564:
0565: /**
0566: * Called when exiting a parse tree node.
0567: *
0568: * @param node the node being exited
0569: *
0570: * @return the node to add to the parse tree, or
0571: * null if no parse tree should be created
0572: *
0573: * @throws ParseException if the node analysis discovered errors
0574: */
0575: protected Node exitLeftBracket(Token node) throws ParseException {
0576: return node;
0577: }
0578:
0579: /**
0580: * Called when entering a parse tree node.
0581: *
0582: * @param node the node being entered
0583: *
0584: * @throws ParseException if the node analysis discovered errors
0585: */
0586: protected void enterRightBracket(Token node) throws ParseException {
0587: }
0588:
0589: /**
0590: * Called when exiting a parse tree node.
0591: *
0592: * @param node the node being exited
0593: *
0594: * @return the node to add to the parse tree, or
0595: * null if no parse tree should be created
0596: *
0597: * @throws ParseException if the node analysis discovered errors
0598: */
0599: protected Node exitRightBracket(Token node) throws ParseException {
0600: return node;
0601: }
0602:
0603: /**
0604: * Called when entering a parse tree node.
0605: *
0606: * @param node the node being entered
0607: *
0608: * @throws ParseException if the node analysis discovered errors
0609: */
0610: protected void enterQuestionMark(Token node) throws ParseException {
0611: }
0612:
0613: /**
0614: * Called when exiting a parse tree node.
0615: *
0616: * @param node the node being exited
0617: *
0618: * @return the node to add to the parse tree, or
0619: * null if no parse tree should be created
0620: *
0621: * @throws ParseException if the node analysis discovered errors
0622: */
0623: protected Node exitQuestionMark(Token node) throws ParseException {
0624: return node;
0625: }
0626:
0627: /**
0628: * Called when entering a parse tree node.
0629: *
0630: * @param node the node being entered
0631: *
0632: * @throws ParseException if the node analysis discovered errors
0633: */
0634: protected void enterPlusSign(Token node) throws ParseException {
0635: }
0636:
0637: /**
0638: * Called when exiting a parse tree node.
0639: *
0640: * @param node the node being exited
0641: *
0642: * @return the node to add to the parse tree, or
0643: * null if no parse tree should be created
0644: *
0645: * @throws ParseException if the node analysis discovered errors
0646: */
0647: protected Node exitPlusSign(Token node) throws ParseException {
0648: return node;
0649: }
0650:
0651: /**
0652: * Called when entering a parse tree node.
0653: *
0654: * @param node the node being entered
0655: *
0656: * @throws ParseException if the node analysis discovered errors
0657: */
0658: protected void enterAsterisk(Token node) throws ParseException {
0659: }
0660:
0661: /**
0662: * Called when exiting a parse tree node.
0663: *
0664: * @param node the node being exited
0665: *
0666: * @return the node to add to the parse tree, or
0667: * null if no parse tree should be created
0668: *
0669: * @throws ParseException if the node analysis discovered errors
0670: */
0671: protected Node exitAsterisk(Token node) throws ParseException {
0672: return node;
0673: }
0674:
0675: /**
0676: * Called when entering a parse tree node.
0677: *
0678: * @param node the node being entered
0679: *
0680: * @throws ParseException if the node analysis discovered errors
0681: */
0682: protected void enterVerticalBar(Token node) throws ParseException {
0683: }
0684:
0685: /**
0686: * Called when exiting a parse tree node.
0687: *
0688: * @param node the node being exited
0689: *
0690: * @return the node to add to the parse tree, or
0691: * null if no parse tree should be created
0692: *
0693: * @throws ParseException if the node analysis discovered errors
0694: */
0695: protected Node exitVerticalBar(Token node) throws ParseException {
0696: return node;
0697: }
0698:
0699: /**
0700: * Called when entering a parse tree node.
0701: *
0702: * @param node the node being entered
0703: *
0704: * @throws ParseException if the node analysis discovered errors
0705: */
0706: protected void enterSemicolon(Token node) throws ParseException {
0707: }
0708:
0709: /**
0710: * Called when exiting a parse tree node.
0711: *
0712: * @param node the node being exited
0713: *
0714: * @return the node to add to the parse tree, or
0715: * null if no parse tree should be created
0716: *
0717: * @throws ParseException if the node analysis discovered errors
0718: */
0719: protected Node exitSemicolon(Token node) throws ParseException {
0720: return node;
0721: }
0722:
0723: /**
0724: * Called when entering a parse tree node.
0725: *
0726: * @param node the node being entered
0727: *
0728: * @throws ParseException if the node analysis discovered errors
0729: */
0730: protected void enterIdentifier(Token node) throws ParseException {
0731: }
0732:
0733: /**
0734: * Called when exiting a parse tree node.
0735: *
0736: * @param node the node being exited
0737: *
0738: * @return the node to add to the parse tree, or
0739: * null if no parse tree should be created
0740: *
0741: * @throws ParseException if the node analysis discovered errors
0742: */
0743: protected Node exitIdentifier(Token node) throws ParseException {
0744: return node;
0745: }
0746:
0747: /**
0748: * Called when entering a parse tree node.
0749: *
0750: * @param node the node being entered
0751: *
0752: * @throws ParseException if the node analysis discovered errors
0753: */
0754: protected void enterQuotedString(Token node) throws ParseException {
0755: }
0756:
0757: /**
0758: * Called when exiting a parse tree node.
0759: *
0760: * @param node the node being exited
0761: *
0762: * @return the node to add to the parse tree, or
0763: * null if no parse tree should be created
0764: *
0765: * @throws ParseException if the node analysis discovered errors
0766: */
0767: protected Node exitQuotedString(Token node) throws ParseException {
0768: return node;
0769: }
0770:
0771: /**
0772: * Called when entering a parse tree node.
0773: *
0774: * @param node the node being entered
0775: *
0776: * @throws ParseException if the node analysis discovered errors
0777: */
0778: protected void enterRegexp(Token node) throws ParseException {
0779: }
0780:
0781: /**
0782: * Called when exiting a parse tree node.
0783: *
0784: * @param node the node being exited
0785: *
0786: * @return the node to add to the parse tree, or
0787: * null if no parse tree should be created
0788: *
0789: * @throws ParseException if the node analysis discovered errors
0790: */
0791: protected Node exitRegexp(Token node) throws ParseException {
0792: return node;
0793: }
0794:
0795: /**
0796: * Called when entering a parse tree node.
0797: *
0798: * @param node the node being entered
0799: *
0800: * @throws ParseException if the node analysis discovered errors
0801: */
0802: protected void enterGrammar(Production node) throws ParseException {
0803: }
0804:
0805: /**
0806: * Called when exiting a parse tree node.
0807: *
0808: * @param node the node being exited
0809: *
0810: * @return the node to add to the parse tree, or
0811: * null if no parse tree should be created
0812: *
0813: * @throws ParseException if the node analysis discovered errors
0814: */
0815: protected Node exitGrammar(Production node) throws ParseException {
0816: return node;
0817: }
0818:
0819: /**
0820: * Called when adding a child to a parse tree node.
0821: *
0822: * @param node the parent node
0823: * @param child the child node, or null
0824: *
0825: * @throws ParseException if the node analysis discovered errors
0826: */
0827: protected void childGrammar(Production node, Node child)
0828: throws ParseException {
0829:
0830: node.addChild(child);
0831: }
0832:
0833: /**
0834: * Called when entering a parse tree node.
0835: *
0836: * @param node the node being entered
0837: *
0838: * @throws ParseException if the node analysis discovered errors
0839: */
0840: protected void enterHeaderPart(Production node)
0841: throws ParseException {
0842: }
0843:
0844: /**
0845: * Called when exiting a parse tree node.
0846: *
0847: * @param node the node being exited
0848: *
0849: * @return the node to add to the parse tree, or
0850: * null if no parse tree should be created
0851: *
0852: * @throws ParseException if the node analysis discovered errors
0853: */
0854: protected Node exitHeaderPart(Production node)
0855: throws ParseException {
0856:
0857: return node;
0858: }
0859:
0860: /**
0861: * Called when adding a child to a parse tree node.
0862: *
0863: * @param node the parent node
0864: * @param child the child node, or null
0865: *
0866: * @throws ParseException if the node analysis discovered errors
0867: */
0868: protected void childHeaderPart(Production node, Node child)
0869: throws ParseException {
0870:
0871: node.addChild(child);
0872: }
0873:
0874: /**
0875: * Called when entering a parse tree node.
0876: *
0877: * @param node the node being entered
0878: *
0879: * @throws ParseException if the node analysis discovered errors
0880: */
0881: protected void enterHeaderDeclaration(Production node)
0882: throws ParseException {
0883: }
0884:
0885: /**
0886: * Called when exiting a parse tree node.
0887: *
0888: * @param node the node being exited
0889: *
0890: * @return the node to add to the parse tree, or
0891: * null if no parse tree should be created
0892: *
0893: * @throws ParseException if the node analysis discovered errors
0894: */
0895: protected Node exitHeaderDeclaration(Production node)
0896: throws ParseException {
0897:
0898: return node;
0899: }
0900:
0901: /**
0902: * Called when adding a child to a parse tree node.
0903: *
0904: * @param node the parent node
0905: * @param child the child node, or null
0906: *
0907: * @throws ParseException if the node analysis discovered errors
0908: */
0909: protected void childHeaderDeclaration(Production node, Node child)
0910: throws ParseException {
0911:
0912: node.addChild(child);
0913: }
0914:
0915: /**
0916: * Called when entering a parse tree node.
0917: *
0918: * @param node the node being entered
0919: *
0920: * @throws ParseException if the node analysis discovered errors
0921: */
0922: protected void enterTokenPart(Production node)
0923: throws ParseException {
0924: }
0925:
0926: /**
0927: * Called when exiting a parse tree node.
0928: *
0929: * @param node the node being exited
0930: *
0931: * @return the node to add to the parse tree, or
0932: * null if no parse tree should be created
0933: *
0934: * @throws ParseException if the node analysis discovered errors
0935: */
0936: protected Node exitTokenPart(Production node) throws ParseException {
0937:
0938: return node;
0939: }
0940:
0941: /**
0942: * Called when adding a child to a parse tree node.
0943: *
0944: * @param node the parent node
0945: * @param child the child node, or null
0946: *
0947: * @throws ParseException if the node analysis discovered errors
0948: */
0949: protected void childTokenPart(Production node, Node child)
0950: throws ParseException {
0951:
0952: node.addChild(child);
0953: }
0954:
0955: /**
0956: * Called when entering a parse tree node.
0957: *
0958: * @param node the node being entered
0959: *
0960: * @throws ParseException if the node analysis discovered errors
0961: */
0962: protected void enterTokenDeclaration(Production node)
0963: throws ParseException {
0964: }
0965:
0966: /**
0967: * Called when exiting a parse tree node.
0968: *
0969: * @param node the node being exited
0970: *
0971: * @return the node to add to the parse tree, or
0972: * null if no parse tree should be created
0973: *
0974: * @throws ParseException if the node analysis discovered errors
0975: */
0976: protected Node exitTokenDeclaration(Production node)
0977: throws ParseException {
0978:
0979: return node;
0980: }
0981:
0982: /**
0983: * Called when adding a child to a parse tree node.
0984: *
0985: * @param node the parent node
0986: * @param child the child node, or null
0987: *
0988: * @throws ParseException if the node analysis discovered errors
0989: */
0990: protected void childTokenDeclaration(Production node, Node child)
0991: throws ParseException {
0992:
0993: node.addChild(child);
0994: }
0995:
0996: /**
0997: * Called when entering a parse tree node.
0998: *
0999: * @param node the node being entered
1000: *
1001: * @throws ParseException if the node analysis discovered errors
1002: */
1003: protected void enterTokenValue(Production node)
1004: throws ParseException {
1005: }
1006:
1007: /**
1008: * Called when exiting a parse tree node.
1009: *
1010: * @param node the node being exited
1011: *
1012: * @return the node to add to the parse tree, or
1013: * null if no parse tree should be created
1014: *
1015: * @throws ParseException if the node analysis discovered errors
1016: */
1017: protected Node exitTokenValue(Production node)
1018: throws ParseException {
1019:
1020: return node;
1021: }
1022:
1023: /**
1024: * Called when adding a child to a parse tree node.
1025: *
1026: * @param node the parent node
1027: * @param child the child node, or null
1028: *
1029: * @throws ParseException if the node analysis discovered errors
1030: */
1031: protected void childTokenValue(Production node, Node child)
1032: throws ParseException {
1033:
1034: node.addChild(child);
1035: }
1036:
1037: /**
1038: * Called when entering a parse tree node.
1039: *
1040: * @param node the node being entered
1041: *
1042: * @throws ParseException if the node analysis discovered errors
1043: */
1044: protected void enterTokenHandling(Production node)
1045: throws ParseException {
1046: }
1047:
1048: /**
1049: * Called when exiting a parse tree node.
1050: *
1051: * @param node the node being exited
1052: *
1053: * @return the node to add to the parse tree, or
1054: * null if no parse tree should be created
1055: *
1056: * @throws ParseException if the node analysis discovered errors
1057: */
1058: protected Node exitTokenHandling(Production node)
1059: throws ParseException {
1060:
1061: return node;
1062: }
1063:
1064: /**
1065: * Called when adding a child to a parse tree node.
1066: *
1067: * @param node the parent node
1068: * @param child the child node, or null
1069: *
1070: * @throws ParseException if the node analysis discovered errors
1071: */
1072: protected void childTokenHandling(Production node, Node child)
1073: throws ParseException {
1074:
1075: node.addChild(child);
1076: }
1077:
1078: /**
1079: * Called when entering a parse tree node.
1080: *
1081: * @param node the node being entered
1082: *
1083: * @throws ParseException if the node analysis discovered errors
1084: */
1085: protected void enterProductionPart(Production node)
1086: throws ParseException {
1087: }
1088:
1089: /**
1090: * Called when exiting a parse tree node.
1091: *
1092: * @param node the node being exited
1093: *
1094: * @return the node to add to the parse tree, or
1095: * null if no parse tree should be created
1096: *
1097: * @throws ParseException if the node analysis discovered errors
1098: */
1099: protected Node exitProductionPart(Production node)
1100: throws ParseException {
1101:
1102: return node;
1103: }
1104:
1105: /**
1106: * Called when adding a child to a parse tree node.
1107: *
1108: * @param node the parent node
1109: * @param child the child node, or null
1110: *
1111: * @throws ParseException if the node analysis discovered errors
1112: */
1113: protected void childProductionPart(Production node, Node child)
1114: throws ParseException {
1115:
1116: node.addChild(child);
1117: }
1118:
1119: /**
1120: * Called when entering a parse tree node.
1121: *
1122: * @param node the node being entered
1123: *
1124: * @throws ParseException if the node analysis discovered errors
1125: */
1126: protected void enterProductionDeclaration(Production node)
1127: throws ParseException {
1128: }
1129:
1130: /**
1131: * Called when exiting a parse tree node.
1132: *
1133: * @param node the node being exited
1134: *
1135: * @return the node to add to the parse tree, or
1136: * null if no parse tree should be created
1137: *
1138: * @throws ParseException if the node analysis discovered errors
1139: */
1140: protected Node exitProductionDeclaration(Production node)
1141: throws ParseException {
1142:
1143: return node;
1144: }
1145:
1146: /**
1147: * Called when adding a child to a parse tree node.
1148: *
1149: * @param node the parent node
1150: * @param child the child node, or null
1151: *
1152: * @throws ParseException if the node analysis discovered errors
1153: */
1154: protected void childProductionDeclaration(Production node,
1155: Node child) throws ParseException {
1156:
1157: node.addChild(child);
1158: }
1159:
1160: /**
1161: * Called when entering a parse tree node.
1162: *
1163: * @param node the node being entered
1164: *
1165: * @throws ParseException if the node analysis discovered errors
1166: */
1167: protected void enterProduction(Production node)
1168: throws ParseException {
1169: }
1170:
1171: /**
1172: * Called when exiting a parse tree node.
1173: *
1174: * @param node the node being exited
1175: *
1176: * @return the node to add to the parse tree, or
1177: * null if no parse tree should be created
1178: *
1179: * @throws ParseException if the node analysis discovered errors
1180: */
1181: protected Node exitProduction(Production node)
1182: throws ParseException {
1183:
1184: return node;
1185: }
1186:
1187: /**
1188: * Called when adding a child to a parse tree node.
1189: *
1190: * @param node the parent node
1191: * @param child the child node, or null
1192: *
1193: * @throws ParseException if the node analysis discovered errors
1194: */
1195: protected void childProduction(Production node, Node child)
1196: throws ParseException {
1197:
1198: node.addChild(child);
1199: }
1200:
1201: /**
1202: * Called when entering a parse tree node.
1203: *
1204: * @param node the node being entered
1205: *
1206: * @throws ParseException if the node analysis discovered errors
1207: */
1208: protected void enterProductionAtom(Production node)
1209: throws ParseException {
1210: }
1211:
1212: /**
1213: * Called when exiting a parse tree node.
1214: *
1215: * @param node the node being exited
1216: *
1217: * @return the node to add to the parse tree, or
1218: * null if no parse tree should be created
1219: *
1220: * @throws ParseException if the node analysis discovered errors
1221: */
1222: protected Node exitProductionAtom(Production node)
1223: throws ParseException {
1224:
1225: return node;
1226: }
1227:
1228: /**
1229: * Called when adding a child to a parse tree node.
1230: *
1231: * @param node the parent node
1232: * @param child the child node, or null
1233: *
1234: * @throws ParseException if the node analysis discovered errors
1235: */
1236: protected void childProductionAtom(Production node, Node child)
1237: throws ParseException {
1238:
1239: node.addChild(child);
1240: }
1241: }
|