/* this file is generated by RelaxNGCC */
package relaxngcc.parser.state;
import org.xml.sax.SAXException;
import org.xml.sax.Attributes;
import relaxngcc.parser.ParserRuntime;

    import relaxngcc.grammar.*;
    import relaxngcc.datatype.Datatype;
    import org.xml.sax.Locator;
  


class NGCCDefineParamState extends NGCCHandler {
    private String access;
    private String returnType;
    private String returnValue;
    private String className;
    private String params;
    protected final ParserRuntime $runtime;
    private int $_ngcc_current_state;
    protected String $uri;
    protected String $localName;
    protected String $qname;

    public final NGCCRuntime getRuntime() {
        return($runtime);
    }

    public NGCCDefineParamState(NGCCHandler parent, NGCCEventSource source, ParserRuntime runtime, int cookie, String _className) {
        super(source, parent, cookie);
        $runtime = runtime;
        this.className = _className;
        $_ngcc_current_state = 14;
    }

    public NGCCDefineParamState(ParserRuntime runtime, String _className) {
        this(null, runtime, runtime, -1, _className);
    }

    private void action0()throws SAXException {
        
      param = new NGCCDefineParam($runtime,className,access,returnType,returnValue,params);
    
}

    public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromEnterElement(param, super._cookie, $__uri, $__local, $__qname, $attrs);
            }
            break;
        case 1:
            {
                action0();
                $_ngcc_current_state = 0;
                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
            }
            break;
        case 2:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","return-value"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
                else {
                    $_ngcc_current_state = 1;
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
            }
            break;
        case 14:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","params"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
                else {
                    $_ngcc_current_state = 10;
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
            }
            break;
        case 6:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","return-type"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
                else {
                    $_ngcc_current_state = 2;
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
            }
            break;
        case 10:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","access"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
                else {
                    $_ngcc_current_state = 6;
                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                }
            }
            break;
        default:
            {
                unexpectedEnterElement($__qname);
            }
            break;
        }
    }

    public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromLeaveElement(param, super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 1:
            {
                action0();
                $_ngcc_current_state = 0;
                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 2:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","return-value"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
                else {
                    $_ngcc_current_state = 1;
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        case 14:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","params"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
                else {
                    $_ngcc_current_state = 10;
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        case 6:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","return-type"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
                else {
                    $_ngcc_current_state = 2;
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        case 10:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","access"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
                else {
                    $_ngcc_current_state = 6;
                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        default:
            {
                unexpectedLeaveElement($__qname);
            }
            break;
        }
    }

    public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromEnterAttribute(param, super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 1:
            {
                action0();
                $_ngcc_current_state = 0;
                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 2:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("return-value"))) {
                    $_ngcc_current_state = 4;
                }
                else {
                    $_ngcc_current_state = 1;
                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        case 14:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("params"))) {
                    $_ngcc_current_state = 16;
                }
                else {
                    $_ngcc_current_state = 10;
                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        case 6:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("return-type"))) {
                    $_ngcc_current_state = 8;
                }
                else {
                    $_ngcc_current_state = 2;
                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        case 10:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("access"))) {
                    $_ngcc_current_state = 12;
                }
                else {
                    $_ngcc_current_state = 6;
                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                }
            }
            break;
        default:
            {
                unexpectedEnterAttribute($__qname);
            }
            break;
        }
    }

    public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 3:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("return-value"))) {
                    $_ngcc_current_state = 1;
                }
                else {
                    unexpectedLeaveAttribute($__qname);
                }
            }
            break;
        case 7:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("return-type"))) {
                    $_ngcc_current_state = 2;
                }
                else {
                    unexpectedLeaveAttribute($__qname);
                }
            }
            break;
        case 11:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("access"))) {
                    $_ngcc_current_state = 6;
                }
                else {
                    unexpectedLeaveAttribute($__qname);
                }
            }
            break;
        case 0:
            {
                revertToParentFromLeaveAttribute(param, super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 1:
            {
                action0();
                $_ngcc_current_state = 0;
                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 2:
            {
                $_ngcc_current_state = 1;
                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 14:
            {
                $_ngcc_current_state = 10;
                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 6:
            {
                $_ngcc_current_state = 2;
                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 10:
            {
                $_ngcc_current_state = 6;
                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
            }
            break;
        case 15:
            {
                if(($__uri.equals("http://www.xml.gr.jp/xmlns/relaxngcc") && $__local.equals("params"))) {
                    $_ngcc_current_state = 10;
                }
                else {
                    unexpectedLeaveAttribute($__qname);
                }
            }
            break;
        default:
            {
                unexpectedLeaveAttribute($__qname);
            }
            break;
        }
    }

    public void text(String $value) throws SAXException {
        int $ai;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromText(param, super._cookie, $value);
            }
            break;
        case 8:
            {
                returnType = $value;
                $_ngcc_current_state = 7;
            }
            break;
        case 12:
            {
                access = $value;
                $_ngcc_current_state = 11;
            }
            break;
        case 1:
            {
                action0();
                $_ngcc_current_state = 0;
                $runtime.sendText(super._cookie, $value);
            }
            break;
        case 2:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","return-value"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendText(super._cookie, $value);
                }
                else {
                    $_ngcc_current_state = 1;
                    $runtime.sendText(super._cookie, $value);
                }
            }
            break;
        case 14:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","params"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendText(super._cookie, $value);
                }
                else {
                    $_ngcc_current_state = 10;
                    $runtime.sendText(super._cookie, $value);
                }
            }
            break;
        case 16:
            {
                params = $value;
                $_ngcc_current_state = 15;
            }
            break;
        case 4:
            {
                returnValue = $value;
                $_ngcc_current_state = 3;
            }
            break;
        case 6:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","return-type"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendText(super._cookie, $value);
                }
                else {
                    $_ngcc_current_state = 2;
                    $runtime.sendText(super._cookie, $value);
                }
            }
            break;
        case 10:
            {
                if(($ai = $runtime.getAttributeIndex("http://www.xml.gr.jp/xmlns/relaxngcc","access"))>=0) {
                    $runtime.consumeAttribute($ai);
                    $runtime.sendText(super._cookie, $value);
                }
                else {
                    $_ngcc_current_state = 6;
                    $runtime.sendText(super._cookie, $value);
                }
            }
            break;
        }
    }

    public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
        switch($__cookie__) {
        }
    }

    public boolean accepted() {
        return((($_ngcc_current_state == 6) || (($_ngcc_current_state == 14) || (($_ngcc_current_state == 2) || (($_ngcc_current_state == 0) || (($_ngcc_current_state == 10) || ($_ngcc_current_state == 1)))))));
    }

    
      NGCCDefineParam param;
    
}

