Cleaned Imports
This commit is contained in:
@@ -10,10 +10,38 @@
|
||||
#import "MPExpressionElement.h"
|
||||
#import "NSString+MPExpressionElement.h"
|
||||
#import "MPFunction.h"
|
||||
#import "MPSuffixFunction.h"
|
||||
|
||||
#import "MPSumFunction.h"
|
||||
#import "MPParenthesisFunction.h"
|
||||
#import "MPPowerFunction.h"
|
||||
#import "MPFractionFunction.h"
|
||||
#import "MPRootFunction.h"
|
||||
|
||||
#import "MPToken.h"
|
||||
#import "MPFunction+MPToken.h"
|
||||
#import "MPTokenStream.h"
|
||||
|
||||
#import "MPExpressionTreeElement.h"
|
||||
#import "MPExpressionTree.h"
|
||||
#import "MPSummand.h"
|
||||
#import "MPOperatorChain.h"
|
||||
#import "MPProduct.h"
|
||||
#import "MPFactor.h"
|
||||
#import "MPValueGroup.h"
|
||||
#import "MPNumber.h"
|
||||
#import "MPVariable.h"
|
||||
#import "MPFunction+MPValue.h"
|
||||
#import "MPFunctionValue.h"
|
||||
#import "MPUnexpectedSymbolValue.h"
|
||||
#import "MPFactorial.h"
|
||||
|
||||
#import "MPEvaluationContext.h"
|
||||
#import "MPMathRules.h"
|
||||
|
||||
#import "MPRangePath.h"
|
||||
#import "MPException.h"
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
#import "NSRegularExpression+MPParsingAdditions.h"
|
||||
|
||||
#import "MPExpressionView.h"
|
||||
#import "MPExpressionStorage.h"
|
||||
@@ -76,7 +76,6 @@
|
||||
3B85833919BB63C500D76A8D /* MPExpressionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BFAC3961997B67400B3EF67 /* MPExpressionElement.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3B85833A19BB63D400D76A8D /* MPFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B87E35E19009D5F00259938 /* MPFunction.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3B85834119BB651E00D76A8D /* MPRangePath.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B87E35B1900933200259938 /* MPRangePath.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3B85834219BB652900D76A8D /* MPException.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B0F69A719028BC600817707 /* MPException.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3B85834319BB653700D76A8D /* MPSumFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BB09EC71906FD830080A5ED /* MPSumFunction.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3B85834419BB654D00D76A8D /* NSString+MPExpressionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BFAC39A1997BC7600B3EF67 /* NSString+MPExpressionElement.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3B85834519BB655200D76A8D /* NSIndexPath+MPAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BB09EDC190728220080A5ED /* NSIndexPath+MPAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -94,7 +93,6 @@
|
||||
3BBEA93619BB79A700133766 /* MPFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B87E35F19009D5F00259938 /* MPFunction.m */; };
|
||||
3BBEA93A19BB79A700133766 /* MPSumFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BB09EC81906FD830080A5ED /* MPSumFunction.m */; };
|
||||
3BBEA93B19BB79A700133766 /* MPRangePath.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B87E35C1900933200259938 /* MPRangePath.m */; };
|
||||
3BBEA93C19BB79A700133766 /* MPException.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B0F69A819028C6000817707 /* MPException.m */; };
|
||||
3BBEA93D19BB79A700133766 /* NSString+MPExpressionElement.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BFAC39B1997BC7600B3EF67 /* NSString+MPExpressionElement.m */; };
|
||||
3BBEA93E19BB79A700133766 /* NSIndexPath+MPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BB09EDD190728220080A5ED /* NSIndexPath+MPAdditions.m */; };
|
||||
3BBEA93F19BB79A700133766 /* MPExpressionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B87E3551900856F00259938 /* MPExpressionView.m */; };
|
||||
@@ -162,8 +160,6 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
3B0F69A719028BC600817707 /* MPException.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPException.h; sourceTree = "<group>"; };
|
||||
3B0F69A819028C6000817707 /* MPException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPException.m; sourceTree = "<group>"; };
|
||||
3B0F69AB1902A82C00817707 /* MPExpressionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPExpressionTests.m; path = ../MathPadTests/MPExpressionTests.m; sourceTree = "<group>"; };
|
||||
3B3A4AAC19F71855001E9D54 /* MPRootFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPRootFunction.h; sourceTree = "<group>"; };
|
||||
3B3A4AAD19F71855001E9D54 /* MPRootFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPRootFunction.m; sourceTree = "<group>"; };
|
||||
@@ -427,6 +423,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3BC46B4B19B38CB60033F13A /* Base Expression Classes */,
|
||||
3B69B68219E6E8A50028E608 /* Expression Tree */,
|
||||
3BB09EBC1905EF210080A5ED /* Functions */,
|
||||
3BC46B4C19B38CD20033F13A /* Independant Classes */,
|
||||
3BC46B4D19B38CFB0033F13A /* Helpers */,
|
||||
@@ -515,6 +512,8 @@
|
||||
3BFAC38D1997B61300B3EF67 /* MPExpression.h */,
|
||||
3BFAC38E1997B61300B3EF67 /* MPExpression.m */,
|
||||
3BFAC3961997B67400B3EF67 /* MPExpressionElement.h */,
|
||||
3BFAC39A1997BC7600B3EF67 /* NSString+MPExpressionElement.h */,
|
||||
3BFAC39B1997BC7600B3EF67 /* NSString+MPExpressionElement.m */,
|
||||
3B87E35E19009D5F00259938 /* MPFunction.h */,
|
||||
3B87E35F19009D5F00259938 /* MPFunction.m */,
|
||||
3B69B6B719E935E20028E608 /* MPSuffixFunction.h */,
|
||||
@@ -527,7 +526,6 @@
|
||||
3B7B3A5319CC50B1005849E5 /* MPFunction+MPToken.m */,
|
||||
3BB18AA319CDB3A900986DA0 /* MPTokenStream.h */,
|
||||
3BB18AA419CDB3A900986DA0 /* MPTokenStream.m */,
|
||||
3B69B68219E6E8A50028E608 /* Expression Tree */,
|
||||
3BC46B4F19B506F20033F13A /* Evaluation */,
|
||||
);
|
||||
name = "Base Expression Classes";
|
||||
@@ -538,8 +536,6 @@
|
||||
children = (
|
||||
3B87E35B1900933200259938 /* MPRangePath.h */,
|
||||
3B87E35C1900933200259938 /* MPRangePath.m */,
|
||||
3B0F69A719028BC600817707 /* MPException.h */,
|
||||
3B0F69A819028C6000817707 /* MPException.m */,
|
||||
);
|
||||
name = "Independant Classes";
|
||||
sourceTree = "<group>";
|
||||
@@ -547,8 +543,6 @@
|
||||
3BC46B4D19B38CFB0033F13A /* Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3BFAC39A1997BC7600B3EF67 /* NSString+MPExpressionElement.h */,
|
||||
3BFAC39B1997BC7600B3EF67 /* NSString+MPExpressionElement.m */,
|
||||
3BB09EDC190728220080A5ED /* NSIndexPath+MPAdditions.h */,
|
||||
3BB09EDD190728220080A5ED /* NSIndexPath+MPAdditions.m */,
|
||||
3B52CEDA19BEE63000CEDCFC /* NSRegularExpression+MPParsingAdditions.h */,
|
||||
@@ -682,7 +676,6 @@
|
||||
3B85834319BB653700D76A8D /* MPSumFunction.h in Headers */,
|
||||
3B85834119BB651E00D76A8D /* MPRangePath.h in Headers */,
|
||||
3B69B6C119E953590028E608 /* MPFactorial.h in Headers */,
|
||||
3B85834219BB652900D76A8D /* MPException.h in Headers */,
|
||||
3B69B69D19E6F2110028E608 /* MPNumber.h in Headers */,
|
||||
3B85834519BB655200D76A8D /* NSIndexPath+MPAdditions.h in Headers */,
|
||||
3B5FF73B19DB2FF500C8348A /* MPPowerFunction.h in Headers */,
|
||||
@@ -905,7 +898,6 @@
|
||||
3BBEA93E19BB79A700133766 /* NSIndexPath+MPAdditions.m in Sources */,
|
||||
3B52CEDD19BEE63000CEDCFC /* NSRegularExpression+MPParsingAdditions.m in Sources */,
|
||||
3B69B67D19E4915E0028E608 /* MPFractionFunction.m in Sources */,
|
||||
3BBEA93C19BB79A700133766 /* MPException.m in Sources */,
|
||||
3B69B68E19E6EB0D0028E608 /* MPProduct.m in Sources */,
|
||||
3B69B6B619E88E750028E608 /* MPUnexpectedSymbolValue.m in Sources */,
|
||||
3BF59AFF19D80ECC00E54292 /* MPFunctionsViewController.m in Sources */,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
@class MPEvaluationContext;
|
||||
|
||||
@interface MPEvaluationContext : NSObject
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// MPException.h
|
||||
// MathPad
|
||||
//
|
||||
// Created by Kim Wittenburg on 19.04.14.
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef MathPad_MPException_h
|
||||
#define MathPad_MPException_h
|
||||
|
||||
FOUNDATION_EXPORT NSString *MPIllegalElementException;
|
||||
FOUNDATION_EXPORT NSString *MPIllegalElementExceptionElementKey;
|
||||
|
||||
#endif
|
||||
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// MPException.m
|
||||
// MathPad
|
||||
//
|
||||
// Created by Kim Wittenburg on 19.04.14.
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPException.h"
|
||||
|
||||
NSString *MPIllegalElementException = @"MPIllegalSymbolException";
|
||||
NSString *MPIllegalElementExceptionElementKey = @"MPIllegalSymbolExceptionSymbolKey";
|
||||
@@ -6,9 +6,7 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import "NSString+MPExpressionElement.h"
|
||||
#import "MPToken.h"
|
||||
FOUNDATION_EXPORT NSString *const MPIllegalElementExceptionElementKey;
|
||||
|
||||
FOUNDATION_EXPORT NSString *const MPMathKitErrorDomain;
|
||||
FOUNDATION_EXPORT NSString *const MPExpressionPathErrorKey;
|
||||
@@ -36,7 +34,7 @@ typedef NS_ENUM(NSUInteger, MPReferenceFrame) {
|
||||
};
|
||||
|
||||
@class MPExpression, MPFunction, MPRangePath, MPExpressionTree, MPExpressionEvaluator;
|
||||
@protocol MPExpressionElement;
|
||||
@protocol MPExpressionElement, MPToken;
|
||||
|
||||
/*!
|
||||
@class MPExpression
|
||||
|
||||
@@ -7,17 +7,20 @@
|
||||
//
|
||||
|
||||
#import "MPExpression.h"
|
||||
|
||||
#import "MPExpressionElement.h"
|
||||
#import "MPFunction.h"
|
||||
|
||||
#import "MPRangePath.h"
|
||||
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
#import "MPException.h"
|
||||
|
||||
#import "MPExpressionTokenizer.h"
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpressionTree.h"
|
||||
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
NSString *const MPIllegalElementExceptionElementKey = @"MPIllegalElementExceptionElementKey";
|
||||
|
||||
NSString *const MPMathKitErrorDomain = @"MPMathKitErrorDomain";
|
||||
NSString *const MPExpressionPathErrorKey = @"MPExpressionPathErrorKey";
|
||||
@@ -93,7 +96,7 @@ NSString *const MPExpressionPathErrorKey = @"MPExpressionPathErrorKey";
|
||||
{
|
||||
for (id element in elements) {
|
||||
if (![element conformsToProtocol:@protocol(MPExpressionElement)]) {
|
||||
@throw [NSException exceptionWithName:MPIllegalElementException
|
||||
@throw [NSException exceptionWithName:@"MPIllegalElementException"
|
||||
reason:@"Elements must conform to the MPExpressionElement protocol."
|
||||
userInfo:@{MPIllegalElementExceptionElementKey: element}];
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
|
||||
@protocol MPExpressionElement <NSObject, NSCopying, NSCoding>
|
||||
|
||||
- (BOOL)isString;
|
||||
|
||||
@@ -6,14 +6,9 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
#import "MPLayout.h"
|
||||
#import "MPExpression.h"
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
#define kMPEmptyBoxWidth (self.usesSmallSize ? 2.0 : 3.0)
|
||||
#define kMPEmptyBoxHeight (CTFontGetDescent((CTFontRef)self.font) + CTFontGetAscent((CTFontRef)self.font) + CTFontGetLeading((CTFontRef)self.font))
|
||||
#define kMPEmptyBoxYOrigin (-(CTFontGetDescent((CTFontRef)self.font) + CTFontGetLeading((CTFontRef)self.font)))
|
||||
@class MPExpressionLayout, MPExpression, MPFunctionLayout;
|
||||
|
||||
@interface MPExpressionLayout : MPLayout
|
||||
|
||||
|
||||
@@ -7,17 +7,16 @@
|
||||
//
|
||||
|
||||
#import "MPExpressionLayout.h"
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPExpressionElement.h"
|
||||
#import "MPPowerFunction.h"
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
#import "MPPowerFunctionLayout.h"
|
||||
|
||||
#import "NSString+MPExpressionElement.h"
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
#define kMPEmptyBoxDrawingWidth kMPEmptyBoxWidth
|
||||
#define kMPEmptyBoxDrawingHeight (CTFontGetDescent((CTFontRef)self.font) + CTFontGetAscent((CTFontRef)self.font))
|
||||
#define kMPEmptyBoxDrawingYOrigin (-(CTFontGetDescent((CTFontRef)self.font) + CTFontGetLeading((CTFontRef)self.font)/2))
|
||||
|
||||
@interface MPExpressionLayout (MPLineGeneration)
|
||||
|
||||
- (CTLineRef)lineForElementAtIndex:(NSUInteger)index;
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
//
|
||||
|
||||
#import "MPExpressionStorage.h"
|
||||
|
||||
#import "MPExpressionView.h"
|
||||
#import "MPLayout.h"
|
||||
#import "MPExpressionLayout.h"
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
#import "MPRangePath.h"
|
||||
|
||||
@interface MPExpressionStorage ()
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPExpression.h"
|
||||
@class MPExpressionTokenizer, MPExpression;
|
||||
|
||||
@interface MPExpressionTokenizer : NSObject
|
||||
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
//
|
||||
|
||||
#import "MPExpressionTokenizer.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPExpressionElement.h"
|
||||
|
||||
#import "MPToken.h"
|
||||
#import "MPFunction+MPToken.h"
|
||||
|
||||
#import "NSRegularExpression+MPParsingAdditions.h"
|
||||
|
||||
|
||||
#define MPRangeExists(range) (range.location != NSNotFound)
|
||||
|
||||
|
||||
@implementation MPExpressionTokenizer
|
||||
|
||||
+ (NSArray *)tokenizeExpression:(MPExpression *)expression
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPSummand.h"
|
||||
#import "MPExpressionTreeElement.h"
|
||||
|
||||
@class MPExpressionTree;
|
||||
|
||||
@interface MPExpressionTree : NSObject <MPExpressionTreeElement>
|
||||
|
||||
@property (nonatomic, copy) NSString *definedVariable;
|
||||
|
||||
@@ -8,6 +8,13 @@
|
||||
|
||||
#import "MPExpressionTree.h"
|
||||
|
||||
#import "MPSummand.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
|
||||
@implementation MPExpressionTree {
|
||||
NSMutableArray *_summands;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPExpression.h"
|
||||
@class MPTokenStream;
|
||||
|
||||
@protocol MPExpressionTreeElement <NSObject>
|
||||
@required
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
// TODO: Undo/Redo + Delegate
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class MPExpressionView, MPExpressionStorage, MPExpressionLayout, MPRangePath;
|
||||
|
||||
@interface MPExpressionView : NSView
|
||||
|
||||
@@ -7,24 +7,23 @@
|
||||
//
|
||||
|
||||
#import "MPExpressionView.h"
|
||||
#import "MPExpressionStorage.h"
|
||||
#import "MPExpressionLayout.h"
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPExpressionElement.h"
|
||||
|
||||
#import "MPPowerFunction.h"
|
||||
#import "MPParenthesisFunction.h"
|
||||
#import "MPFractionFunction.h"
|
||||
|
||||
#import "MPRangePath.h"
|
||||
|
||||
#import "MPMathRules.h"
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
#import "MPSumFunction.h"
|
||||
#import "MPParenthesisFunction.h"
|
||||
#import "MPParenthesisFunctionLayout.h"
|
||||
#import "MPExpressionStorage.h"
|
||||
#import "MPExpressionLayout.h"
|
||||
|
||||
#import "MPFunctionsViewController.h"
|
||||
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
@interface MPExpressionView ()
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPExpressionTreeElement.h"
|
||||
#import "MPValueGroup.h"
|
||||
#import "MPOperatorChain.h"
|
||||
|
||||
@class MPFactor, MPOperatorChain;
|
||||
@protocol MPValue;
|
||||
|
||||
@interface MPFactor : NSObject <MPExpressionTreeElement>
|
||||
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
//
|
||||
|
||||
#import "MPFactor.h"
|
||||
|
||||
#import "MPOperatorChain.h"
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPMathRules.h"
|
||||
|
||||
@implementation MPFactor {
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
@class MPFactorial;
|
||||
|
||||
@interface MPFactorial : NSObject <MPValue>
|
||||
|
||||
@property (readonly, nonatomic, strong) id<MPValue> value;
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "MPFactorial.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
@implementation MPFactorial
|
||||
|
||||
- (instancetype)init
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <MathKit/MathKit.h>
|
||||
#import "MPFunction.h"
|
||||
|
||||
@class MPFractionFunction, MPExpression;
|
||||
|
||||
@interface MPFractionFunction : MPFunction
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#import "MPFractionFunction.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPExpressionTree.h"
|
||||
|
||||
@implementation MPFractionFunction
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
//
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
#import "MPFractionFunction.h"
|
||||
|
||||
@class MPFractionFunctionLayout, MPFractionFunction;
|
||||
|
||||
@interface MPFractionFunctionLayout : MPFunctionLayout
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
//
|
||||
|
||||
#import "MPFractionFunctionLayout.h"
|
||||
#import "MPExpressionLayout.h"
|
||||
|
||||
#import "MPFractionFunction.h"
|
||||
|
||||
#define kFractionFunctionLineWidth 1.0
|
||||
#define kFractionFunctionHorizontalInset 2.0
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <MathKit/MathKit.h>
|
||||
#import "MPFunction.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
@interface MPFunction (MPToken) <MPToken>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "MPFunction+MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
|
||||
@implementation MPFunction (MPToken)
|
||||
|
||||
- (MPTokenType)tokenType
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <MathKit/MathKit.h>
|
||||
#import "MPFunction.h"
|
||||
#import "MPValueGroup.h"
|
||||
#import "MPFunction+MPToken.h"
|
||||
|
||||
@interface MPFunction (MPValue) <MPValue>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "MPFunction+MPValue.h"
|
||||
|
||||
#import "MPFunction+MPToken.h"
|
||||
|
||||
@implementation MPFunction (MPValue)
|
||||
|
||||
- (instancetype)initWithTokenStream:(MPTokenStream *)tokenStream
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import "MPExpressionElement.h"
|
||||
|
||||
#define MPFunctionAccessorImplementation(Accessor, variableName) \
|
||||
@@ -19,6 +18,7 @@
|
||||
}
|
||||
|
||||
@class MPFunction, MPExpression, MPRangePath;
|
||||
@protocol MPExpressionElement;
|
||||
|
||||
@interface MPFunction : NSObject <NSCoding, NSCopying, MPExpressionElement>
|
||||
|
||||
|
||||
@@ -7,18 +7,13 @@
|
||||
//
|
||||
|
||||
#import "MPFunction.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPRangePath.h"
|
||||
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
@implementation MPFunction
|
||||
|
||||
+ (NSString *)localizedFunctionName
|
||||
{
|
||||
return NSLocalizedString(@"Function", @"Name of Generic Function.");
|
||||
}
|
||||
|
||||
#pragma mark Creation Methods
|
||||
- (instancetype)init
|
||||
{
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
#import "MPLayout.h"
|
||||
|
||||
@class MPFunctionLayout, MPFunction, MPExpressionLayout;
|
||||
|
||||
@interface MPFunctionLayout : MPLayout
|
||||
|
||||
+ (MPFunctionLayout *)functionLayoutForFunction:(MPFunction *)function
|
||||
|
||||
@@ -7,18 +7,21 @@
|
||||
//
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
#import "MPFunction.h"
|
||||
#import "MPExpressionLayout.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPFunction.h"
|
||||
#import "MPSumFunction.h"
|
||||
#import "MPSumFunctionLayout.h"
|
||||
#import "MPParenthesisFunction.h"
|
||||
#import "MPPowerFunction.h"
|
||||
#import "MPFractionFunction.h"
|
||||
#import "MPRootFunction.h"
|
||||
|
||||
#import "MPExpressionLayout.h"
|
||||
#import "MPSumFunctionLayout.h"
|
||||
#import "MPParenthesisFunctionLayout.h"
|
||||
#import "MPPowerFunctionLayout.h"
|
||||
#import "MPFractionFunctionLayout.h"
|
||||
#import "MPFractionFunction.h"
|
||||
#import "MPRootFunctionLayout.h"
|
||||
#import "MPRootFunction.h"
|
||||
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MPPowerFunction.h"
|
||||
#import "MPFunction+MPValue.h"
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
@class MPFunctionValue, MPPowerFunction, MPValueGroup;
|
||||
|
||||
@interface MPFunctionValue : NSObject <MPValue>
|
||||
|
||||
@property (readonly, nonatomic, copy) NSString *functionName;
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
//
|
||||
|
||||
#import "MPFunctionValue.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPMathRules.h"
|
||||
|
||||
double defaultFunction(double value) {return value;};
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class MPFunctionsCollectionView;
|
||||
@class MPFunctionsViewController, MPFunctionsCollectionView;
|
||||
|
||||
@interface MPFunctionsViewController : NSViewController
|
||||
|
||||
|
||||
@@ -7,16 +7,18 @@
|
||||
//
|
||||
|
||||
#import "MPFunctionsViewController.h"
|
||||
#import "MPFunction.h"
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "NSString+MPExpressionElement.h"
|
||||
#import "MPFunction.h"
|
||||
#import "MPSumFunction.h"
|
||||
#import "MPParenthesisFunction.h"
|
||||
#import "MPPowerFunction.h"
|
||||
#import "MPFractionFunction.h"
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
@class MPFunctionTemplateItem;
|
||||
@class MPFunctionsCollectionView, MPFunctionTemplateView, MPFunctionTemplateItem;
|
||||
|
||||
@interface MPFunctionsCollectionView : NSCollectionView
|
||||
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
#import "MPExpressionStorage.h"
|
||||
#define kMPEmptyBoxWidth (self.usesSmallSize ? 2.0 : 3.0)
|
||||
#define kMPEmptyBoxHeight (CTFontGetDescent((CTFontRef)self.font) + CTFontGetAscent((CTFontRef)self.font) + CTFontGetLeading((CTFontRef)self.font))
|
||||
#define kMPEmptyBoxYOrigin (-(CTFontGetDescent((CTFontRef)self.font) + CTFontGetLeading((CTFontRef)self.font)))
|
||||
|
||||
#define kMPEmptyBoxDrawingWidth kMPEmptyBoxWidth
|
||||
#define kMPEmptyBoxDrawingHeight (CTFontGetDescent((CTFontRef)self.font) + CTFontGetAscent((CTFontRef)self.font))
|
||||
#define kMPEmptyBoxDrawingYOrigin (-(CTFontGetDescent((CTFontRef)self.font) + CTFontGetLeading((CTFontRef)self.font)/2))
|
||||
|
||||
@class MPLayout, MPRangePath;
|
||||
|
||||
@interface MPLayout : NSObject
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
//
|
||||
|
||||
#import "MPLayout.h"
|
||||
#import "MPRangePath.h"
|
||||
|
||||
#import "MPRangePath.h"
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
@interface MPLayout ()
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
FOUNDATION_EXPORT NSString *MPMathRulesMaximumOperatorChainLengthKey;
|
||||
FOUNDATION_EXPORT NSString *MPMathRulesMaximumOperatorChainLengthInMultiplicationKey;
|
||||
FOUNDATION_EXPORT NSString *MPMathRulesIsUsingDegreesKey;
|
||||
|
||||
@class MPMathRules;
|
||||
|
||||
@interface MPMathRules : NSObject
|
||||
|
||||
+ (MPMathRules *)sharedRules;
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
@class MPNumber;
|
||||
|
||||
@interface MPNumber : NSObject <MPValue>
|
||||
|
||||
@property (readonly, nonatomic, strong) NSDecimalNumber *number;
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "MPNumber.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
@implementation MPNumber
|
||||
|
||||
- (instancetype)init
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MPExpressionTreeElement.h"
|
||||
|
||||
@class MPOperatorChain;
|
||||
|
||||
@interface MPOperatorChain : NSObject <MPExpressionTreeElement>
|
||||
|
||||
@property (readonly, nonatomic) BOOL negating;
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "MPOperatorChain.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
@implementation MPOperatorChain
|
||||
|
||||
- (id)init
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <MathKit/MathKit.h>
|
||||
#import "MPFunction.h"
|
||||
|
||||
@class MPParenthesisFunction, MPExpression;
|
||||
|
||||
@interface MPParenthesisFunction : MPFunction
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#import "MPParenthesisFunction.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPExpressionTree.h"
|
||||
|
||||
@implementation MPParenthesisFunction
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
//
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
#import "MPParenthesisFunction.h"
|
||||
|
||||
@class MPParenthesisFunctionLayout, MPParenthesisFunction;
|
||||
|
||||
@interface MPParenthesisFunctionLayout : MPFunctionLayout
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "MPParenthesisFunctionLayout.h"
|
||||
|
||||
#import "MPParenthesisFunction.h"
|
||||
|
||||
#define MPParenthesisFunctionOpeningParensOffset 2
|
||||
#define MPParenthesisFunctionClosingParensOffset 0
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <MathKit/MathKit.h>
|
||||
#import "MPSuffixFunction.h"
|
||||
|
||||
@class MPPowerFunction, MPExpression;
|
||||
|
||||
@interface MPPowerFunction : MPSuffixFunction
|
||||
|
||||
@property (nonatomic, strong) MPExpression *exponentExpression;
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
//
|
||||
|
||||
#import "MPPowerFunction.h"
|
||||
#import "MPExpression.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPExpressionTree.h"
|
||||
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
@implementation MPPowerFunction
|
||||
|
||||
MPFunctionAccessorImplementation(ExponentExpression, _exponentExpression)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
|
||||
#import "MPPowerFunction.h"
|
||||
@class MPPowerFunctionLayout, MPPowerFunction;
|
||||
|
||||
@interface MPPowerFunctionLayout : MPFunctionLayout
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
//
|
||||
|
||||
#import "MPPowerFunctionLayout.h"
|
||||
#import "MPExpressionLayout.h"
|
||||
|
||||
#import "MPPowerFunction.h"
|
||||
|
||||
#define kPowerFunctionExponentXOffset 1
|
||||
#define kPowerFunctionTrailingOffset 2
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPExpressionTreeElement.h"
|
||||
#import "MPFactor.h"
|
||||
|
||||
@class MPProduct;
|
||||
|
||||
@interface MPProduct : NSObject <MPExpressionTreeElement>
|
||||
|
||||
|
||||
@@ -7,8 +7,15 @@
|
||||
//
|
||||
|
||||
#import "MPProduct.h"
|
||||
|
||||
#import "MPFactor.h"
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
|
||||
@implementation MPProduct {
|
||||
NSMutableArray *_factors;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
|
||||
#import "MPExpression.h"
|
||||
|
||||
#define MPMakeRangePath(loc, len) [MPRangePath rangePathWithLocation:(loc) length:(len)]
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
|
||||
#import "MPRangePath.h"
|
||||
#import "MPExpression.h"
|
||||
|
||||
@implementation MPRangePath
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <MathKit/MathKit.h>
|
||||
#import "MPFunction.h"
|
||||
|
||||
@class MPRootFunction, MPExpression;
|
||||
|
||||
@interface MPRootFunction : MPFunction
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#import "MPRootFunction.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPExpressionTree.h"
|
||||
|
||||
@implementation MPRootFunction
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
//
|
||||
|
||||
#import "MPFunctionLayout.h"
|
||||
#import "MPRootFunction.h"
|
||||
|
||||
@class MPRootFunctionLayout, MPRootFunction;
|
||||
|
||||
@interface MPRootFunctionLayout : MPFunctionLayout
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "MPRootFunctionLayout.h"
|
||||
|
||||
#import "MPRootFunction.h"
|
||||
|
||||
#define kRootFunctionSpaceBetweenRadicantAndExponent 5
|
||||
|
||||
@implementation MPRootFunctionLayout
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <MathKit/MathKit.h>
|
||||
#import "MPFunction.h"
|
||||
|
||||
#import "MPValueGroup.h"
|
||||
@class MPSuffixFunction;
|
||||
@protocol MPValue;
|
||||
|
||||
@interface MPSuffixFunction : MPFunction
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import "MPFunction.h"
|
||||
|
||||
@class MPSumFunction, MPExpression;
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
//
|
||||
|
||||
#import "MPSumFunction.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
|
||||
#import "MPEvaluationContext.h"
|
||||
|
||||
#import "MPExpressionTree.h"
|
||||
#import "MPEvaluationContext.h"
|
||||
|
||||
@implementation MPSumFunction
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
#import "MPSumFunctionLayout.h"
|
||||
|
||||
#import "MPSumFunction.h"
|
||||
|
||||
#import "NSIndexPath+MPAdditions.h"
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPExpressionTreeElement.h"
|
||||
#import "MPProduct.h"
|
||||
#import "MPOperatorChain.h"
|
||||
|
||||
@class MPSummand, MPOperatorChain, MPProduct;
|
||||
|
||||
@interface MPSummand : NSObject <MPExpressionTreeElement>
|
||||
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
//
|
||||
|
||||
#import "MPSummand.h"
|
||||
|
||||
#import "MPOperatorChain.h"
|
||||
#import "MPProduct.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPMathRules.h"
|
||||
|
||||
@implementation MPSummand
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
@class MPToken;
|
||||
@protocol MPToken;
|
||||
|
||||
typedef NS_ENUM(NSUInteger, MPTokenType) {
|
||||
MPEOFToken = 0,
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPToken.h"
|
||||
@class MPTokenStream;
|
||||
@protocol MPToken;
|
||||
|
||||
@interface MPTokenStream : NSObject
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
- (BOOL)hasMoreTokens;
|
||||
|
||||
- (MPToken *)currentToken;
|
||||
- (MPToken *)peekNextToken;
|
||||
- (id<MPToken>)currentToken;
|
||||
- (id<MPToken>)peekNextToken;
|
||||
- (void)currentTokenConsumed;
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
|
||||
#import "MPToken.h"
|
||||
|
||||
@implementation MPTokenStream {
|
||||
NSUInteger _currentTokenIndex;
|
||||
NSUInteger eofLocation;
|
||||
@@ -86,7 +88,7 @@
|
||||
return _currentTokenIndex < self.tokens.count;
|
||||
}
|
||||
|
||||
- (MPToken *)currentToken
|
||||
- (id<MPToken>)currentToken
|
||||
{
|
||||
[self skipWhitespaces];
|
||||
if (_currentTokenIndex >= _tokens.count) {
|
||||
@@ -95,11 +97,11 @@
|
||||
return _tokens[_currentTokenIndex];
|
||||
}
|
||||
|
||||
- (MPToken *)peekNextToken
|
||||
- (id<MPToken>)peekNextToken
|
||||
{
|
||||
NSUInteger currentTokenIndex = _currentTokenIndex;
|
||||
[self currentTokenConsumed]; // Pretend the current token has been consumed
|
||||
MPToken *token = [self currentToken];
|
||||
id<MPToken> token = [self currentToken];
|
||||
_currentTokenIndex = currentTokenIndex; // Undo the lookahead
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
@class MPUnexpectedSymbolValue;
|
||||
|
||||
@interface MPUnexpectedSymbolValue : NSObject <MPValue>
|
||||
|
||||
@property (readonly, nonatomic, copy) NSString *symbol;
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
|
||||
#import "MPUnexpectedSymbolValue.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
|
||||
@implementation MPUnexpectedSymbolValue
|
||||
|
||||
- (instancetype)init
|
||||
|
||||
@@ -6,8 +6,11 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPExpressionTreeElement.h"
|
||||
#import "MPTokenStream.h"
|
||||
|
||||
@class MPValueGroup;
|
||||
@protocol MPValue;
|
||||
|
||||
@protocol MPValue <MPExpressionTreeElement>
|
||||
|
||||
|
||||
@@ -7,12 +7,17 @@
|
||||
//
|
||||
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
#import "MPNumber.h"
|
||||
#import "MPVariable.h"
|
||||
#import "MPFunction+MPValue.h"
|
||||
#import "MPUnexpectedSymbolValue.h"
|
||||
#import "MPFunctionValue.h"
|
||||
#import "MPUnexpectedSymbolValue.h"
|
||||
#import "MPFactorial.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPSuffixFunction.h"
|
||||
|
||||
@implementation MPValueGroup {
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MPValueGroup.h"
|
||||
|
||||
@class MPVariable;
|
||||
|
||||
@interface MPVariable : NSObject <MPValue>
|
||||
|
||||
@property (readonly, nonatomic, strong) NSString *variableName;
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
//
|
||||
|
||||
#import "MPVariable.h"
|
||||
|
||||
#import "MPTokenStream.h"
|
||||
#import "MPToken.h"
|
||||
|
||||
#import "MPExpression.h"
|
||||
#import "MPEvaluationContext.h"
|
||||
|
||||
@implementation MPVariable {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
@class MPWhiteView;
|
||||
|
||||
@interface MPWhiteView : NSView
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
|
||||
@interface NSIndexPath (MPAdditions)
|
||||
|
||||
- (NSUInteger)firstIndex;
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define MPStringRange(string) NSMakeRange(0, [string length])
|
||||
#define MPStringRangeFrom(from, string) NSMakeRange(from, [string length]-from)
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import "MPExpressionElement.h"
|
||||
|
||||
@interface NSString (MPExpressionElement) <MPExpressionElement>
|
||||
|
||||
Reference in New Issue
Block a user