// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AbstractOperand.java
// public abstract class AbstractOperand extends AbstractASTNode {
// 
//     //TODO(AR) make generic and move constructor etc from sub-classes into here
// }
// 
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AdditiveExpr.java
// public class AdditiveExpr extends AbstractOperandWithOps<AdditiveExpr.AdditiveOp> {
// 
//     public enum Additive {
//         ADD('+'),
//         SUBTRACT('-');
//         private final char syntax;
//         Additive(final char syntax) {
//             this.syntax = syntax;
//         }
// 
//         public static Additive fromSyntax(final char syntax) {
//             for(final Additive additive : Additive.values()) {
//                 if(additive.syntax == syntax) {
//                     return additive;
//                 }
//             }
//             throw new IllegalArgumentException("No such Additive: '" + syntax + "'");
//         }
// 
//         public char getSyntax() {
//             return syntax;
//         }
//     }
// 
//     public static class AdditiveOp {
//         public final Additive additive;
//         public final AbstractOperand operand;
// 
//         public AdditiveOp(final Additive additive, final AbstractOperand operand) {
//             this.additive = additive;
//             this.operand = operand;
//         }
// 
//         @Override
//         public boolean equals(final Object obj) {
//             if(obj != null && obj instanceof AdditiveOp) {
//                 final AdditiveOp other = (AdditiveOp)obj;
//                 return other.additive == additive
//                         && other.operand.equals(operand);
//             }
// 
//             return false;
//         }
//     }
// 
//     public AdditiveExpr(final AbstractOperand operand, final List<AdditiveOp> additiveOps) {
//         super(operand, additiveOps);
//     }
// 
//     public AdditiveExpr(final AbstractOperand operand, final AdditiveOp... additiveOps) {
//         super(operand, Arrays.asList(additiveOps));
//     }
// 
//     @Override
//     protected void describeOp(final StringBuilder builder, final AdditiveOp additiveOp) {
//         builder
//                 .append(" ")
//                 .append(additiveOp.additive)
//                 .append(" ")
//                 .append(additiveOp.operand);
//     }
// }


import java.util.List;
import com.evolvedbinary.xpath.parser.ast.AbstractOperand;
import com.evolvedbinary.xpath.parser.ast.AdditiveExpr;
/**
 * 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 12/02/2016.
 */
public class PartialAdditiveExpr extends AbstractPartialASTNode<AdditiveExpr, List<AdditiveExpr.AdditiveOp>> {
    private final AbstractOperand operand;

    public PartialAdditiveExpr(final AbstractOperand operand) {
        this.operand = operand;
    }

    @Override
    protected String describe() {
        return "AdditiveExpr(" +  operand + ", ?...)";
    }

    @Override
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AbstractOperand.java
// public abstract class AbstractOperand extends AbstractASTNode {
// 
//     //TODO(AR) make generic and move constructor etc from sub-classes into here
// }
// 
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AdditiveExpr.java
// public class AdditiveExpr extends AbstractOperandWithOps<AdditiveExpr.AdditiveOp> {
// 
//     public enum Additive {
//         ADD('+'),
//         SUBTRACT('-');
//         private final char syntax;
//         Additive(final char syntax) {
//             this.syntax = syntax;
//         }
// 
//         public static Additive fromSyntax(final char syntax) {
//             for(final Additive additive : Additive.values()) {
//                 if(additive.syntax == syntax) {
//                     return additive;
//                 }
//             }
//             throw new IllegalArgumentException("No such Additive: '" + syntax + "'");
//         }
// 
//         public char getSyntax() {
//             return syntax;
//         }
//     }
// 
//     public static class AdditiveOp {
//         public final Additive additive;
//         public final AbstractOperand operand;
// 
//         public AdditiveOp(final Additive additive, final AbstractOperand operand) {
//             this.additive = additive;
//             this.operand = operand;
//         }
// 
//         @Override
//         public boolean equals(final Object obj) {
//             if(obj != null && obj instanceof AdditiveOp) {
//                 final AdditiveOp other = (AdditiveOp)obj;
//                 return other.additive == additive
//                         && other.operand.equals(operand);
//             }
// 
//             return false;
//         }
//     }
// 
//     public AdditiveExpr(final AbstractOperand operand, final List<AdditiveOp> additiveOps) {
//         super(operand, additiveOps);
//     }
// 
//     public AdditiveExpr(final AbstractOperand operand, final AdditiveOp... additiveOps) {
//         super(operand, Arrays.asList(additiveOps));
//     }
// 
//     @Override
//     protected void describeOp(final StringBuilder builder, final AdditiveOp additiveOp) {
//         builder
//                 .append(" ")
//                 .append(additiveOp.additive)
//                 .append(" ")
//                 .append(additiveOp.operand);
//     }
// }


// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialAdditiveExpr.java
import java.util.List;
import com.evolvedbinary.xpath.parser.ast.AbstractOperand;
import com.evolvedbinary.xpath.parser.ast.AdditiveExpr;

/**
 * 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 12/02/2016.
 */
public class PartialAdditiveExpr extends AbstractPartialASTNode<AdditiveExpr, List<AdditiveExpr.AdditiveOp>> {
    private final AbstractOperand operand;

    public PartialAdditiveExpr(final AbstractOperand operand) {
        this.operand = operand;
    }

    @Override
    protected String describe() {
        return "AdditiveExpr(" +  operand + ", ?...)";
    }

    @Override
    public AdditiveExpr complete(final List<AdditiveExpr.AdditiveOp> additiveOps) {