Archived
1

Added the MPExpressionTree Classes

This commit is contained in:
Kim Wittenburg
2014-10-13 23:53:04 +02:00
parent 82259f87e2
commit 5592128926
60 changed files with 1981 additions and 725 deletions

View File

@@ -15,6 +15,8 @@
#import "MPParenthesisFunction.h"
#import "MPParenthesisFunctionLayout.h"
#import "MPPowerFunctionLayout.h"
#import "MPFractionFunctionLayout.h"
#import "MPFractionFunction.h"
#import "NSIndexPath+MPAdditions.h"
@@ -31,6 +33,8 @@
return [[MPParenthesisFunctionLayout alloc] initWithFunction:function parent:parent];
} else if (class == [MPPowerFunction class]) {
return [[MPPowerFunctionLayout alloc] initWithFunction:function parent:parent];
} else if (class == [MPFractionFunction class]) {
return [[MPFractionFunctionLayout alloc] initWithFunction:function parent:parent];
}
return [[self alloc] initWithFunction:function
parent:parent];
@@ -67,6 +71,11 @@
return [self cachableObjectForIndex:actualIndex generator:generator];
}
- (NSUInteger)numberOfChildren
{
return self.function.numberOfChildren;
}
- (MPLayout *)childLayoutAtIndex:(NSUInteger)index
{
return [self cachableObjectForIndex:index generator:^id{