Ignore:
Timestamp:
Nov 24, 2015, 4:27:35 PM (4 years ago)
Author:
nmedfort
Message:

More work on n-ary operations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.h

    r4878 r4880  
    303303    PabloAST * removeOperand(const unsigned index);
    304304
     305    unsigned removeOperand(const PabloAST * const expr);
     306
    305307    iterator begin() {
    306308        return iterator(mOperand);
     
    603605}
    604606
     607/** ------------------------------------------------------------------------------------------------------------- *
     608 * @brief removeOperand
     609 ** ------------------------------------------------------------------------------------------------------------- */
     610inline unsigned Variadic::removeOperand(const PabloAST * const expr) {
     611    for (unsigned i = 0; i != getNumOperands(); ++i) {
     612        if (getOperand(i) == expr) {
     613            removeOperand(i);
     614            return i;
     615        }
     616    }
     617    return -1;
    605618}
    606619
     620}
     621
    607622#endif // PE_PabloAST_H
Note: See TracChangeset for help on using the changeset viewer.