// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ElementTest.java
// public class ElementTest extends KindTest {
//     @Nullable final QNameW name;
//     @Nullable QNameW typeName;
//     @Nullable boolean optionalType;
// 
//     public ElementTest() {
//         this(null);
//     }
// 
//     public ElementTest(final QNameW name) {
//         this(name, null);
//     }
// 
//     public ElementTest(final QNameW name, final QNameW typeName) {
//         this(name, typeName, false);
//     }
// 
//     public ElementTest(final QNameW name, final QNameW typeName, final Boolean optionalType) {
//         super(Kind.ELEMENT);
//         this.name = name;
//         this.typeName = typeName;
//         this.optionalType = optionalType == null ? false : optionalType;
//     }
// 
//     @Override
//     protected String describeParams() {
//         return (name == null ? "" : name.toString()) +
//                 (typeName == null ? "" : ", " + typeName.toString()) +
//                 (optionalType ? "?" : "");
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         if(obj != null && obj instanceof ElementTest) {
//             final ElementTest other = (ElementTest)obj;
// 
//             return
//                 ((this.name == null && other.name == null) || this.name.equals(other.name)) &&
//                 ((this.typeName == null && other.typeName == null) || this.typeName.equals(other.typeName)) &&
//                 this.optionalType == other.optionalType;
//         }
//         return false;
//     }
// 
//     @Nullable
//     public QNameW getName() {
//         return name;
//     }
// }
// 
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/QNameW.java
// public class QNameW extends AbstractASTNode {
//     public final static String WILDCARD = "*";
// 
//     @Nullable private final String prefix;
//     private final String localPart;
// 
//     public QNameW(final String localPart) {
//         this(null, localPart);
//     }
// 
//     public QNameW(final String prefix, final String localPart) {
//         this.prefix = prefix;
//         this.localPart = localPart;
//     }
// 
//     @Override
//     public final String describe() {
//         if(prefix != null) {
//             return "QNameW(" + prefix + ":" + localPart + ")";
//         } else {
//             return "QNameW(" + localPart + ")";
//         }
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         if(obj != null && obj instanceof QNameW) {
//             final QNameW other = (QNameW)obj;
// 
//             return other.localPart.equals(this.localPart) &&
//                     (other.prefix == null ? "" : other.prefix).equals(this.prefix == null ? "" : this.prefix);
//         }
// 
//         return false;
//     }
// 
//     @Nullable
//     public String getPrefix() {
//         return prefix;
//     }
// 
//     public String getLocalPart() {
//         return localPart;
//     }
// }


import com.evolvedbinary.xpath.parser.ast.ElementTest;
import com.evolvedbinary.xpath.parser.ast.QNameW;
import org.jetbrains.annotations.Nullable;
/**
 * XPath 2 Parser
 * A Parser for XPath 2
 * Copyright (C) 2016 Evolved Binary Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.evolvedbinary.xpath.parser.ast.partial;


/**
 * Created by aretter on 30/01/2016.
 */
public class PartialElementTest extends AbstractPartialASTNode<PartialElementTest.PartialElementTest1, QNameW> {

    @Override
    public PartialElementTest1 complete(@Nullable final QNameW name) {
        return new PartialElementTest1(name);
    }

    @Override
    protected String describe() {
        return "ElementTest(?, ?, ?)";
    }


    public class PartialElementTest1 extends AbstractPartialASTNode<PartialElementTest1.PartialElementTest2, QNameW> {
        @Nullable final QNameW name;

        public PartialElementTest1(final QNameW name) {
            this.name = name;
        }

        @Override
        public PartialElementTest2 complete(@Nullable final QNameW typeName){
            return new PartialElementTest2(typeName);
        }

        @Override
        protected String describe() {
            return "ElementTest(" + (name == null ? "" : name) + ", ?, ?)";
        }


// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ElementTest.java
// public class ElementTest extends KindTest {
//     @Nullable final QNameW name;
//     @Nullable QNameW typeName;
//     @Nullable boolean optionalType;
// 
//     public ElementTest() {
//         this(null);
//     }
// 
//     public ElementTest(final QNameW name) {
//         this(name, null);
//     }
// 
//     public ElementTest(final QNameW name, final QNameW typeName) {
//         this(name, typeName, false);
//     }
// 
//     public ElementTest(final QNameW name, final QNameW typeName, final Boolean optionalType) {
//         super(Kind.ELEMENT);
//         this.name = name;
//         this.typeName = typeName;
//         this.optionalType = optionalType == null ? false : optionalType;
//     }
// 
//     @Override
//     protected String describeParams() {
//         return (name == null ? "" : name.toString()) +
//                 (typeName == null ? "" : ", " + typeName.toString()) +
//                 (optionalType ? "?" : "");
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         if(obj != null && obj instanceof ElementTest) {
//             final ElementTest other = (ElementTest)obj;
// 
//             return
//                 ((this.name == null && other.name == null) || this.name.equals(other.name)) &&
//                 ((this.typeName == null && other.typeName == null) || this.typeName.equals(other.typeName)) &&
//                 this.optionalType == other.optionalType;
//         }
//         return false;
//     }
// 
//     @Nullable
//     public QNameW getName() {
//         return name;
//     }
// }
// 
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/QNameW.java
// public class QNameW extends AbstractASTNode {
//     public final static String WILDCARD = "*";
// 
//     @Nullable private final String prefix;
//     private final String localPart;
// 
//     public QNameW(final String localPart) {
//         this(null, localPart);
//     }
// 
//     public QNameW(final String prefix, final String localPart) {
//         this.prefix = prefix;
//         this.localPart = localPart;
//     }
// 
//     @Override
//     public final String describe() {
//         if(prefix != null) {
//             return "QNameW(" + prefix + ":" + localPart + ")";
//         } else {
//             return "QNameW(" + localPart + ")";
//         }
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         if(obj != null && obj instanceof QNameW) {
//             final QNameW other = (QNameW)obj;
// 
//             return other.localPart.equals(this.localPart) &&
//                     (other.prefix == null ? "" : other.prefix).equals(this.prefix == null ? "" : this.prefix);
//         }
// 
//         return false;
//     }
// 
//     @Nullable
//     public String getPrefix() {
//         return prefix;
//     }
// 
//     public String getLocalPart() {
//         return localPart;
//     }
// }


// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialElementTest.java
import com.evolvedbinary.xpath.parser.ast.ElementTest;
import com.evolvedbinary.xpath.parser.ast.QNameW;
import org.jetbrains.annotations.Nullable;

/**
 * XPath 2 Parser
 * A Parser for XPath 2
 * Copyright (C) 2016 Evolved Binary Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.evolvedbinary.xpath.parser.ast.partial;


/**
 * Created by aretter on 30/01/2016.
 */
public class PartialElementTest extends AbstractPartialASTNode<PartialElementTest.PartialElementTest1, QNameW> {

    @Override
    public PartialElementTest1 complete(@Nullable final QNameW name) {
        return new PartialElementTest1(name);
    }

    @Override
    protected String describe() {
        return "ElementTest(?, ?, ?)";
    }


    public class PartialElementTest1 extends AbstractPartialASTNode<PartialElementTest1.PartialElementTest2, QNameW> {
        @Nullable final QNameW name;

        public PartialElementTest1(final QNameW name) {
            this.name = name;
        }

        @Override
        public PartialElementTest2 complete(@Nullable final QNameW typeName){
            return new PartialElementTest2(typeName);
        }

        @Override
        protected String describe() {
            return "ElementTest(" + (name == null ? "" : name) + ", ?, ?)";
        }


        public class PartialElementTest2 extends AbstractPartialASTNode<ElementTest, Boolean> {