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 /* this file is generated by RelaxNGCC */
  27 package com.sun.tools.internal.jxc.gen.config;
  28 import org.xml.sax.SAXException;
  29 import org.xml.sax.XMLReader;
  30 import org.xml.sax.Attributes;
  31 import com.sun.tools.internal.jxc.NGCCRuntimeEx;
  32 
  33 import java.util.List;
  34     import java.util.ArrayList;
  35 
  36 /**
  37  * <p><b>
  38  *     Auto-generated, do not edit.
  39  * </b></p>
  40  */
  41 public class Classes extends NGCCHandler {
  42     private String __text;
  43     private String exclude_content;
  44     private String include_content;
  45     protected final NGCCRuntimeEx $runtime;
  46     private int $_ngcc_current_state;
  47     protected String $uri;
  48     protected String $localName;
  49     protected String $qname;
  50 
  51     public final NGCCRuntime getRuntime() {
  52         return($runtime);
  53     }
  54 
  55     public Classes(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
  56         super(source, parent, cookie);
  57         $runtime = runtime;
  58         $_ngcc_current_state = 12;
  59     }
  60 
  61     public Classes(NGCCRuntimeEx runtime) {
  62         this(null, runtime, runtime, -1);
  63     }
  64 
  65     private void action0()throws SAXException {
  66          this.excludes.add(exclude_content);
  67 }
  68 
  69     private void action1()throws SAXException {
  70         $runtime.processList(__text);}
  71 
  72     private void action2()throws SAXException {
  73          this.includes.add(include_content);
  74 }
  75 
  76     private void action3()throws SAXException {
  77         $runtime.processList(__text);}
  78 
  79     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
  80         int $ai;
  81         $uri = $__uri;
  82         $localName = $__local;
  83         $qname = $__qname;
  84         switch($_ngcc_current_state) {
  85         case 12:
  86             {
  87                 if(($__uri.equals("") && $__local.equals("classes"))) {
  88                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
  89                     $_ngcc_current_state = 11;
  90                 }
  91                 else {
  92                     unexpectedEnterElement($__qname);
  93                 }
  94             }
  95             break;
  96         case 2:
  97             {
  98                 if(($__uri.equals("") && $__local.equals("excludes"))) {
  99                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
 100                     $_ngcc_current_state = 6;
 101                 }
 102                 else {
 103                     $_ngcc_current_state = 1;
 104                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
 105                 }
 106             }
 107             break;
 108         case 4:
 109             {
 110                 $_ngcc_current_state = 3;
 111                 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
 112             }
 113             break;
 114         case 11:
 115             {
 116                 if(($__uri.equals("") && $__local.equals("includes"))) {
 117                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
 118                     $_ngcc_current_state = 10;
 119                 }
 120                 else {
 121                     unexpectedEnterElement($__qname);
 122                 }
 123             }
 124             break;
 125         case 0:
 126             {
 127                 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
 128             }
 129             break;
 130         default:
 131             {
 132                 unexpectedEnterElement($__qname);
 133             }
 134             break;
 135         }
 136     }
 137 
 138     public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
 139         int $ai;
 140         $uri = $__uri;
 141         $localName = $__local;
 142         $qname = $__qname;
 143         switch($_ngcc_current_state) {
 144         case 2:
 145             {
 146                 $_ngcc_current_state = 1;
 147                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
 148             }
 149             break;
 150         case 4:
 151             {
 152                 $_ngcc_current_state = 3;
 153                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
 154             }
 155             break;
 156         case 1:
 157             {
 158                 if(($__uri.equals("") && $__local.equals("classes"))) {
 159                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
 160                     $_ngcc_current_state = 0;
 161                 }
 162                 else {
 163                     unexpectedLeaveElement($__qname);
 164                 }
 165             }
 166             break;
 167         case 3:
 168             {
 169                 if(($__uri.equals("") && $__local.equals("excludes"))) {
 170                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
 171                     $_ngcc_current_state = 1;
 172                 }
 173                 else {
 174                     unexpectedLeaveElement($__qname);
 175                 }
 176             }
 177             break;
 178         case 0:
 179             {
 180                 revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
 181             }
 182             break;
 183         case 8:
 184             {
 185                 if(($__uri.equals("") && $__local.equals("includes"))) {
 186                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
 187                     $_ngcc_current_state = 2;
 188                 }
 189                 else {
 190                     unexpectedLeaveElement($__qname);
 191                 }
 192             }
 193             break;
 194         default:
 195             {
 196                 unexpectedLeaveElement($__qname);
 197             }
 198             break;
 199         }
 200     }
 201 
 202     public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
 203         int $ai;
 204         $uri = $__uri;
 205         $localName = $__local;
 206         $qname = $__qname;
 207         switch($_ngcc_current_state) {
 208         case 2:
 209             {
 210                 $_ngcc_current_state = 1;
 211                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
 212             }
 213             break;
 214         case 4:
 215             {
 216                 $_ngcc_current_state = 3;
 217                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
 218             }
 219             break;
 220         case 0:
 221             {
 222                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
 223             }
 224             break;
 225         default:
 226             {
 227                 unexpectedEnterAttribute($__qname);
 228             }
 229             break;
 230         }
 231     }
 232 
 233     public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
 234         int $ai;
 235         $uri = $__uri;
 236         $localName = $__local;
 237         $qname = $__qname;
 238         switch($_ngcc_current_state) {
 239         case 2:
 240             {
 241                 $_ngcc_current_state = 1;
 242                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
 243             }
 244             break;
 245         case 4:
 246             {
 247                 $_ngcc_current_state = 3;
 248                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
 249             }
 250             break;
 251         case 0:
 252             {
 253                 revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
 254             }
 255             break;
 256         default:
 257             {
 258                 unexpectedLeaveAttribute($__qname);
 259             }
 260             break;
 261         }
 262     }
 263 
 264     public void text(String $value) throws SAXException {
 265         int $ai;
 266         switch($_ngcc_current_state) {
 267         case 2:
 268             {
 269                 $_ngcc_current_state = 1;
 270                 $runtime.sendText(super._cookie, $value);
 271             }
 272             break;
 273         case 4:
 274             {
 275                 exclude_content = $value;
 276                 $_ngcc_current_state = 3;
 277                 action0();
 278             }
 279             break;
 280         case 10:
 281             {
 282                 __text = $value;
 283                 $_ngcc_current_state = 9;
 284                 action3();
 285             }
 286             break;
 287         case 3:
 288             {
 289                 exclude_content = $value;
 290                 $_ngcc_current_state = 3;
 291                 action0();
 292             }
 293             break;
 294         case 6:
 295             {
 296                 __text = $value;
 297                 $_ngcc_current_state = 4;
 298                 action1();
 299             }
 300             break;
 301         case 0:
 302             {
 303                 revertToParentFromText(this, super._cookie, $value);
 304             }
 305             break;
 306         case 9:
 307             {
 308                 include_content = $value;
 309                 $_ngcc_current_state = 8;
 310                 action2();
 311             }
 312             break;
 313         case 8:
 314             {
 315                 include_content = $value;
 316                 $_ngcc_current_state = 8;
 317                 action2();
 318             }
 319             break;
 320         }
 321     }
 322 
 323     public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
 324         switch(cookie) {
 325         }
 326     }
 327 
 328     public boolean accepted() {
 329         return(($_ngcc_current_state == 0));
 330     }
 331 
 332 
 333        private List includes = new ArrayList();
 334        public List getIncludes() { return $runtime.getIncludePatterns(this.includes);}
 335        private List excludes = new ArrayList();
 336        public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);}
 337 
 338 }