KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > IPAcl > Parser


1 /*
2  * @(#)Parser.java 4.16 04/07/26
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 /* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
9 package com.sun.jmx.snmp.IPAcl;
10
11 import java.io.*;
12
13 class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/
14   protected JJTParserState jjtree = new JJTParserState();
15
16 // A file can contain several acl definitions
17
//
18
final public JDMSecurityDefs SecurityDefs() throws ParseException {
19                                    /*@bgen(jjtree) SecurityDefs */
20   JDMSecurityDefs jjtn000 = new JDMSecurityDefs(JJTSECURITYDEFS);
21   boolean jjtc000 = true;
22   jjtree.openNodeScope(jjtn000);
23     try {
24       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
25       case ACL:
26         AclBlock();
27         break;
28       default:
29         jj_la1[0] = jj_gen;
30         ;
31       }
32       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
33       case TRAP:
34         TrapBlock();
35         break;
36       default:
37         jj_la1[1] = jj_gen;
38         ;
39       }
40       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
41       case INFORM:
42         InformBlock();
43         break;
44       default:
45         jj_la1[2] = jj_gen;
46         ;
47       }
48       jj_consume_token(0);
49     jjtree.closeNodeScope(jjtn000, true);
50     jjtc000 = false;
51     {if (true) return jjtn000;}
52     } catch (Throwable JavaDoc jjte000) {
53     if (jjtc000) {
54       jjtree.clearNodeScope(jjtn000);
55       jjtc000 = false;
56     } else {
57       jjtree.popNode();
58     }
59     if (jjte000 instanceof RuntimeException JavaDoc) {
60       {if (true) throw (RuntimeException JavaDoc)jjte000;}
61     }
62     if (jjte000 instanceof ParseException) {
63       {if (true) throw (ParseException)jjte000;}
64     }
65     {if (true) throw (Error JavaDoc)jjte000;}
66     } finally {
67     if (jjtc000) {
68       jjtree.closeNodeScope(jjtn000, true);
69     }
70     }
71     throw new Error JavaDoc("Missing return statement in function");
72   }
73
74   final public void AclBlock() throws ParseException {
75                   /*@bgen(jjtree) AclBlock */
76   JDMAclBlock jjtn000 = new JDMAclBlock(JJTACLBLOCK);
77   boolean jjtc000 = true;
78   jjtree.openNodeScope(jjtn000);
79     try {
80       jj_consume_token(ACL);
81       jj_consume_token(ASSIGN);
82       jj_consume_token(LBRACE);
83       label_1:
84       while (true) {
85         AclItem();
86         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
87         case LBRACE:
88           ;
89           break;
90         default:
91           jj_la1[3] = jj_gen;
92           break label_1;
93         }
94       }
95       jj_consume_token(RBRACE);
96     } catch (Throwable JavaDoc jjte000) {
97   if (jjtc000) {
98     jjtree.clearNodeScope(jjtn000);
99     jjtc000 = false;
100   } else {
101     jjtree.popNode();
102   }
103   if (jjte000 instanceof RuntimeException JavaDoc) {
104     {if (true) throw (RuntimeException JavaDoc)jjte000;}
105   }
106   if (jjte000 instanceof ParseException) {
107     {if (true) throw (ParseException)jjte000;}
108   }
109   {if (true) throw (Error JavaDoc)jjte000;}
110     } finally {
111   if (jjtc000) {
112     jjtree.closeNodeScope(jjtn000, true);
113   }
114     }
115   }
116
117   final public void AclItem() throws ParseException {
118                  /*@bgen(jjtree) AclItem */
119   JDMAclItem jjtn000 = new JDMAclItem(JJTACLITEM);
120   boolean jjtc000 = true;
121   jjtree.openNodeScope(jjtn000);
122     try {
123       jj_consume_token(LBRACE);
124       jjtn000.com = Communities();
125       jjtn000.access = Access();
126       Managers();
127       jj_consume_token(RBRACE);
128     } catch (Throwable JavaDoc jjte000) {
129   if (jjtc000) {
130     jjtree.clearNodeScope(jjtn000);
131     jjtc000 = false;
132   } else {
133     jjtree.popNode();
134   }
135   if (jjte000 instanceof RuntimeException JavaDoc) {
136     {if (true) throw (RuntimeException JavaDoc)jjte000;}
137   }
138   if (jjte000 instanceof ParseException) {
139     {if (true) throw (ParseException)jjte000;}
140   }
141   {if (true) throw (Error JavaDoc)jjte000;}
142     } finally {
143   if (jjtc000) {
144     jjtree.closeNodeScope(jjtn000, true);
145   }
146     }
147   }
148
149   final public JDMCommunities Communities() throws ParseException {
150                                /*@bgen(jjtree) Communities */
151   JDMCommunities jjtn000 = new JDMCommunities(JJTCOMMUNITIES);
152   boolean jjtc000 = true;
153   jjtree.openNodeScope(jjtn000);
154     try {
155       jj_consume_token(COMMUNITIES);
156       jj_consume_token(ASSIGN);
157       Community();
158       label_2:
159       while (true) {
160         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
161         case COMMA:
162           ;
163           break;
164         default:
165           jj_la1[4] = jj_gen;
166           break label_2;
167         }
168         jj_consume_token(COMMA);
169         Community();
170       }
171   jjtree.closeNodeScope(jjtn000, true);
172   jjtc000 = false;
173  {if (true) return jjtn000;}
174     } catch (Throwable JavaDoc jjte000) {
175   if (jjtc000) {
176     jjtree.clearNodeScope(jjtn000);
177     jjtc000 = false;
178   } else {
179     jjtree.popNode();
180   }
181   if (jjte000 instanceof RuntimeException JavaDoc) {
182     {if (true) throw (RuntimeException JavaDoc)jjte000;}
183   }
184   if (jjte000 instanceof ParseException) {
185     {if (true) throw (ParseException)jjte000;}
186   }
187   {if (true) throw (Error JavaDoc)jjte000;}
188     } finally {
189   if (jjtc000) {
190     jjtree.closeNodeScope(jjtn000, true);
191   }
192     }
193     throw new Error JavaDoc("Missing return statement in function");
194   }
195
196   final public void Community() throws ParseException {
197  /*@bgen(jjtree) Community */
198   JDMCommunity jjtn000 = new JDMCommunity(JJTCOMMUNITY);
199   boolean jjtc000 = true;
200   jjtree.openNodeScope(jjtn000);Token t;
201     try {
202       t = jj_consume_token(IDENTIFIER);
203                  jjtree.closeNodeScope(jjtn000, true);
204                  jjtc000 = false;
205                 jjtn000.communityString= t.image;
206     } finally {
207   if (jjtc000) {
208     jjtree.closeNodeScope(jjtn000, true);
209   }
210     }
211   }
212
213   final public JDMAccess Access() throws ParseException {
214                      /*@bgen(jjtree) Access */
215   JDMAccess jjtn000 = new JDMAccess(JJTACCESS);
216   boolean jjtc000 = true;
217   jjtree.openNodeScope(jjtn000);
218     try {
219       jj_consume_token(ACCESS);
220       jj_consume_token(ASSIGN);
221       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
222       case RO:
223         jj_consume_token(RO);
224                      jjtn000.access= RO;
225         break;
226       case RW:
227         jj_consume_token(RW);
228                      jjtn000.access= RW;
229         break;
230       default:
231         jj_la1[5] = jj_gen;
232         jj_consume_token(-1);
233         throw new ParseException();
234       }
235   jjtree.closeNodeScope(jjtn000, true);
236   jjtc000 = false;
237  {if (true) return jjtn000;}
238     } finally {
239   if (jjtc000) {
240     jjtree.closeNodeScope(jjtn000, true);
241   }
242     }
243     throw new Error JavaDoc("Missing return statement in function");
244   }
245
246   final public void Managers() throws ParseException {
247                    /*@bgen(jjtree) Managers */
248   JDMManagers jjtn000 = new JDMManagers(JJTMANAGERS);
249   boolean jjtc000 = true;
250   jjtree.openNodeScope(jjtn000);
251     try {
252       jj_consume_token(MANAGERS);
253       jj_consume_token(ASSIGN);
254       Host();
255       label_3:
256       while (true) {
257         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
258         case COMMA:
259           ;
260           break;
261         default:
262           jj_la1[6] = jj_gen;
263           break label_3;
264         }
265         jj_consume_token(COMMA);
266         Host();
267       }
268     } catch (Throwable JavaDoc jjte000) {
269   if (jjtc000) {
270     jjtree.clearNodeScope(jjtn000);
271     jjtc000 = false;
272   } else {
273     jjtree.popNode();
274   }
275   if (jjte000 instanceof RuntimeException JavaDoc) {
276     {if (true) throw (RuntimeException JavaDoc)jjte000;}
277   }
278   if (jjte000 instanceof ParseException) {
279     {if (true) throw (ParseException)jjte000;}
280   }
281   {if (true) throw (Error JavaDoc)jjte000;}
282     } finally {
283   if (jjtc000) {
284     jjtree.closeNodeScope(jjtn000, true);
285   }
286     }
287   }
288
289   final public void Host() throws ParseException {
290  /*@bgen(jjtree) Host */
291   JDMHost jjtn000 = new JDMHost(JJTHOST);
292   boolean jjtc000 = true;
293   jjtree.openNodeScope(jjtn000);Token t;
294     try {
295       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
296       case IDENTIFIER:
297         HostName();
298         break;
299       default:
300         jj_la1[7] = jj_gen;
301         if (jj_2_1(2147483647)) {
302           NetMask();
303         } else if (jj_2_2(2147483647)) {
304           NetMaskV6();
305         } else if (jj_2_3(2147483647)) {
306           IpAddress();
307         } else {
308           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
309           case V6_ADDRESS:
310             IpV6Address();
311             break;
312           case INTEGER_LITERAL:
313             IpMask();
314             break;
315           default:
316             jj_la1[8] = jj_gen;
317             jj_consume_token(-1);
318             throw new ParseException();
319           }
320         }
321       }
322     } catch (Throwable JavaDoc jjte000) {
323   if (jjtc000) {
324     jjtree.clearNodeScope(jjtn000);
325     jjtc000 = false;
326   } else {
327     jjtree.popNode();
328   }
329   if (jjte000 instanceof RuntimeException JavaDoc) {
330     {if (true) throw (RuntimeException JavaDoc)jjte000;}
331   }
332   if (jjte000 instanceof ParseException) {
333     {if (true) throw (ParseException)jjte000;}
334   }
335   {if (true) throw (Error JavaDoc)jjte000;}
336     } finally {
337   if (jjtc000) {
338     jjtree.closeNodeScope(jjtn000, true);
339   }
340     }
341   }
342
343   final public void HostName() throws ParseException {
344  /*@bgen(jjtree) HostName */
345   JDMHostName jjtn000 = new JDMHostName(JJTHOSTNAME);
346   boolean jjtc000 = true;
347   jjtree.openNodeScope(jjtn000);Token t;
348     try {
349       t = jj_consume_token(IDENTIFIER);
350                    jjtn000.name.append(t.image);
351       label_4:
352       while (true) {
353         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
354         case DOT:
355           ;
356           break;
357         default:
358           jj_la1[9] = jj_gen;
359           break label_4;
360         }
361         jj_consume_token(DOT);
362         t = jj_consume_token(IDENTIFIER);
363    jjtn000.name.append( "." + t.image);
364       }
365     } finally {
366     if (jjtc000) {
367       jjtree.closeNodeScope(jjtn000, true);
368     }
369     }
370   }
371
372   final public void IpAddress() throws ParseException {
373  /*@bgen(jjtree) IpAddress */
374 JDMIpAddress jjtn000 = new JDMIpAddress(JJTIPADDRESS);
375 boolean jjtc000 = true;
376 jjtree.openNodeScope(jjtn000);Token t;
377     try {
378       t = jj_consume_token(INTEGER_LITERAL);
379    jjtn000.address.append(t.image);
380       label_5:
381       while (true) {
382         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
383         case DOT:
384           ;
385           break;
386         default:
387           jj_la1[10] = jj_gen;
388           break label_5;
389         }
390         jj_consume_token(DOT);
391         t = jj_consume_token(INTEGER_LITERAL);
392    jjtn000.address.append( "." + t.image);
393       }
394     } finally {
395   if (jjtc000) {
396     jjtree.closeNodeScope(jjtn000, true);
397   }
398     }
399   }
400
401   final public void IpV6Address() throws ParseException {
402  /*@bgen(jjtree) IpV6Address */
403 JDMIpV6Address jjtn000 = new JDMIpV6Address(JJTIPV6ADDRESS);
404 boolean jjtc000 = true;
405 jjtree.openNodeScope(jjtn000);Token t;
406     try {
407       t = jj_consume_token(V6_ADDRESS);
408     jjtree.closeNodeScope(jjtn000, true);
409     jjtc000 = false;
410    jjtn000.address.append(t.image);
411     } finally {
412   if (jjtc000) {
413     jjtree.closeNodeScope(jjtn000, true);
414   }
415     }
416   }
417
418   final public void IpMask() throws ParseException {
419  /*@bgen(jjtree) IpMask */
420 JDMIpMask jjtn000 = new JDMIpMask(JJTIPMASK);
421 boolean jjtc000 = true;
422 jjtree.openNodeScope(jjtn000);Token t;
423     try {
424       t = jj_consume_token(INTEGER_LITERAL);
425    jjtn000.address.append(t.image);
426       label_6:
427       while (true) {
428         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
429         case MARK:
430           ;
431           break;
432         default:
433           jj_la1[11] = jj_gen;
434           break label_6;
435         }
436         jj_consume_token(MARK);
437         t = jj_consume_token(INTEGER_LITERAL);
438    jjtn000.address.append( "." + t.image);
439       }
440     } finally {
441   if (jjtc000) {
442     jjtree.closeNodeScope(jjtn000, true);
443   }
444     }
445   }
446
447   final public void NetMask() throws ParseException {
448  /*@bgen(jjtree) NetMask */
449 JDMNetMask jjtn000 = new JDMNetMask(JJTNETMASK);
450 boolean jjtc000 = true;
451 jjtree.openNodeScope(jjtn000);Token t;
452     try {
453       t = jj_consume_token(INTEGER_LITERAL);
454    jjtn000.address.append(t.image);
455       label_7:
456       while (true) {
457         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
458         case DOT:
459           ;
460           break;
461         default:
462           jj_la1[12] = jj_gen;
463           break label_7;
464         }
465         jj_consume_token(DOT);
466         t = jj_consume_token(INTEGER_LITERAL);
467    jjtn000.address.append( "." + t.image);
468       }
469       jj_consume_token(MASK);
470       t = jj_consume_token(INTEGER_LITERAL);
471                               jjtree.closeNodeScope(jjtn000, true);
472                               jjtc000 = false;
473                              jjtn000.mask = t.image;
474     } finally {
475   if (jjtc000) {
476     jjtree.closeNodeScope(jjtn000, true);
477   }
478     }
479   }
480
481   final public void NetMaskV6() throws ParseException {
482  /*@bgen(jjtree) NetMaskV6 */
483 JDMNetMaskV6 jjtn000 = new JDMNetMaskV6(JJTNETMASKV6);
484 boolean jjtc000 = true;
485 jjtree.openNodeScope(jjtn000);Token t;
486     try {
487       t = jj_consume_token(V6_ADDRESS);
488    jjtn000.address.append(t.image);
489       jj_consume_token(MASK);
490       t = jj_consume_token(INTEGER_LITERAL);
491                            jjtree.closeNodeScope(jjtn000, true);
492                            jjtc000 = false;
493                           jjtn000.mask = t.image;
494     } finally {
495   if (jjtc000) {
496     jjtree.closeNodeScope(jjtn000, true);
497   }
498     }
499   }
500
501   final public void TrapBlock() throws ParseException {
502                    /*@bgen(jjtree) TrapBlock */
503   JDMTrapBlock jjtn000 = new JDMTrapBlock(JJTTRAPBLOCK);
504   boolean jjtc000 = true;
505   jjtree.openNodeScope(jjtn000);
506     try {
507       jj_consume_token(TRAP);
508       jj_consume_token(ASSIGN);
509       jj_consume_token(LBRACE);
510       label_8:
511       while (true) {
512         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
513         case LBRACE:
514           ;
515           break;
516         default:
517           jj_la1[13] = jj_gen;
518           break label_8;
519         }
520         TrapItem();
521       }
522       jj_consume_token(RBRACE);
523     } catch (Throwable JavaDoc jjte000) {
524   if (jjtc000) {
525     jjtree.clearNodeScope(jjtn000);
526     jjtc000 = false;
527   } else {
528     jjtree.popNode();
529   }
530   if (jjte000 instanceof RuntimeException JavaDoc) {
531     {if (true) throw (RuntimeException JavaDoc)jjte000;}
532   }
533   if (jjte000 instanceof ParseException) {
534     {if (true) throw (ParseException)jjte000;}
535   }
536   {if (true) throw (Error JavaDoc)jjte000;}
537     } finally {
538   if (jjtc000) {
539     jjtree.closeNodeScope(jjtn000, true);
540   }
541     }
542   }
543
544   final public void TrapItem() throws ParseException {
545                   /*@bgen(jjtree) TrapItem */
546   JDMTrapItem jjtn000 = new JDMTrapItem(JJTTRAPITEM);
547   boolean jjtc000 = true;
548   jjtree.openNodeScope(jjtn000);
549     try {
550       jj_consume_token(LBRACE);
551       jjtn000.comm = TrapCommunity();
552       TrapInterestedHost();
553       label_9:
554       while (true) {
555         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
556         case LBRACE:
557           ;
558           break;
559         default:
560           jj_la1[14] = jj_gen;
561           break label_9;
562         }
563         Enterprise();
564       }
565       jj_consume_token(RBRACE);
566     } catch (Throwable JavaDoc jjte000) {
567   if (jjtc000) {
568     jjtree.clearNodeScope(jjtn000);
569     jjtc000 = false;
570   } else {
571     jjtree.popNode();
572   }
573   if (jjte000 instanceof RuntimeException JavaDoc) {
574     {if (true) throw (RuntimeException JavaDoc)jjte000;}
575   }
576   if (jjte000 instanceof ParseException) {
577     {if (true) throw (ParseException)jjte000;}
578   }
579   {if (true) throw (Error JavaDoc)jjte000;}
580     } finally {
581   if (jjtc000) {
582     jjtree.closeNodeScope(jjtn000, true);
583   }
584     }
585   }
586
587   final public JDMTrapCommunity TrapCommunity() throws ParseException {
588  /*@bgen(jjtree) TrapCommunity */
589   JDMTrapCommunity jjtn000 = new JDMTrapCommunity(JJTTRAPCOMMUNITY);
590   boolean jjtc000 = true;
591   jjtree.openNodeScope(jjtn000);Token t;
592     try {
593       jj_consume_token(TRAPCOMMUNITY);
594       jj_consume_token(ASSIGN);
595       t = jj_consume_token(IDENTIFIER);
596                                       jjtree.closeNodeScope(jjtn000, true);
597                                       jjtc000 = false;
598                                       jjtn000.community= t.image; {if (true) return jjtn000;}
599     } finally {
600   if (jjtc000) {
601     jjtree.closeNodeScope(jjtn000, true);
602   }
603     }
604     throw new Error JavaDoc("Missing return statement in function");
605   }
606
607   final public void TrapInterestedHost() throws ParseException {
608                             /*@bgen(jjtree) TrapInterestedHost */
609   JDMTrapInterestedHost jjtn000 = new JDMTrapInterestedHost(JJTTRAPINTERESTEDHOST);
610   boolean jjtc000 = true;
611   jjtree.openNodeScope(jjtn000);
612     try {
613       jj_consume_token(HOSTS);
614       jj_consume_token(ASSIGN);
615       HostTrap();
616       label_10:
617       while (true) {
618         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
619         case COMMA:
620           ;
621           break;
622         default:
623           jj_la1[15] = jj_gen;
624           break label_10;
625         }
626         jj_consume_token(COMMA);
627         HostTrap();
628       }
629     } catch (Throwable JavaDoc jjte000) {
630   if (jjtc000) {
631     jjtree.clearNodeScope(jjtn000);
632     jjtc000 = false;
633   } else {
634     jjtree.popNode();
635   }
636   if (jjte000 instanceof RuntimeException JavaDoc) {
637     {if (true) throw (RuntimeException JavaDoc)jjte000;}
638   }
639   if (jjte000 instanceof ParseException) {
640     {if (true) throw (ParseException)jjte000;}
641   }
642   {if (true) throw (Error JavaDoc)jjte000;}
643     } finally {
644   if (jjtc000) {
645     jjtree.closeNodeScope(jjtn000, true);
646   }
647     }
648   }
649
650   final public void HostTrap() throws ParseException {
651  /*@bgen(jjtree) HostTrap */
652   JDMHostTrap jjtn000 = new JDMHostTrap(JJTHOSTTRAP);
653   boolean jjtc000 = true;
654   jjtree.openNodeScope(jjtn000);Token t;
655     try {
656       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
657       case IDENTIFIER:
658         HostName();
659         break;
660       case INTEGER_LITERAL:
661         IpAddress();
662         break;
663       case V6_ADDRESS:
664         IpV6Address();
665         break;
666       default:
667         jj_la1[16] = jj_gen;
668         jj_consume_token(-1);
669         throw new ParseException();
670       }
671     } catch (Throwable JavaDoc jjte000) {
672   if (jjtc000) {
673     jjtree.clearNodeScope(jjtn000);
674     jjtc000 = false;
675   } else {
676     jjtree.popNode();
677   }
678   if (jjte000 instanceof RuntimeException JavaDoc) {
679     {if (true) throw (RuntimeException JavaDoc)jjte000;}
680   }
681   if (jjte000 instanceof ParseException) {
682     {if (true) throw (ParseException)jjte000;}
683   }
684   {if (true) throw (Error JavaDoc)jjte000;}
685     } finally {
686   if (jjtc000) {
687     jjtree.closeNodeScope(jjtn000, true);
688   }
689     }
690   }
691
692   final public void Enterprise() throws ParseException {
693  /*@bgen(jjtree) Enterprise */
694   JDMEnterprise jjtn000 = new JDMEnterprise(JJTENTERPRISE);
695   boolean jjtc000 = true;
696   jjtree.openNodeScope(jjtn000);Token t;
697     try {
698       jj_consume_token(LBRACE);
699       jj_consume_token(ENTERPRISE);
700       jj_consume_token(ASSIGN);
701       t = jj_consume_token(CSTRING);
702                                jjtn000.enterprise= t.image;
703       jj_consume_token(TRAPNUM);
704       jj_consume_token(ASSIGN);
705       TrapNum();
706       label_11:
707       while (true) {
708         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
709         case COMMA:
710           ;
711           break;
712         default:
713           jj_la1[17] = jj_gen;
714           break label_11;
715         }
716         jj_consume_token(COMMA);
717         TrapNum();
718       }
719       jj_consume_token(RBRACE);
720     } catch (Throwable JavaDoc jjte000) {
721   if (jjtc000) {
722     jjtree.clearNodeScope(jjtn000);
723     jjtc000 = false;
724   } else {
725     jjtree.popNode();
726   }
727   if (jjte000 instanceof RuntimeException JavaDoc) {
728     {if (true) throw (RuntimeException JavaDoc)jjte000;}
729   }
730   if (jjte000 instanceof ParseException) {
731     {if (true) throw (ParseException)jjte000;}
732   }
733   {if (true) throw (Error JavaDoc)jjte000;}
734     } finally {
735   if (jjtc000) {
736     jjtree.closeNodeScope(jjtn000, true);
737   }
738     }
739   }
740
741   final public void TrapNum() throws ParseException {
742  /*@bgen(jjtree) TrapNum */
743   JDMTrapNum jjtn000 = new JDMTrapNum(JJTTRAPNUM);
744   boolean jjtc000 = true;
745   jjtree.openNodeScope(jjtn000);Token t;
746     try {
747       t = jj_consume_token(INTEGER_LITERAL);
748                        jjtn000.low= Integer.parseInt(t.image);
749       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
750       case RANGE:
751         jj_consume_token(RANGE);
752         t = jj_consume_token(INTEGER_LITERAL);
753                            jjtn000.high= Integer.parseInt(t.image);
754         break;
755       default:
756         jj_la1[18] = jj_gen;
757         ;
758       }
759     } finally {
760     if (jjtc000) {
761       jjtree.closeNodeScope(jjtn000, true);
762     }
763     }
764   }
765
766   final public void InformBlock() throws ParseException {
767                      /*@bgen(jjtree) InformBlock */
768   JDMInformBlock jjtn000 = new JDMInformBlock(JJTINFORMBLOCK);
769   boolean jjtc000 = true;
770   jjtree.openNodeScope(jjtn000);
771     try {
772       jj_consume_token(INFORM);
773       jj_consume_token(ASSIGN);
774       jj_consume_token(LBRACE);
775       label_12:
776       while (true) {
777         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
778         case LBRACE:
779           ;
780           break;
781         default:
782           jj_la1[19] = jj_gen;
783           break label_12;
784         }
785         InformItem();
786       }
787       jj_consume_token(RBRACE);
788     } catch (Throwable JavaDoc jjte000) {
789   if (jjtc000) {
790     jjtree.clearNodeScope(jjtn000);
791     jjtc000 = false;
792   } else {
793     jjtree.popNode();
794   }
795   if (jjte000 instanceof RuntimeException JavaDoc) {
796     {if (true) throw (RuntimeException JavaDoc)jjte000;}
797   }
798   if (jjte000 instanceof ParseException) {
799     {if (true) throw (ParseException)jjte000;}
800   }
801   {if (true) throw (Error JavaDoc)jjte000;}
802     } finally {
803   if (jjtc000) {
804     jjtree.closeNodeScope(jjtn000, true);
805   }
806     }
807   }
808
809   final public void InformItem() throws ParseException {
810                     /*@bgen(jjtree) InformItem */
811   JDMInformItem jjtn000 = new JDMInformItem(JJTINFORMITEM);
812   boolean jjtc000 = true;
813   jjtree.openNodeScope(jjtn000);
814     try {
815       jj_consume_token(LBRACE);
816       jjtn000.comm = InformCommunity();
817       InformInterestedHost();
818       jj_consume_token(RBRACE);
819     } catch (Throwable JavaDoc jjte000) {
820   if (jjtc000) {
821     jjtree.clearNodeScope(jjtn000);
822     jjtc000 = false;
823   } else {
824     jjtree.popNode();
825   }
826   if (jjte000 instanceof RuntimeException JavaDoc) {
827     {if (true) throw (RuntimeException JavaDoc)jjte000;}
828   }
829   if (jjte000 instanceof ParseException) {
830     {if (true) throw (ParseException)jjte000;}
831   }
832   {if (true) throw (Error JavaDoc)jjte000;}
833     } finally {
834   if (jjtc000) {
835     jjtree.closeNodeScope(jjtn000, true);
836   }
837     }
838   }
839
840   final public JDMInformCommunity InformCommunity() throws ParseException {
841  /*@bgen(jjtree) InformCommunity */
842   JDMInformCommunity jjtn000 = new JDMInformCommunity(JJTINFORMCOMMUNITY);
843   boolean jjtc000 = true;
844   jjtree.openNodeScope(jjtn000);Token t;
845     try {
846       jj_consume_token(INFORMCOMMUNITY);
847       jj_consume_token(ASSIGN);
848       t = jj_consume_token(IDENTIFIER);
849                                         jjtree.closeNodeScope(jjtn000, true);
850                                         jjtc000 = false;
851                                         jjtn000.community= t.image; {if (true) return jjtn000;}
852     } finally {
853   if (jjtc000) {
854     jjtree.closeNodeScope(jjtn000, true);
855   }
856     }
857     throw new Error JavaDoc("Missing return statement in function");
858   }
859
860   final public void InformInterestedHost() throws ParseException {
861                               /*@bgen(jjtree) InformInterestedHost */
862   JDMInformInterestedHost jjtn000 = new JDMInformInterestedHost(JJTINFORMINTERESTEDHOST);
863   boolean jjtc000 = true;
864   jjtree.openNodeScope(jjtn000);
865     try {
866       jj_consume_token(HOSTS);
867       jj_consume_token(ASSIGN);
868       HostInform();
869       label_13:
870       while (true) {
871         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
872         case COMMA:
873           ;
874           break;
875         default:
876           jj_la1[20] = jj_gen;
877           break label_13;
878         }
879         jj_consume_token(COMMA);
880         HostInform();
881       }
882     } catch (Throwable JavaDoc jjte000) {
883   if (jjtc000) {
884     jjtree.clearNodeScope(jjtn000);
885     jjtc000 = false;
886   } else {
887     jjtree.popNode();
888   }
889   if (jjte000 instanceof RuntimeException JavaDoc) {
890     {if (true) throw (RuntimeException JavaDoc)jjte000;}
891   }
892   if (jjte000 instanceof ParseException) {
893     {if (true) throw (ParseException)jjte000;}
894   }
895   {if (true) throw (Error JavaDoc)jjte000;}
896     } finally {
897   if (jjtc000) {
898     jjtree.closeNodeScope(jjtn000, true);
899   }
900     }
901   }
902
903   final public void HostInform() throws ParseException {
904  /*@bgen(jjtree) HostInform */
905   JDMHostInform jjtn000 = new JDMHostInform(JJTHOSTINFORM);
906   boolean jjtc000 = true;
907   jjtree.openNodeScope(jjtn000);Token t;
908     try {
909       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
910       case IDENTIFIER:
911         HostName();
912         break;
913       case INTEGER_LITERAL:
914         IpAddress();
915         break;
916       case V6_ADDRESS:
917         IpV6Address();
918         break;
919       default:
920         jj_la1[21] = jj_gen;
921         jj_consume_token(-1);
922         throw new ParseException();
923       }
924     } catch (Throwable JavaDoc jjte000) {
925   if (jjtc000) {
926     jjtree.clearNodeScope(jjtn000);
927     jjtc000 = false;
928   } else {
929     jjtree.popNode();
930   }
931   if (jjte000 instanceof RuntimeException JavaDoc) {
932     {if (true) throw (RuntimeException JavaDoc)jjte000;}
933   }
934   if (jjte000 instanceof ParseException) {
935     {if (true) throw (ParseException)jjte000;}
936   }
937   {if (true) throw (Error JavaDoc)jjte000;}
938     } finally {
939   if (jjtc000) {
940     jjtree.closeNodeScope(jjtn000, true);
941   }
942     }
943   }
944
945   final private boolean jj_2_1(int xla) {
946     jj_la = xla; jj_lastpos = jj_scanpos = token;
947     boolean retval = !jj_3_1();
948     jj_save(0, xla);
949     return retval;
950   }
951
952   final private boolean jj_2_2(int xla) {
953     jj_la = xla; jj_lastpos = jj_scanpos = token;
954     boolean retval = !jj_3_2();
955     jj_save(1, xla);
956     return retval;
957   }
958
959   final private boolean jj_2_3(int xla) {
960     jj_la = xla; jj_lastpos = jj_scanpos = token;
961     boolean retval = !jj_3_3();
962     jj_save(2, xla);
963     return retval;
964   }
965
966   final private boolean jj_3_3() {
967     if (jj_scan_token(INTEGER_LITERAL)) return true;
968     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
969     if (jj_scan_token(DOT)) return true;
970     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
971     return false;
972   }
973
974   final private boolean jj_3_2() {
975     if (jj_scan_token(V6_ADDRESS)) return true;
976     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
977     if (jj_scan_token(MASK)) return true;
978     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
979     if (jj_scan_token(INTEGER_LITERAL)) return true;
980     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
981     return false;
982   }
983
984   final private boolean jj_3_1() {
985     if (jj_scan_token(INTEGER_LITERAL)) return true;
986     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
987     Token xsp;
988     while (true) {
989       xsp = jj_scanpos;
990       if (jj_3R_14()) { jj_scanpos = xsp; break; }
991       if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
992     }
993     if (jj_scan_token(MASK)) return true;
994     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
995     if (jj_scan_token(INTEGER_LITERAL)) return true;
996     if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
997     return false;
998   }
999
1000  final private boolean jj_3R_14() {
1001    if (jj_scan_token(DOT)) return true;
1002    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
1003    if (jj_scan_token(INTEGER_LITERAL)) return true;
1004    if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
1005    return false;
1006  }
1007
1008  public ParserTokenManager token_source;
1009  ASCII_CharStream jj_input_stream;
1010  public Token token, jj_nt;
1011  private int jj_ntk;
1012  private Token jj_scanpos, jj_lastpos;
1013  private int jj_la;
1014  public boolean lookingAhead = false;
1015  private boolean jj_semLA;
1016  private int jj_gen;
1017  final private int[] jj_la1 = new int[22];
1018  final private int[] jj_la1_0 = {0x100,0x80000,0x100000,0x2000,0x0,0x60000,0x0,0x80000000,0x11000000,0x0,0x0,0x0,0x0,0x2000,0x2000,0x0,0x91000000,0x0,0x8000,0x2000,0x0,0x91000000,};
1019  final private int[] jj_la1_1 = {0x0,0x0,0x0,0x0,0x10,0x0,0x10,0x0,0x0,0x20,0x20,0x40,0x20,0x0,0x0,0x10,0x0,0x10,0x0,0x0,0x10,0x0,};
1020  final private JJCalls[] jj_2_rtns = new JJCalls[3];
1021  private boolean jj_rescan = false;
1022  private int jj_gc = 0;
1023
1024  public Parser(java.io.InputStream JavaDoc stream) {
1025    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
1026    token_source = new ParserTokenManager(jj_input_stream);
1027    token = new Token();
1028    jj_ntk = -1;
1029    jj_gen = 0;
1030    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
1031    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1032  }
1033
1034  public void ReInit(java.io.InputStream JavaDoc stream) {
1035    jj_input_stream.ReInit(stream, 1, 1);
1036    token_source.ReInit(jj_input_stream);
1037    token = new Token();
1038    jj_ntk = -1;
1039    jjtree.reset();
1040    jj_gen = 0;
1041    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
1042    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1043  }
1044
1045  public Parser(java.io.Reader JavaDoc stream) {
1046    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
1047    token_source = new ParserTokenManager(jj_input_stream);
1048    token = new Token();
1049    jj_ntk = -1;
1050    jj_gen = 0;
1051    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
1052    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1053  }
1054
1055  public void ReInit(java.io.Reader JavaDoc stream) {
1056    jj_input_stream.ReInit(stream, 1, 1);
1057    token_source.ReInit(jj_input_stream);
1058    token = new Token();
1059    jj_ntk = -1;
1060    jjtree.reset();
1061    jj_gen = 0;
1062    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
1063    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1064  }
1065
1066  public Parser(ParserTokenManager tm) {
1067    token_source = tm;
1068    token = new Token();
1069    jj_ntk = -1;
1070    jj_gen = 0;
1071    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
1072    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1073  }
1074
1075  public void ReInit(ParserTokenManager tm) {
1076    token_source = tm;
1077    token = new Token();
1078    jj_ntk = -1;
1079    jjtree.reset();
1080    jj_gen = 0;
1081    for (int i = 0; i < 22; i++) jj_la1[i] = -1;
1082    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
1083  }
1084
1085  final private Token jj_consume_token(int kind) throws ParseException {
1086    Token oldToken;
1087    if ((oldToken = token).next != null) token = token.next;
1088    else token = token.next = token_source.getNextToken();
1089    jj_ntk = -1;
1090    if (token.kind == kind) {
1091      jj_gen++;
1092      if (++jj_gc > 100) {
1093        jj_gc = 0;
1094        for (int i = 0; i < jj_2_rtns.length; i++) {
1095          JJCalls c = jj_2_rtns[i];
1096          while (c != null) {
1097            if (c.gen < jj_gen) c.first = null;
1098            c = c.next;
1099          }
1100        }
1101      }
1102      return token;
1103    }
1104    token = oldToken;
1105    jj_kind = kind;
1106    throw generateParseException();
1107  }
1108
1109  final private boolean jj_scan_token(int kind) {
1110    if (jj_scanpos == jj_lastpos) {
1111      jj_la--;
1112      if (jj_scanpos.next == null) {
1113        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
1114      } else {
1115        jj_lastpos = jj_scanpos = jj_scanpos.next;
1116      }
1117    } else {
1118      jj_scanpos = jj_scanpos.next;
1119    }
1120    if (jj_rescan) {
1121      int i = 0; Token tok = token;
1122      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
1123      if (tok != null) jj_add_error_token(kind, i);
1124    }
1125    return (jj_scanpos.kind != kind);
1126  }
1127
1128  final public Token getNextToken() {
1129    if (token.next != null) token = token.next;
1130    else token = token.next = token_source.getNextToken();
1131    jj_ntk = -1;
1132    jj_gen++;
1133    return token;
1134  }
1135
1136  final public Token getToken(int index) {
1137    Token t = lookingAhead ? jj_scanpos : token;
1138    for (int i = 0; i < index; i++) {
1139      if (t.next != null) t = t.next;
1140      else t = t.next = token_source.getNextToken();
1141    }
1142    return t;
1143  }
1144
1145  final private int jj_ntk() {
1146    if ((jj_nt=token.next) == null)
1147      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
1148    else
1149      return (jj_ntk = jj_nt.kind);
1150  }
1151
1152  private java.util.Vector JavaDoc jj_expentries = new java.util.Vector JavaDoc();
1153  private int[] jj_expentry;
1154  private int jj_kind = -1;
1155  private int[] jj_lasttokens = new int[100];
1156  private int jj_endpos;
1157
1158  private void jj_add_error_token(int kind, int pos) {
1159    if (pos >= 100) return;
1160    if (pos == jj_endpos + 1) {
1161      jj_lasttokens[jj_endpos++] = kind;
1162    } else if (jj_endpos != 0) {
1163      jj_expentry = new int[jj_endpos];
1164      for (int i = 0; i < jj_endpos; i++) {
1165        jj_expentry[i] = jj_lasttokens[i];
1166      }
1167      boolean exists = false;
1168      for (java.util.Enumeration JavaDoc enumv = jj_expentries.elements(); enumv.hasMoreElements();) {
1169        int[] oldentry = (int[])(enumv.nextElement());
1170        if (oldentry.length == jj_expentry.length) {
1171          exists = true;
1172          for (int i = 0; i < jj_expentry.length; i++) {
1173            if (oldentry[i] != jj_expentry[i]) {
1174              exists = false;
1175              break;
1176            }
1177          }
1178          if (exists) break;
1179        }
1180      }
1181      if (!exists) jj_expentries.addElement(jj_expentry);
1182      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
1183    }
1184  }
1185
1186  final public ParseException generateParseException() {
1187    jj_expentries.removeAllElements();
1188    boolean[] la1tokens = new boolean[40];
1189    for (int i = 0; i < 40; i++) {
1190      la1tokens[i] = false;
1191    }
1192    if (jj_kind >= 0) {
1193      la1tokens[jj_kind] = true;
1194      jj_kind = -1;
1195    }
1196    for (int i = 0; i < 22; i++) {
1197      if (jj_la1[i] == jj_gen) {
1198        for (int j = 0; j < 32; j++) {
1199          if ((jj_la1_0[i] & (1<<j)) != 0) {
1200            la1tokens[j] = true;
1201          }
1202          if ((jj_la1_1[i] & (1<<j)) != 0) {
1203            la1tokens[32+j] = true;
1204          }
1205        }
1206      }
1207    }
1208    for (int i = 0; i < 40; i++) {
1209      if (la1tokens[i]) {
1210        jj_expentry = new int[1];
1211        jj_expentry[0] = i;
1212        jj_expentries.addElement(jj_expentry);
1213      }
1214    }
1215    jj_endpos = 0;
1216    jj_rescan_token();
1217    jj_add_error_token(0, 0);
1218    int[][] exptokseq = new int[jj_expentries.size()][];
1219    for (int i = 0; i < jj_expentries.size(); i++) {
1220      exptokseq[i] = (int[])jj_expentries.elementAt(i);
1221    }
1222    return new ParseException(token, exptokseq, tokenImage);
1223  }
1224
1225  final public void enable_tracing() {
1226  }
1227
1228  final public void disable_tracing() {
1229  }
1230
1231  final private void jj_rescan_token() {
1232    jj_rescan = true;
1233    for (int i = 0; i < 3; i++) {
1234      JJCalls p = jj_2_rtns[i];
1235      do {
1236        if (p.gen > jj_gen) {
1237          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
1238          switch (i) {
1239            case 0: jj_3_1(); break;
1240            case 1: jj_3_2(); break;
1241            case 2: jj_3_3(); break;
1242          }
1243        }
1244        p = p.next;
1245      } while (p != null);
1246    }
1247    jj_rescan = false;
1248  }
1249
1250  final private void jj_save(int index, int xla) {
1251    JJCalls p = jj_2_rtns[index];
1252    while (p.gen > jj_gen) {
1253      if (p.next == null) { p = p.next = new JJCalls(); break; }
1254      p = p.next;
1255    }
1256    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
1257  }
1258
1259  static final class JJCalls {
1260    int gen;
1261    Token first;
1262    int arg;
1263    JJCalls next;
1264  }
1265
1266}
1267
Popular Tags