<?xml version="1.0" encoding="UTF-8" ?>

<!--
    Copyright (c) 2001-2008, Jean Tessier
    All rights reserved.
    
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    
    	* Redistributions of source code must retain the above copyright
    	  notice, this list of conditions and the following disclaimer.
    
    	* Redistributions in binary form must reproduce the above copyright
    	  notice, this list of conditions and the following disclaimer in the
    	  documentation and/or other materials provided with the distribution.
    
    	* Neither the name of Jean Tessier nor the names of his contributors
    	  may be used to endorse or promote products derived from this software
    	  without specific prior written permission.
    
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<!ELEMENT classfiles (classfile*)>

<!ELEMENT classfile (constant-pool, public?, final?, super?, is-interface?, abstract?, this-class, superclass, interfaces?, fields?, methods?, attributes?)>
<!ATTLIST classfile
          magic-number  CDATA #REQUIRED
          minor-version CDATA #REQUIRED
          major-version CDATA #REQUIRED
          access-flag CDATA #REQUIRED
>

<!ELEMENT constant-pool (class | field-ref-info | method-ref-info | interface-method-ref-info | string-info | integer-info | float-info | long-info | double-info | name-and-type-info | utf8-info)* >

<!ELEMENT class (#PCDATA) >
<!ATTLIST class
          id CDATA #IMPLIED
>

<!ELEMENT field-ref-info (class, type, name) >
<!ATTLIST field-ref-info
          id CDATA #REQUIRED
>

<!ELEMENT method-ref-info (class, name, type) >
<!ATTLIST method-ref-info
          id CDATA #REQUIRED
>

<!ELEMENT interface-method-ref-info (class, name, type) >
<!ATTLIST interface-method-ref-info
          id CDATA #REQUIRED
>

<!ELEMENT string-info (#PCDATA) >
<!ATTLIST string-info
          id CDATA #REQUIRED
>

<!ELEMENT integer-info (#PCDATA) >
<!ATTLIST integer-info
          id CDATA #REQUIRED
>

<!ELEMENT float-info (#PCDATA) >
<!ATTLIST float-info
          id CDATA #REQUIRED
>

<!ELEMENT long-info (#PCDATA) >
<!ATTLIST long-info
          id CDATA #REQUIRED
>

<!ELEMENT double-info (#PCDATA) >
<!ATTLIST double-info
          id CDATA #REQUIRED
>

<!ELEMENT name-and-type-info (name, type) >
<!ATTLIST name-and-type-info
          id CDATA #REQUIRED
>

<!ELEMENT utf8-info (#PCDATA) >
<!ATTLIST utf8-info
          id CDATA #REQUIRED
>

<!ELEMENT type (#PCDATA) >

<!ELEMENT name (#PCDATA) >

<!ELEMENT public EMPTY >

<!ELEMENT final EMPTY >

<!ELEMENT super EMPTY >

<!ELEMENT is-interface EMPTY >

<!ELEMENT abstract EMPTY >

<!ELEMENT this-class (#PCDATA) >

<!ELEMENT superclass (#PCDATA) >

<!ELEMENT interfaces (interface*) >

<!ELEMENT interface (#PCDATA) >

<!ELEMENT fields (field-info*) >

<!ELEMENT field-info (public?, protected?, private?, static?, final?, volatile?, transient?, synthetic?, name, type, attributes?)>
<!ATTLIST field-info
          access-flag CDATA #REQUIRED
>

<!ELEMENT protected EMPTY >

<!ELEMENT private EMPTY >

<!ELEMENT static EMPTY >

<!ELEMENT volatile EMPTY >

<!ELEMENT transient EMPTY >

<!ELEMENT synthetic EMPTY >

<!ELEMENT methods (method-info*) >

<!ELEMENT method-info (public?, protected?, private?, static?, final?, synchronized?, native?, abstract?, strict?, synthetic?, name, return-type?, signature, attributes?)>
<!ATTLIST method-info
          access-flag CDATA #REQUIRED
>

<!ELEMENT synchronized EMPTY >

<!ELEMENT native EMPTY >

<!ELEMENT strict EMPTY >

<!ELEMENT return-type (#PCDATA) >

<!ELEMENT signature (#PCDATA) >

<!ELEMENT attributes (constant-value-attribute | code-attribute | exceptions-attribute | inner-classes-attribute | synthetic-attribute | source-file-attribute | line-number-table-attribute | local-variable-table-attribute | deprecated-attribute)* >

<!ELEMENT constant-value-attribute (#PCDATA) >

<!ELEMENT code-attribute (length, instructions, exception-handlers?, attributes?) >

<!ELEMENT length (#PCDATA) >

<!ELEMENT instructions (instruction*) >

<!ELEMENT instruction (#PCDATA) >
<!ATTLIST instruction
          pc     CDATA #REQUIRED
          length CDATA #REQUIRED
>

<!ELEMENT exception-handlers (exception-handler*) >

<!ELEMENT exception-handler (start-pc, end-pc, handler-pc, catch-type) >

<!ELEMENT start-pc (#PCDATA) >

<!ELEMENT end-pc (#PCDATA) >

<!ELEMENT handler-pc (#PCDATA) >

<!ELEMENT catch-type (#PCDATA) >

<!ELEMENT exceptions-attribute (exception*) >

<!ELEMENT exception (#PCDATA) >

<!ELEMENT inner-classes-attribute (inner-class*) >

<!ELEMENT inner-class (public?, protected?, private?, static?, final?, is-interface?, abstract?, synthetic?, inner-class-info, outer-class-info, inner-name)>
<!ATTLIST inner-class
          access-flag CDATA #REQUIRED
>

<!ELEMENT inner-class-info (#PCDATA) >

<!ELEMENT outer-class-info (#PCDATA) >

<!ELEMENT inner-name (#PCDATA) >

<!ELEMENT synthetic-attribute EMPTY >

<!ELEMENT source-file-attribute (#PCDATA) >

<!ELEMENT line-number-table-attribute (line-number*) >

<!ELEMENT line-number (start-pc, line) >

<!ELEMENT line (#PCDATA) >

<!ELEMENT local-variable-table-attribute (local-variable*) >

<!ELEMENT local-variable (name, type) >
<!ATTLIST local-variable
          pc     CDATA #REQUIRED
          length CDATA #REQUIRED
>

<!ELEMENT descriptor (#PCDATA) >

<!ELEMENT deprecated-attribute EMPTY >
