Added the MPExpressionTree Classes
This commit is contained in:
28
MathPad/MPFunction+MPValue.m
Normal file
28
MathPad/MPFunction+MPValue.m
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// MPFunction+MPValue.m
|
||||
// MathPad
|
||||
//
|
||||
// Created by Kim Wittenburg on 09.10.14.
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPFunction+MPValue.h"
|
||||
|
||||
@implementation MPFunction (MPValue)
|
||||
|
||||
- (instancetype)initWithTokenStream:(MPTokenStream *)tokenStream
|
||||
{
|
||||
[tokenStream beginIgnoringWhitespaceTokens];
|
||||
if (tokenStream.currentToken.tokenType != MPGenericFunctionToken) {
|
||||
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Expected Function" userInfo:nil];
|
||||
}
|
||||
[tokenStream endIgnoringOrAcceptingWhitespaceTokens];
|
||||
return [self init];
|
||||
}
|
||||
|
||||
- (NSArray *)expressionElements
|
||||
{
|
||||
return @[self];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user