KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > percederberg > grammatica > GrammarAnalyzer


1 /*
2  * GrammarAnalyzer.java
3  *
4  * THIS FILE HAS BEEN GENERATED AUTOMATICALLY. DO NOT EDIT!
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation; either version 2.1
9  * of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19  * MA 02111-1307, USA.
20  *
21  * Copyright (c) 2003-2005 Per Cederberg. All rights reserved.
22  */

23
24 package net.percederberg.grammatica;
25
26 import net.percederberg.grammatica.parser.Analyzer;
27 import net.percederberg.grammatica.parser.Node;
28 import net.percederberg.grammatica.parser.ParseException;
29 import net.percederberg.grammatica.parser.Production;
30 import net.percederberg.grammatica.parser.Token;
31
32 /**
33  * A class providing callback methods for the parser.
34  *
35  * @author Per Cederberg, <per at percederberg dot net>
36  * @version 1.5
37  */

38 abstract class GrammarAnalyzer extends Analyzer {
39
40     /**
41      * Called when entering a parse tree node.
42      *
43      * @param node the node being entered
44      *
45      * @throws ParseException if the node analysis discovered errors
46      */

47     protected void enter(Node node) throws ParseException {
48         switch (node.getId()) {
49         case GrammarConstants.HEADER:
50             enterHeader((Token) node);
51             break;
52         case GrammarConstants.TOKENS:
53             enterTokens((Token) node);
54             break;
55         case GrammarConstants.PRODUCTIONS:
56             enterProductions((Token) node);
57             break;
58         case GrammarConstants.IGNORE:
59             enterIgnore((Token) node);
60             break;
61         case GrammarConstants.ERROR:
62             enterError((Token) node);
63             break;
64         case GrammarConstants.UNTERMINATED_DIRECTIVE:
65             enterUnterminatedDirective((Token) node);
66             break;
67         case GrammarConstants.EQUALS:
68             enterEquals((Token) node);
69             break;
70         case GrammarConstants.LEFT_PAREN:
71             enterLeftParen((Token) node);
72             break;
73         case GrammarConstants.RIGHT_PAREN:
74             enterRightParen((Token) node);
75             break;
76         case GrammarConstants.LEFT_BRACE:
77             enterLeftBrace((Token) node);
78             break;
79         case GrammarConstants.RIGHT_BRACE:
80             enterRightBrace((Token) node);
81             break;
82         case GrammarConstants.LEFT_BRACKET:
83             enterLeftBracket((Token) node);
84             break;
85         case GrammarConstants.RIGHT_BRACKET:
86             enterRightBracket((Token) node);
87             break;
88         case GrammarConstants.QUESTION_MARK:
89             enterQuestionMark((Token) node);
90             break;
91         case GrammarConstants.PLUS_SIGN:
92             enterPlusSign((Token) node);
93             break;
94         case GrammarConstants.ASTERISK:
95             enterAsterisk((Token) node);
96             break;
97         case GrammarConstants.VERTICAL_BAR:
98             enterVerticalBar((Token) node);
99             break;
100         case GrammarConstants.SEMICOLON:
101             enterSemicolon((Token) node);
102             break;
103         case GrammarConstants.IDENTIFIER:
104             enterIdentifier((Token) node);
105             break;
106         case GrammarConstants.QUOTED_STRING:
107             enterQuotedString((Token) node);
108             break;
109         case GrammarConstants.REGEXP:
110             enterRegexp((Token) node);
111             break;
112         case GrammarConstants.GRAMMAR:
113             enterGrammar((Production) node);
114             break;
115         case GrammarConstants.HEADER_PART:
116             enterHeaderPart((Production) node);
117             break;
118         case GrammarConstants.HEADER_DECLARATION:
119             enterHeaderDeclaration((Production) node);
120             break;
121         case GrammarConstants.TOKEN_PART:
122             enterTokenPart((Production) node);
123             break;
124         case GrammarConstants.TOKEN_DECLARATION:
125             enterTokenDeclaration((Production) node);
126             break;
127         case GrammarConstants.TOKEN_VALUE:
128             enterTokenValue((Production) node);
129             break;
130         case GrammarConstants.TOKEN_HANDLING:
131             enterTokenHandling((Production) node);
132             break;
133         case GrammarConstants.PRODUCTION_PART:
134             enterProductionPart((Production) node);
135             break;
136         case GrammarConstants.PRODUCTION_DECLARATION:
137             enterProductionDeclaration((Production) node);
138             break;
139         case GrammarConstants.PRODUCTION:
140             enterProduction((Production) node);
141             break;
142         case GrammarConstants.PRODUCTION_ATOM:
143             enterProductionAtom((Production) node);
144             break;
145         }
146     }
147
148     /**
149      * Called when exiting a parse tree node.
150      *
151      * @param node the node being exited
152      *
153      * @return the node to add to the parse tree, or
154      * null if no parse tree should be created
155      *
156      * @throws ParseException if the node analysis discovered errors
157      */

158     protected Node exit(Node node) throws ParseException {
159         switch (node.getId()) {
160         case GrammarConstants.HEADER:
161             return exitHeader((Token) node);
162         case GrammarConstants.TOKENS:
163             return exitTokens((Token) node);
164         case GrammarConstants.PRODUCTIONS:
165             return exitProductions((Token) node);
166         case GrammarConstants.IGNORE:
167             return exitIgnore((Token) node);
168         case GrammarConstants.ERROR:
169             return exitError((Token) node);
170         case GrammarConstants.UNTERMINATED_DIRECTIVE:
171             return exitUnterminatedDirective((Token) node);
172         case GrammarConstants.EQUALS:
173             return exitEquals((Token) node);
174         case GrammarConstants.LEFT_PAREN:
175             return exitLeftParen((Token) node);
176         case GrammarConstants.RIGHT_PAREN:
177             return exitRightParen((Token) node);
178         case GrammarConstants.LEFT_BRACE:
179             return exitLeftBrace((Token) node);
180         case GrammarConstants.RIGHT_BRACE:
181             return exitRightBrace((Token) node);
182         case GrammarConstants.LEFT_BRACKET:
183             return exitLeftBracket((Token) node);
184         case GrammarConstants.RIGHT_BRACKET:
185             return exitRightBracket((Token) node);
186         case GrammarConstants.QUESTION_MARK:
187             return exitQuestionMark((Token) node);
188         case GrammarConstants.PLUS_SIGN:
189             return exitPlusSign((Token) node);
190         case GrammarConstants.ASTERISK:
191             return exitAsterisk((Token) node);
192         case GrammarConstants.VERTICAL_BAR:
193             return exitVerticalBar((Token) node);
194         case GrammarConstants.SEMICOLON:
195             return exitSemicolon((Token) node);
196         case GrammarConstants.IDENTIFIER:
197             return exitIdentifier((Token) node);
198         case GrammarConstants.QUOTED_STRING:
199             return exitQuotedString((Token) node);
200         case GrammarConstants.REGEXP:
201             return exitRegexp((Token) node);
202         case GrammarConstants.GRAMMAR:
203             return exitGrammar((Production) node);
204         case GrammarConstants.HEADER_PART:
205             return exitHeaderPart((Production) node);
206         case GrammarConstants.HEADER_DECLARATION:
207             return exitHeaderDeclaration((Production) node);
208         case GrammarConstants.TOKEN_PART:
209             return exitTokenPart((Production) node);
210         case GrammarConstants.TOKEN_DECLARATION:
211             return exitTokenDeclaration((Production) node);
212         case GrammarConstants.TOKEN_VALUE:
213             return exitTokenValue((Production) node);
214         case GrammarConstants.TOKEN_HANDLING:
215             return exitTokenHandling((Production) node);
216         case GrammarConstants.PRODUCTION_PART:
217             return exitProductionPart((Production) node);
218         case GrammarConstants.PRODUCTION_DECLARATION:
219             return exitProductionDeclaration((Production) node);
220         case GrammarConstants.PRODUCTION:
221             return exitProduction((Production) node);
222         case GrammarConstants.PRODUCTION_ATOM:
223             return exitProductionAtom((Production) node);
224         }
225         return node;
226     }
227
228     /**
229      * Called when adding a child to a parse tree node.
230      *
231      * @param node the parent node
232      * @param child the child node, or null
233      *
234      * @throws ParseException if the node analysis discovered errors
235      */

236     protected void child(Production node, Node child)
237         throws ParseException {
238
239         switch (node.getId()) {
240         case GrammarConstants.GRAMMAR:
241             childGrammar(node, child);
242             break;
243         case GrammarConstants.HEADER_PART:
244             childHeaderPart(node, child);
245             break;
246         case GrammarConstants.HEADER_DECLARATION:
247             childHeaderDeclaration(node, child);
248             break;
249         case GrammarConstants.TOKEN_PART:
250             childTokenPart(node, child);
251             break;
252         case GrammarConstants.TOKEN_DECLARATION:
253             childTokenDeclaration(node, child);
254             break;
255         case GrammarConstants.TOKEN_VALUE:
256             childTokenValue(node, child);
257             break;
258         case GrammarConstants.TOKEN_HANDLING:
259             childTokenHandling(node, child);
260             break;
261         case GrammarConstants.PRODUCTION_PART:
262             childProductionPart(node, child);
263             break;
264         case GrammarConstants.PRODUCTION_DECLARATION:
265             childProductionDeclaration(node, child);
266             break;
267         case GrammarConstants.PRODUCTION:
268             childProduction(node, child);
269             break;
270         case GrammarConstants.PRODUCTION_ATOM:
271             childProductionAtom(node, child);
272             break;
273         }
274     }
275
276     /**
277      * Called when entering a parse tree node.
278      *
279      * @param node the node being entered
280      *
281      * @throws ParseException if the node analysis discovered errors
282      */

283     protected void enterHeader(Token node) throws ParseException {
284     }
285
286     /**
287      * Called when exiting a parse tree node.
288      *
289      * @param node the node being exited
290      *
291      * @return the node to add to the parse tree, or
292      * null if no parse tree should be created
293      *
294      * @throws ParseException if the node analysis discovered errors
295      */

296     protected Node exitHeader(Token node) throws ParseException {
297         return node;
298     }
299
300     /**
301      * Called when entering a parse tree node.
302      *
303      * @param node the node being entered
304      *
305      * @throws ParseException if the node analysis discovered errors
306      */

307     protected void enterTokens(Token node) throws ParseException {
308     }
309
310     /**
311      * Called when exiting a parse tree node.
312      *
313      * @param node the node being exited
314      *
315      * @return the node to add to the parse tree, or
316      * null if no parse tree should be created
317      *
318      * @throws ParseException if the node analysis discovered errors
319      */

320     protected Node exitTokens(Token node) throws ParseException {
321         return node;
322     }
323
324     /**
325      * Called when entering a parse tree node.
326      *
327      * @param node the node being entered
328      *
329      * @throws ParseException if the node analysis discovered errors
330      */

331     protected void enterProductions(Token node) throws ParseException {
332     }
333
334     /**
335      * Called when exiting a parse tree node.
336      *
337      * @param node the node being exited
338      *
339      * @return the node to add to the parse tree, or
340      * null if no parse tree should be created
341      *
342      * @throws ParseException if the node analysis discovered errors
343      */

344     protected Node exitProductions(Token node) throws ParseException {
345         return node;
346     }
347
348     /**
349      * Called when entering a parse tree node.
350      *
351      * @param node the node being entered
352      *
353      * @throws ParseException if the node analysis discovered errors
354      */

355     protected void enterIgnore(Token node) throws ParseException {
356     }
357
358     /**
359      * Called when exiting a parse tree node.
360      *
361      * @param node the node being exited
362      *
363      * @return the node to add to the parse tree, or
364      * null if no parse tree should be created
365      *
366      * @throws ParseException if the node analysis discovered errors
367      */

368     protected Node exitIgnore(Token node) throws ParseException {
369         return node;
370     }
371
372     /**
373      * Called when entering a parse tree node.
374      *
375      * @param node the node being entered
376      *
377      * @throws ParseException if the node analysis discovered errors
378      */

379     protected void enterError(Token node) throws ParseException {
380     }
381
382     /**
383      * Called when exiting a parse tree node.
384      *
385      * @param node the node being exited
386      *
387      * @return the node to add to the parse tree, or
388      * null if no parse tree should be created
389      *
390      * @throws ParseException if the node analysis discovered errors
391      */

392     protected Node exitError(Token node) throws ParseException {
393         return node;
394     }
395
396     /**
397      * Called when entering a parse tree node.
398      *
399      * @param node the node being entered
400      *
401      * @throws ParseException if the node analysis discovered errors
402      */

403     protected void enterUnterminatedDirective(Token node)
404         throws ParseException {
405     }
406
407     /**
408      * Called when exiting a parse tree node.
409      *
410      * @param node the node being exited
411      *
412      * @return the node to add to the parse tree, or
413      * null if no parse tree should be created
414      *
415      * @throws ParseException if the node analysis discovered errors
416      */

417     protected Node exitUnterminatedDirective(Token node)
418         throws ParseException {
419
420         return node;
421     }
422
423     /**
424      * Called when entering a parse tree node.
425      *
426      * @param node the node being entered
427      *
428      * @throws ParseException if the node analysis discovered errors
429      */

430     protected void enterEquals(Token node) throws ParseException {
431     }
432
433     /**
434      * Called when exiting a parse tree node.
435      *
436      * @param node the node being exited
437      *
438      * @return the node to add to the parse tree, or
439      * null if no parse tree should be created
440      *
441      * @throws ParseException if the node analysis discovered errors
442      */

443     protected Node exitEquals(Token node) throws ParseException {
444         return node;
445     }
446
447     /**
448      * Called when entering a parse tree node.
449      *
450      * @param node the node being entered
451      *
452      * @throws ParseException if the node analysis discovered errors
453      */

454     protected void enterLeftParen(Token node) throws ParseException {
455     }
456
457     /**
458      * Called when exiting a parse tree node.
459      *
460      * @param node the node being exited
461      *
462      * @return the node to add to the parse tree, or
463      * null if no parse tree should be created
464      *
465      * @throws ParseException if the node analysis discovered errors
466      */

467     protected Node exitLeftParen(Token node) throws ParseException {
468         return node;
469     }
470
471     /**
472      * Called when entering a parse tree node.
473      *
474      * @param node the node being entered
475      *
476      * @throws ParseException if the node analysis discovered errors
477      */

478     protected void enterRightParen(Token node) throws ParseException {
479     }
480
481     /**
482      * Called when exiting a parse tree node.
483      *
484      * @param node the node being exited
485      *
486      * @return the node to add to the parse tree, or
487      * null if no parse tree should be created
488      *
489      * @throws ParseException if the node analysis discovered errors
490      */

491     protected Node exitRightParen(Token node) throws ParseException {
492         return node;
493     }
494
495     /**
496      * Called when entering a parse tree node.
497      *
498      * @param node the node being entered
499      *
500      * @throws ParseException if the node analysis discovered errors
501      */

502     protected void enterLeftBrace(Token node) throws ParseException {
503     }
504
505     /**
506      * Called when exiting a parse tree node.
507      *
508      * @param node the node being exited
509      *
510      * @return the node to add to the parse tree, or
511      * null if no parse tree should be created
512      *
513      * @throws ParseException if the node analysis discovered errors
514      */

515     protected Node exitLeftBrace(Token node) throws ParseException {
516         return node;
517     }
518
519     /**
520      * Called when entering a parse tree node.
521      *
522      * @param node the node being entered
523      *
524      * @throws ParseException if the node analysis discovered errors
525      */

526     protected void enterRightBrace(Token node) throws ParseException {
527     }
528
529     /**
530      * Called when exiting a parse tree node.
531      *
532      * @param node the node being exited
533      *
534      * @return the node to add to the parse tree, or
535      * null if no parse tree should be created
536      *
537      * @throws ParseException if the node analysis discovered errors
538      */

539     protected Node exitRightBrace(Token node) throws ParseException {
540         return node;
541     }
542
543     /**
544      * Called when entering a parse tree node.
545      *
546      * @param node the node being entered
547      *
548      * @throws ParseException if the node analysis discovered errors
549      */

550     protected void enterLeftBracket(Token node) throws ParseException {
551     }
552
553     /**
554      * Called when exiting a parse tree node.
555      *
556      * @param node the node being exited
557      *
558      * @return the node to add to the parse tree, or
559      * null if no parse tree should be created
560      *
561      * @throws ParseException if the node analysis discovered errors
562      */

563     protected Node exitLeftBracket(Token node) throws ParseException {
564         return node;
565     }
566
567     /**
568      * Called when entering a parse tree node.
569      *
570      * @param node the node being entered
571      *
572      * @throws ParseException if the node analysis discovered errors
573      */

574     protected void enterRightBracket(Token node) throws ParseException {
575     }
576
577     /**
578      * Called when exiting a parse tree node.
579      *
580      * @param node the node being exited
581      *
582      * @return the node to add to the parse tree, or
583      * null if no parse tree should be created
584      *
585      * @throws ParseException if the node analysis discovered errors
586      */

587     protected Node exitRightBracket(Token node) throws ParseException {
588         return node;
589     }
590
591     /**
592      * Called when entering a parse tree node.
593      *
594      * @param node the node being entered
595      *
596      * @throws ParseException if the node analysis discovered errors
597      */

598     protected void enterQuestionMark(Token node) throws ParseException {
599     }
600
601     /**
602      * Called when exiting a parse tree node.
603      *
604      * @param node the node being exited
605      *
606      * @return the node to add to the parse tree, or
607      * null if no parse tree should be created
608      *
609      * @throws ParseException if the node analysis discovered errors
610      */

611     protected Node exitQuestionMark(Token node) throws ParseException {
612         return node;
613     }
614
615     /**
616      * Called when entering a parse tree node.
617      *
618      * @param node the node being entered
619      *
620      * @throws ParseException if the node analysis discovered errors
621      */

622     protected void enterPlusSign(Token node) throws ParseException {
623     }
624
625     /**
626      * Called when exiting a parse tree node.
627      *
628      * @param node the node being exited
629      *
630      * @return the node to add to the parse tree, or
631      * null if no parse tree should be created
632      *
633      * @throws ParseException if the node analysis discovered errors
634      */

635     protected Node exitPlusSign(Token node) throws ParseException {
636         return node;
637     }
638
639     /**
640      * Called when entering a parse tree node.
641      *
642      * @param node the node being entered
643      *
644      * @throws ParseException if the node analysis discovered errors
645      */

646     protected void enterAsterisk(Token node) throws ParseException {
647     }
648
649     /**
650      * Called when exiting a parse tree node.
651      *
652      * @param node the node being exited
653      *
654      * @return the node to add to the parse tree, or
655      * null if no parse tree should be created
656      *
657      * @throws ParseException if the node analysis discovered errors
658      */

659     protected Node exitAsterisk(Token node) throws ParseException {
660         return node;
661     }
662
663     /**
664      * Called when entering a parse tree node.
665      *
666      * @param node the node being entered
667      *
668      * @throws ParseException if the node analysis discovered errors
669      */

670     protected void enterVerticalBar(Token node) throws ParseException {
671     }
672
673     /**
674      * Called when exiting a parse tree node.
675      *
676      * @param node the node being exited
677      *
678      * @return the node to add to the parse tree, or
679      * null if no parse tree should be created
680      *
681      * @throws ParseException if the node analysis discovered errors
682      */

683     protected Node exitVerticalBar(Token node) throws ParseException {
684         return node;
685     }
686
687     /**
688      * Called when entering a parse tree node.
689      *
690      * @param node the node being entered
691      *
692      * @throws ParseException if the node analysis discovered errors
693      */

694     protected void enterSemicolon(Token node) throws ParseException {
695     }
696
697     /**
698      * Called when exiting a parse tree node.
699      *
700      * @param node the node being exited
701      *
702      * @return the node to add to the parse tree, or
703      * null if no parse tree should be created
704      *
705      * @throws ParseException if the node analysis discovered errors
706      */

707     protected Node exitSemicolon(Token node) throws ParseException {
708         return node;
709     }
710
711     /**
712      * Called when entering a parse tree node.
713      *
714      * @param node the node being entered
715      *
716      * @throws ParseException if the node analysis discovered errors
717      */

718     protected void enterIdentifier(Token node) throws ParseException {
719     }
720
721     /**
722      * Called when exiting a parse tree node.
723      *
724      * @param node the node being exited
725      *
726      * @return the node to add to the parse tree, or
727      * null if no parse tree should be created
728      *
729      * @throws ParseException if the node analysis discovered errors
730      */

731     protected Node exitIdentifier(Token node) throws ParseException {
732         return node;
733     }
734
735     /**
736      * Called when entering a parse tree node.
737      *
738      * @param node the node being entered
739      *
740      * @throws ParseException if the node analysis discovered errors
741      */

742     protected void enterQuotedString(Token node) throws ParseException {
743     }
744
745     /**
746      * Called when exiting a parse tree node.
747      *
748      * @param node the node being exited
749      *
750      * @return the node to add to the parse tree, or
751      * null if no parse tree should be created
752      *
753      * @throws ParseException if the node analysis discovered errors
754      */

755     protected Node exitQuotedString(Token node) throws ParseException {
756         return node;
757     }
758
759     /**
760      * Called when entering a parse tree node.
761      *
762      * @param node the node being entered
763      *
764      * @throws ParseException if the node analysis discovered errors
765      */

766     protected void enterRegexp(Token node) throws ParseException {
767     }
768
769     /**
770      * Called when exiting a parse tree node.
771      *
772      * @param node the node being exited
773      *
774      * @return the node to add to the parse tree, or
775      * null if no parse tree should be created
776      *
777      * @throws ParseException if the node analysis discovered errors
778      */

779     protected Node exitRegexp(Token node) throws ParseException {
780         return node;
781     }
782
783     /**
784      * Called when entering a parse tree node.
785      *
786      * @param node the node being entered
787      *
788      * @throws ParseException if the node analysis discovered errors
789      */

790     protected void enterGrammar(Production node) throws ParseException {
791     }
792
793     /**
794      * Called when exiting a parse tree node.
795      *
796      * @param node the node being exited
797      *
798      * @return the node to add to the parse tree, or
799      * null if no parse tree should be created
800      *
801      * @throws ParseException if the node analysis discovered errors
802      */

803     protected Node exitGrammar(Production node) throws ParseException {
804         return node;
805     }
806
807     /**
808      * Called when adding a child to a parse tree node.
809      *
810      * @param node the parent node
811      * @param child the child node, or null
812      *
813      * @throws ParseException if the node analysis discovered errors
814      */

815     protected void childGrammar(Production node, Node child)
816         throws ParseException {
817
818         node.addChild(child);
819     }
820
821     /**
822      * Called when entering a parse tree node.
823      *
824      * @param node the node being entered
825      *
826      * @throws ParseException if the node analysis discovered errors
827      */

828     protected void enterHeaderPart(Production node)
829         throws ParseException {
830     }
831
832     /**
833      * Called when exiting a parse tree node.
834      *
835      * @param node the node being exited
836      *
837      * @return the node to add to the parse tree, or
838      * null if no parse tree should be created
839      *
840      * @throws ParseException if the node analysis discovered errors
841      */

842     protected Node exitHeaderPart(Production node)
843         throws ParseException {
844
845         return node;
846     }
847
848     /**
849      * Called when adding a child to a parse tree node.
850      *
851      * @param node the parent node
852      * @param child the child node, or null
853      *
854      * @throws ParseException if the node analysis discovered errors
855      */

856     protected void childHeaderPart(Production node, Node child)
857         throws ParseException {
858
859         node.addChild(child);
860     }
861
862     /**
863      * Called when entering a parse tree node.
864      *
865      * @param node the node being entered
866      *
867      * @throws ParseException if the node analysis discovered errors
868      */

869     protected void enterHeaderDeclaration(Production node)
870         throws ParseException {
871     }
872
873     /**
874      * Called when exiting a parse tree node.
875      *
876      * @param node the node being exited
877      *
878      * @return the node to add to the parse tree, or
879      * null if no parse tree should be created
880      *
881      * @throws ParseException if the node analysis discovered errors
882      */

883     protected Node exitHeaderDeclaration(Production node)
884         throws ParseException {
885
886         return node;
887     }
888
889     /**
890      * Called when adding a child to a parse tree node.
891      *
892      * @param node the parent node
893      * @param child the child node, or null
894      *
895      * @throws ParseException if the node analysis discovered errors
896      */

897     protected void childHeaderDeclaration(Production node, Node child)
898         throws ParseException {
899
900         node.addChild(child);
901     }
902
903     /**
904      * Called when entering a parse tree node.
905      *
906      * @param node the node being entered
907      *
908      * @throws ParseException if the node analysis discovered errors
909      */

910     protected void enterTokenPart(Production node)
911         throws ParseException {
912     }
913
914     /**
915      * Called when exiting a parse tree node.
916      *
917      * @param node the node being exited
918      *
919      * @return the node to add to the parse tree, or
920      * null if no parse tree should be created
921      *
922      * @throws ParseException if the node analysis discovered errors
923      */

924     protected Node exitTokenPart(Production node)
925         throws ParseException {
926
927         return node;
928     }
929
930     /**
931      * Called when adding a child to a parse tree node.
932      *
933      * @param node the parent node
934      * @param child the child node, or null
935      *
936      * @throws ParseException if the node analysis discovered errors
937      */

938     protected void childTokenPart(Production node, Node child)
939         throws ParseException {
940
941         node.addChild(child);
942     }
943
944     /**
945      * Called when entering a parse tree node.
946      *
947      * @param node the node being entered
948      *
949      * @throws ParseException if the node analysis discovered errors
950      */

951     protected void enterTokenDeclaration(Production node)
952         throws ParseException {
953     }
954
955     /**
956      * Called when exiting a parse tree node.
957      *
958      * @param node the node being exited
959      *
960      * @return the node to add to the parse tree, or
961      * null if no parse tree should be created
962      *
963      * @throws ParseException if the node analysis discovered errors
964      */

965     protected Node exitTokenDeclaration(Production node)
966         throws ParseException {
967
968         return node;
969     }
970
971     /**
972      * Called when adding a child to a parse tree node.
973      *
974      * @param node the parent node
975      * @param child the child node, or null
976      *
977      * @throws ParseException if the node analysis discovered errors
978      */

979     protected void childTokenDeclaration(Production node, Node child)
980         throws ParseException {
981
982         node.addChild(child);
983     }
984
985     /**
986      * Called when entering a parse tree node.
987      *
988      * @param node the node being entered
989      *
990      * @throws ParseException if the node analysis discovered errors
991      */

992     protected void enterTokenValue(Production node)
993         throws ParseException {
994     }
995
996     /**
997      * Called when exiting a parse tree node.
998      *
999      * @param node the node being exited
1000     *
1001     * @return the node to add to the parse tree, or
1002     * null if no parse tree should be created
1003     *
1004     * @throws ParseException if the node analysis discovered errors
1005     */

1006    protected Node exitTokenValue(Production node)
1007        throws ParseException {
1008
1009        return node;
1010    }
1011
1012    /**
1013     * Called when adding a child to a parse tree node.
1014     *
1015     * @param node the parent node
1016     * @param child the child node, or null
1017     *
1018     * @throws ParseException if the node analysis discovered errors
1019     */

1020    protected void childTokenValue(Production node, Node child)
1021        throws ParseException {
1022
1023        node.addChild(child);
1024    }
1025
1026    /**
1027     * Called when entering a parse tree node.
1028     *
1029     * @param node the node being entered
1030     *
1031     * @throws ParseException if the node analysis discovered errors
1032     */

1033    protected void enterTokenHandling(Production node)
1034        throws ParseException {
1035    }
1036
1037    /**
1038     * Called when exiting a parse tree node.
1039     *
1040     * @param node the node being exited
1041     *
1042     * @return the node to add to the parse tree, or
1043     * null if no parse tree should be created
1044     *
1045     * @throws ParseException if the node analysis discovered errors
1046     */

1047    protected Node exitTokenHandling(Production node)
1048        throws ParseException {
1049
1050        return node;
1051    }
1052
1053    /**
1054     * Called when adding a child to a parse tree node.
1055     *
1056     * @param node the parent node
1057     * @param child the child node, or null
1058     *
1059     * @throws ParseException if the node analysis discovered errors
1060     */

1061    protected void childTokenHandling(Production node, Node child)
1062        throws ParseException {
1063
1064        node.addChild(child);
1065    }
1066
1067    /**
1068     * Called when entering a parse tree node.
1069     *
1070     * @param node the node being entered
1071     *
1072     * @throws ParseException if the node analysis discovered errors
1073     */

1074    protected void enterProductionPart(Production node)
1075        throws ParseException {
1076    }
1077
1078    /**
1079     * Called when exiting a parse tree node.
1080     *
1081     * @param node the node being exited
1082     *
1083     * @return the node to add to the parse tree, or
1084     * null if no parse tree should be created
1085     *
1086     * @throws ParseException if the node analysis discovered errors
1087     */

1088    protected Node exitProductionPart(Production node)
1089        throws ParseException {
1090
1091        return node;
1092    }
1093
1094    /**
1095     * Called when adding a child to a parse tree node.
1096     *
1097     * @param node the parent node
1098     * @param child the child node, or null
1099     *
1100     * @throws ParseException if the node analysis discovered errors
1101     */

1102    protected void childProductionPart(Production node, Node child)
1103        throws ParseException {
1104
1105        node.addChild(child);
1106    }
1107
1108    /**
1109     * Called when entering a parse tree node.
1110     *
1111     * @param node the node being entered
1112     *
1113     * @throws ParseException if the node analysis discovered errors
1114     */

1115    protected void enterProductionDeclaration(Production node)
1116        throws ParseException {
1117    }
1118
1119    /**
1120     * Called when exiting a parse tree node.
1121     *
1122     * @param node the node being exited
1123     *
1124     * @return the node to add to the parse tree, or
1125     * null if no parse tree should be created
1126     *
1127     * @throws ParseException if the node analysis discovered errors
1128     */

1129    protected Node exitProductionDeclaration(Production node)
1130        throws ParseException {
1131
1132        return node;
1133    }
1134
1135    /**
1136     * Called when adding a child to a parse tree node.
1137     *
1138     * @param node the parent node
1139     * @param child the child node, or null
1140     *
1141     * @throws ParseException if the node analysis discovered errors
1142     */

1143    protected void childProductionDeclaration(Production node, Node child)
1144        throws ParseException {
1145
1146        node.addChild(child);
1147    }
1148
1149    /**
1150     * Called when entering a parse tree node.
1151     *
1152     * @param node the node being entered
1153     *
1154     * @throws ParseException if the node analysis discovered errors
1155     */

1156    protected void enterProduction(Production node)
1157        throws ParseException {
1158    }
1159
1160    /**
1161     * Called when exiting a parse tree node.
1162     *
1163     * @param node the node being exited
1164     *
1165     * @return the node to add to the parse tree, or
1166     * null if no parse tree should be created
1167     *
1168     * @throws ParseException if the node analysis discovered errors
1169     */

1170    protected Node exitProduction(Production node)
1171        throws ParseException {
1172
1173        return node;
1174    }
1175
1176    /**
1177     * Called when adding a child to a parse tree node.
1178     *
1179     * @param node the parent node
1180     * @param child the child node, or null
1181     *
1182     * @throws ParseException if the node analysis discovered errors
1183     */

1184    protected void childProduction(Production node, Node child)
1185        throws ParseException {
1186
1187        node.addChild(child);
1188    }
1189
1190    /**
1191     * Called when entering a parse tree node.
1192     *
1193     * @param node the node being entered
1194     *
1195     * @throws ParseException if the node analysis discovered errors
1196     */

1197    protected void enterProductionAtom(Production node)
1198        throws ParseException {
1199    }
1200
1201    /**
1202     * Called when exiting a parse tree node.
1203     *
1204     * @param node the node being exited
1205     *
1206     * @return the node to add to the parse tree, or
1207     * null if no parse tree should be created
1208     *
1209     * @throws ParseException if the node analysis discovered errors
1210     */

1211    protected Node exitProductionAtom(Production node)
1212        throws ParseException {
1213
1214        return node;
1215    }
1216
1217    /**
1218     * Called when adding a child to a parse tree node.
1219     *
1220     * @param node the parent node
1221     * @param child the child node, or null
1222     *
1223     * @throws ParseException if the node analysis discovered errors
1224     */

1225    protected void childProductionAtom(Production node, Node child)
1226        throws ParseException {
1227
1228        node.addChild(child);
1229    }
1230}
1231
Popular Tags