//
//  MPProductFunction.m
//  MathPad
//
//  Created by Kim Wittenburg on 10.01.15.
//  Copyright (c) 2015 Kim Wittenburg. All rights reserved.
//

#import "MPProductFunction.h"

#import "MPProductFunctionTerm.h"
#import "MPExpression.h"



@implementation MPProductFunction

MPFunctionAccessorImplementation(StartExpression, _startExpression)
MPFunctionAccessorImplementation(TargetExpression, _targetExpression)
MPFunctionAccessorImplementation(ProductExpression, _productExpression)


- (NSArray *)childrenAccessors
{
    return @[@"startExpression", @"targetExpression", @"productExpression"];
}


- (BOOL)expectsVariableDefinitionInChildAtIndex:(NSUInteger)index
{
    return index == 0;
}


- (Class)functionTermClass
{
    return [MPProductFunctionTerm class];
}


- (NSString *)description
{
    return [NSString stringWithFormat:@"Product(From: %@; To: %@; Using: %@)", self.startExpression, self.targetExpression, self.productExpression];
}

@end
