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