⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parser.java

📁 java1.6众多例子参考
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/* * @(#)Parser.java	4.17 05/11/17 *  * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. *//* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */package com.sun.jmx.snmp.IPAcl;import java.io.*;class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/  protected JJTParserState jjtree = new JJTParserState();// A file can contain several acl definitions//  final public JDMSecurityDefs SecurityDefs() throws ParseException {                                   /*@bgen(jjtree) SecurityDefs */  JDMSecurityDefs jjtn000 = new JDMSecurityDefs(JJTSECURITYDEFS);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);    try {      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {      case ACL:        AclBlock();        break;      default:        jj_la1[0] = jj_gen;        ;      }      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {      case TRAP:        TrapBlock();        break;      default:        jj_la1[1] = jj_gen;        ;      }      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {      case INFORM:        InformBlock();        break;      default:        jj_la1[2] = jj_gen;        ;      }      jj_consume_token(0);    jjtree.closeNodeScope(jjtn000, true);    jjtc000 = false;    {if (true) return jjtn000;}    } catch (Throwable jjte000) {    if (jjtc000) {      jjtree.clearNodeScope(jjtn000);      jjtc000 = false;    } else {      jjtree.popNode();    }    if (jjte000 instanceof RuntimeException) {      {if (true) throw (RuntimeException)jjte000;}    }    if (jjte000 instanceof ParseException) {      {if (true) throw (ParseException)jjte000;}    }    {if (true) throw (Error)jjte000;}    } finally {    if (jjtc000) {      jjtree.closeNodeScope(jjtn000, true);    }    }    throw new Error("Missing return statement in function");  }  final public void AclBlock() throws ParseException {                  /*@bgen(jjtree) AclBlock */  JDMAclBlock jjtn000 = new JDMAclBlock(JJTACLBLOCK);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);    try {      jj_consume_token(ACL);      jj_consume_token(ASSIGN);      jj_consume_token(LBRACE);      label_1:      while (true) {        AclItem();        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {        case LBRACE:          ;          break;        default:          jj_la1[3] = jj_gen;          break label_1;        }      }      jj_consume_token(RBRACE);    } catch (Throwable jjte000) {  if (jjtc000) {    jjtree.clearNodeScope(jjtn000);    jjtc000 = false;  } else {    jjtree.popNode();  }  if (jjte000 instanceof RuntimeException) {    {if (true) throw (RuntimeException)jjte000;}  }  if (jjte000 instanceof ParseException) {    {if (true) throw (ParseException)jjte000;}  }  {if (true) throw (Error)jjte000;}    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }  }  final public void AclItem() throws ParseException {                 /*@bgen(jjtree) AclItem */  JDMAclItem jjtn000 = new JDMAclItem(JJTACLITEM);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);    try {      jj_consume_token(LBRACE);      jjtn000.com = Communities();      jjtn000.access = Access();      Managers();      jj_consume_token(RBRACE);    } catch (Throwable jjte000) {  if (jjtc000) {    jjtree.clearNodeScope(jjtn000);    jjtc000 = false;  } else {    jjtree.popNode();  }  if (jjte000 instanceof RuntimeException) {    {if (true) throw (RuntimeException)jjte000;}  }  if (jjte000 instanceof ParseException) {    {if (true) throw (ParseException)jjte000;}  }  {if (true) throw (Error)jjte000;}    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }  }  final public JDMCommunities Communities() throws ParseException {                               /*@bgen(jjtree) Communities */  JDMCommunities jjtn000 = new JDMCommunities(JJTCOMMUNITIES);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);    try {      jj_consume_token(COMMUNITIES);      jj_consume_token(ASSIGN);      Community();      label_2:      while (true) {        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {        case COMMA:          ;          break;        default:          jj_la1[4] = jj_gen;          break label_2;        }        jj_consume_token(COMMA);        Community();      }  jjtree.closeNodeScope(jjtn000, true);  jjtc000 = false; {if (true) return jjtn000;}    } catch (Throwable jjte000) {  if (jjtc000) {    jjtree.clearNodeScope(jjtn000);    jjtc000 = false;  } else {    jjtree.popNode();  }  if (jjte000 instanceof RuntimeException) {    {if (true) throw (RuntimeException)jjte000;}  }  if (jjte000 instanceof ParseException) {    {if (true) throw (ParseException)jjte000;}  }  {if (true) throw (Error)jjte000;}    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }    throw new Error("Missing return statement in function");  }  final public void Community() throws ParseException { /*@bgen(jjtree) Community */  JDMCommunity jjtn000 = new JDMCommunity(JJTCOMMUNITY);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);Token t;    try {      t = jj_consume_token(IDENTIFIER);                 jjtree.closeNodeScope(jjtn000, true);                 jjtc000 = false;                jjtn000.communityString= t.image;    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }  }  final public JDMAccess Access() throws ParseException {                     /*@bgen(jjtree) Access */  JDMAccess jjtn000 = new JDMAccess(JJTACCESS);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);    try {      jj_consume_token(ACCESS);      jj_consume_token(ASSIGN);      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {      case RO:        jj_consume_token(RO);                     jjtn000.access= RO;        break;      case RW:        jj_consume_token(RW);                     jjtn000.access= RW;        break;      default:        jj_la1[5] = jj_gen;        jj_consume_token(-1);        throw new ParseException();      }  jjtree.closeNodeScope(jjtn000, true);  jjtc000 = false; {if (true) return jjtn000;}    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }    throw new Error("Missing return statement in function");  }  final public void Managers() throws ParseException {                   /*@bgen(jjtree) Managers */  JDMManagers jjtn000 = new JDMManagers(JJTMANAGERS);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);    try {      jj_consume_token(MANAGERS);      jj_consume_token(ASSIGN);      Host();      label_3:      while (true) {        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {        case COMMA:          ;          break;        default:          jj_la1[6] = jj_gen;          break label_3;        }        jj_consume_token(COMMA);        Host();      }    } catch (Throwable jjte000) {  if (jjtc000) {    jjtree.clearNodeScope(jjtn000);    jjtc000 = false;  } else {    jjtree.popNode();  }  if (jjte000 instanceof RuntimeException) {    {if (true) throw (RuntimeException)jjte000;}  }  if (jjte000 instanceof ParseException) {    {if (true) throw (ParseException)jjte000;}  }  {if (true) throw (Error)jjte000;}    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }  }  final public void Host() throws ParseException { /*@bgen(jjtree) Host */  JDMHost jjtn000 = new JDMHost(JJTHOST);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);Token t;    try {      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {      case IDENTIFIER:        HostName();        break;      default:        jj_la1[7] = jj_gen;        if (jj_2_1(2147483647)) {          NetMask();        } else if (jj_2_2(2147483647)) {          NetMaskV6();        } else if (jj_2_3(2147483647)) {          IpAddress();        } else {          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {          case V6_ADDRESS:            IpV6Address();            break;          case INTEGER_LITERAL:            IpMask();            break;          default:            jj_la1[8] = jj_gen;            jj_consume_token(-1);            throw new ParseException();          }        }      }    } catch (Throwable jjte000) {  if (jjtc000) {    jjtree.clearNodeScope(jjtn000);    jjtc000 = false;  } else {    jjtree.popNode();  }  if (jjte000 instanceof RuntimeException) {    {if (true) throw (RuntimeException)jjte000;}  }  if (jjte000 instanceof ParseException) {    {if (true) throw (ParseException)jjte000;}  }  {if (true) throw (Error)jjte000;}    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }  }  final public void HostName() throws ParseException { /*@bgen(jjtree) HostName */  JDMHostName jjtn000 = new JDMHostName(JJTHOSTNAME);  boolean jjtc000 = true;  jjtree.openNodeScope(jjtn000);Token t;    try {      t = jj_consume_token(IDENTIFIER);                   jjtn000.name.append(t.image);      label_4:      while (true) {        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {        case DOT:          ;          break;        default:          jj_la1[9] = jj_gen;          break label_4;        }        jj_consume_token(DOT);        t = jj_consume_token(IDENTIFIER);   jjtn000.name.append( "." + t.image);      }    } finally {    if (jjtc000) {      jjtree.closeNodeScope(jjtn000, true);    }    }  }  final public void IpAddress() throws ParseException { /*@bgen(jjtree) IpAddress */JDMIpAddress jjtn000 = new JDMIpAddress(JJTIPADDRESS);boolean jjtc000 = true;jjtree.openNodeScope(jjtn000);Token t;    try {      t = jj_consume_token(INTEGER_LITERAL);   jjtn000.address.append(t.image);      label_5:      while (true) {        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {        case DOT:          ;          break;        default:          jj_la1[10] = jj_gen;          break label_5;        }        jj_consume_token(DOT);        t = jj_consume_token(INTEGER_LITERAL);   jjtn000.address.append( "." + t.image);      }    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }  }  final public void IpV6Address() throws ParseException { /*@bgen(jjtree) IpV6Address */JDMIpV6Address jjtn000 = new JDMIpV6Address(JJTIPV6ADDRESS);boolean jjtc000 = true;jjtree.openNodeScope(jjtn000);Token t;    try {      t = jj_consume_token(V6_ADDRESS);    jjtree.closeNodeScope(jjtn000, true);    jjtc000 = false;   jjtn000.address.append(t.image);    } finally {  if (jjtc000) {    jjtree.closeNodeScope(jjtn000, true);  }    }  }  final public void IpMask() throws ParseException { /*@bgen(jjtree) IpMask */JDMIpMask jjtn000 = new JDMIpMask(JJTIPMASK);boolean jjtc000 = true;jjtree.openNodeScope(jjtn000);Token t;    try {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -