diff --git a/MathKit/MathKit.h b/MathKit/MathKit.h index 3d7494c..c9831f9 100644 --- a/MathKit/MathKit.h +++ b/MathKit/MathKit.h @@ -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" \ No newline at end of file diff --git a/MathPad.xcodeproj/project.pbxproj b/MathPad.xcodeproj/project.pbxproj index af7869b..dafd4a9 100644 --- a/MathPad.xcodeproj/project.pbxproj +++ b/MathPad.xcodeproj/project.pbxproj @@ -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 = ""; }; - 3B0F69A819028C6000817707 /* MPException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPException.m; sourceTree = ""; }; 3B0F69AB1902A82C00817707 /* MPExpressionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPExpressionTests.m; path = ../MathPadTests/MPExpressionTests.m; sourceTree = ""; }; 3B3A4AAC19F71855001E9D54 /* MPRootFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPRootFunction.h; sourceTree = ""; }; 3B3A4AAD19F71855001E9D54 /* MPRootFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPRootFunction.m; sourceTree = ""; }; @@ -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 = ""; @@ -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 */, diff --git a/MathPad/MPEvaluationContext.h b/MathPad/MPEvaluationContext.h index 2fb4e91..82119b3 100644 --- a/MathPad/MPEvaluationContext.h +++ b/MathPad/MPEvaluationContext.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +@class MPEvaluationContext; @interface MPEvaluationContext : NSObject diff --git a/MathPad/MPException.h b/MathPad/MPException.h deleted file mode 100644 index 8e9346b..0000000 --- a/MathPad/MPException.h +++ /dev/null @@ -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 diff --git a/MathPad/MPException.m b/MathPad/MPException.m deleted file mode 100644 index 8c71821..0000000 --- a/MathPad/MPException.m +++ /dev/null @@ -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"; \ No newline at end of file diff --git a/MathPad/MPExpression.h b/MathPad/MPExpression.h index d36ef1a..564631f 100644 --- a/MathPad/MPExpression.h +++ b/MathPad/MPExpression.h @@ -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 diff --git a/MathPad/MPExpression.m b/MathPad/MPExpression.m index 5848f9f..b98c1f3 100644 --- a/MathPad/MPExpression.m +++ b/MathPad/MPExpression.m @@ -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}]; } diff --git a/MathPad/MPExpressionElement.h b/MathPad/MPExpressionElement.h index 0c5c1af..3ffac4a 100644 --- a/MathPad/MPExpressionElement.h +++ b/MathPad/MPExpressionElement.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -@import Foundation; - @protocol MPExpressionElement - (BOOL)isString; diff --git a/MathPad/MPExpressionLayout.h b/MathPad/MPExpressionLayout.h index 136b93b..8e6a267 100644 --- a/MathPad/MPExpressionLayout.h +++ b/MathPad/MPExpressionLayout.h @@ -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 diff --git a/MathPad/MPExpressionLayout.m b/MathPad/MPExpressionLayout.m index 31da0ca..ffbcaa3 100644 --- a/MathPad/MPExpressionLayout.m +++ b/MathPad/MPExpressionLayout.m @@ -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; diff --git a/MathPad/MPExpressionStorage.m b/MathPad/MPExpressionStorage.m index 4ac6403..19def01 100644 --- a/MathPad/MPExpressionStorage.m +++ b/MathPad/MPExpressionStorage.m @@ -7,9 +7,11 @@ // #import "MPExpressionStorage.h" + #import "MPExpressionView.h" +#import "MPLayout.h" #import "MPExpressionLayout.h" -#import "MPFunctionLayout.h" + #import "MPRangePath.h" @interface MPExpressionStorage () diff --git a/MathPad/MPExpressionTokenizer.h b/MathPad/MPExpressionTokenizer.h index e0e3333..0cb064f 100644 --- a/MathPad/MPExpressionTokenizer.h +++ b/MathPad/MPExpressionTokenizer.h @@ -6,8 +6,7 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import -#import "MPExpression.h" +@class MPExpressionTokenizer, MPExpression; @interface MPExpressionTokenizer : NSObject diff --git a/MathPad/MPExpressionTokenizer.m b/MathPad/MPExpressionTokenizer.m index 39ad08f..b383f95 100644 --- a/MathPad/MPExpressionTokenizer.m +++ b/MathPad/MPExpressionTokenizer.m @@ -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 diff --git a/MathPad/MPExpressionTree.h b/MathPad/MPExpressionTree.h index 9f011fa..790f76b 100644 --- a/MathPad/MPExpressionTree.h +++ b/MathPad/MPExpressionTree.h @@ -6,10 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import -#import "MPSummand.h" #import "MPExpressionTreeElement.h" +@class MPExpressionTree; + @interface MPExpressionTree : NSObject @property (nonatomic, copy) NSString *definedVariable; diff --git a/MathPad/MPExpressionTree.m b/MathPad/MPExpressionTree.m index fc458ac..f7bf903 100644 --- a/MathPad/MPExpressionTree.m +++ b/MathPad/MPExpressionTree.m @@ -8,6 +8,13 @@ #import "MPExpressionTree.h" +#import "MPSummand.h" + +#import "MPTokenStream.h" +#import "MPToken.h" + +#import "MPExpression.h" + @implementation MPExpressionTree { NSMutableArray *_summands; } diff --git a/MathPad/MPExpressionTreeElement.h b/MathPad/MPExpressionTreeElement.h index 8f8b73a..c958f80 100644 --- a/MathPad/MPExpressionTreeElement.h +++ b/MathPad/MPExpressionTreeElement.h @@ -6,9 +6,7 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import -#import "MPTokenStream.h" -#import "MPExpression.h" +@class MPTokenStream; @protocol MPExpressionTreeElement @required diff --git a/MathPad/MPExpressionView.h b/MathPad/MPExpressionView.h index 802ea1a..06c6fa9 100644 --- a/MathPad/MPExpressionView.h +++ b/MathPad/MPExpressionView.h @@ -8,8 +8,6 @@ // TODO: Undo/Redo + Delegate -#import - @class MPExpressionView, MPExpressionStorage, MPExpressionLayout, MPRangePath; @interface MPExpressionView : NSView diff --git a/MathPad/MPExpressionView.m b/MathPad/MPExpressionView.m index 3111f42..5edcd89 100644 --- a/MathPad/MPExpressionView.m +++ b/MathPad/MPExpressionView.m @@ -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 () diff --git a/MathPad/MPFactor.h b/MathPad/MPFactor.h index a471bba..ad016d3 100644 --- a/MathPad/MPFactor.h +++ b/MathPad/MPFactor.h @@ -6,10 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPExpressionTreeElement.h" -#import "MPValueGroup.h" -#import "MPOperatorChain.h" + +@class MPFactor, MPOperatorChain; +@protocol MPValue; @interface MPFactor : NSObject diff --git a/MathPad/MPFactor.m b/MathPad/MPFactor.m index a9c9cec..cca7b37 100644 --- a/MathPad/MPFactor.m +++ b/MathPad/MPFactor.m @@ -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 { diff --git a/MathPad/MPFactorial.h b/MathPad/MPFactorial.h index 795ae6c..6892404 100644 --- a/MathPad/MPFactorial.h +++ b/MathPad/MPFactorial.h @@ -6,9 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPValueGroup.h" +@class MPFactorial; + @interface MPFactorial : NSObject @property (readonly, nonatomic, strong) id value; diff --git a/MathPad/MPFactorial.m b/MathPad/MPFactorial.m index c06f1ad..dbae67c 100644 --- a/MathPad/MPFactorial.m +++ b/MathPad/MPFactorial.m @@ -8,6 +8,9 @@ #import "MPFactorial.h" +#import "MPTokenStream.h" +#import "MPToken.h" + @implementation MPFactorial - (instancetype)init diff --git a/MathPad/MPFractionFunction.h b/MathPad/MPFractionFunction.h index bfee7ed..3b9a3ba 100644 --- a/MathPad/MPFractionFunction.h +++ b/MathPad/MPFractionFunction.h @@ -6,7 +6,9 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +#import "MPFunction.h" + +@class MPFractionFunction, MPExpression; @interface MPFractionFunction : MPFunction diff --git a/MathPad/MPFractionFunction.m b/MathPad/MPFractionFunction.m index 2028e86..73d53e1 100644 --- a/MathPad/MPFractionFunction.m +++ b/MathPad/MPFractionFunction.m @@ -8,6 +8,7 @@ #import "MPFractionFunction.h" +#import "MPExpression.h" #import "MPExpressionTree.h" @implementation MPFractionFunction diff --git a/MathPad/MPFractionFunctionLayout.h b/MathPad/MPFractionFunctionLayout.h index d35d134..c71597f 100644 --- a/MathPad/MPFractionFunctionLayout.h +++ b/MathPad/MPFractionFunctionLayout.h @@ -7,7 +7,8 @@ // #import "MPFunctionLayout.h" -#import "MPFractionFunction.h" + +@class MPFractionFunctionLayout, MPFractionFunction; @interface MPFractionFunctionLayout : MPFunctionLayout diff --git a/MathPad/MPFractionFunctionLayout.m b/MathPad/MPFractionFunctionLayout.m index 169fa3f..11cafdd 100644 --- a/MathPad/MPFractionFunctionLayout.m +++ b/MathPad/MPFractionFunctionLayout.m @@ -7,7 +7,8 @@ // #import "MPFractionFunctionLayout.h" -#import "MPExpressionLayout.h" + +#import "MPFractionFunction.h" #define kFractionFunctionLineWidth 1.0 #define kFractionFunctionHorizontalInset 2.0 diff --git a/MathPad/MPFunction+MPToken.h b/MathPad/MPFunction+MPToken.h index 44e45fc..9265abc 100644 --- a/MathPad/MPFunction+MPToken.h +++ b/MathPad/MPFunction+MPToken.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +#import "MPFunction.h" #import "MPToken.h" @interface MPFunction (MPToken) diff --git a/MathPad/MPFunction+MPToken.m b/MathPad/MPFunction+MPToken.m index eb708f0..27f249a 100644 --- a/MathPad/MPFunction+MPToken.m +++ b/MathPad/MPFunction+MPToken.m @@ -8,6 +8,8 @@ #import "MPFunction+MPToken.h" +#import "MPExpression.h" + @implementation MPFunction (MPToken) - (MPTokenType)tokenType diff --git a/MathPad/MPFunction+MPValue.h b/MathPad/MPFunction+MPValue.h index d2e2b07..5e6d9fe 100644 --- a/MathPad/MPFunction+MPValue.h +++ b/MathPad/MPFunction+MPValue.h @@ -6,9 +6,8 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +#import "MPFunction.h" #import "MPValueGroup.h" -#import "MPFunction+MPToken.h" @interface MPFunction (MPValue) diff --git a/MathPad/MPFunction+MPValue.m b/MathPad/MPFunction+MPValue.m index 09ba9d3..87bf0ab 100644 --- a/MathPad/MPFunction+MPValue.m +++ b/MathPad/MPFunction+MPValue.m @@ -8,6 +8,8 @@ #import "MPFunction+MPValue.h" +#import "MPFunction+MPToken.h" + @implementation MPFunction (MPValue) - (instancetype)initWithTokenStream:(MPTokenStream *)tokenStream diff --git a/MathPad/MPFunction.h b/MathPad/MPFunction.h index dd29a18..92d3b94 100644 --- a/MathPad/MPFunction.h +++ b/MathPad/MPFunction.h @@ -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 diff --git a/MathPad/MPFunction.m b/MathPad/MPFunction.m index 61f4176..b3e37e4 100644 --- a/MathPad/MPFunction.m +++ b/MathPad/MPFunction.m @@ -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 { diff --git a/MathPad/MPFunctionLayout.h b/MathPad/MPFunctionLayout.h index 5698448..8b2927a 100644 --- a/MathPad/MPFunctionLayout.h +++ b/MathPad/MPFunctionLayout.h @@ -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 diff --git a/MathPad/MPFunctionLayout.m b/MathPad/MPFunctionLayout.m index 796dfb0..c27cf4b 100644 --- a/MathPad/MPFunctionLayout.m +++ b/MathPad/MPFunctionLayout.m @@ -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" diff --git a/MathPad/MPFunctionValue.h b/MathPad/MPFunctionValue.h index fef3a9a..8728d62 100644 --- a/MathPad/MPFunctionValue.h +++ b/MathPad/MPFunctionValue.h @@ -6,11 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import -#import "MPPowerFunction.h" -#import "MPFunction+MPValue.h" #import "MPValueGroup.h" +@class MPFunctionValue, MPPowerFunction, MPValueGroup; + @interface MPFunctionValue : NSObject @property (readonly, nonatomic, copy) NSString *functionName; diff --git a/MathPad/MPFunctionValue.m b/MathPad/MPFunctionValue.m index 5cc58e1..b0853dc 100644 --- a/MathPad/MPFunctionValue.m +++ b/MathPad/MPFunctionValue.m @@ -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;}; diff --git a/MathPad/MPFunctionsViewController.h b/MathPad/MPFunctionsViewController.h index a72c1a2..490c785 100644 --- a/MathPad/MPFunctionsViewController.h +++ b/MathPad/MPFunctionsViewController.h @@ -6,9 +6,7 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import - -@class MPFunctionsCollectionView; +@class MPFunctionsViewController, MPFunctionsCollectionView; @interface MPFunctionsViewController : NSViewController diff --git a/MathPad/MPFunctionsViewController.m b/MathPad/MPFunctionsViewController.m index bd8da4c..0b21c93 100644 --- a/MathPad/MPFunctionsViewController.m +++ b/MathPad/MPFunctionsViewController.m @@ -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 diff --git a/MathPad/MPLayout.h b/MathPad/MPLayout.h index 04486f9..0904be2 100644 --- a/MathPad/MPLayout.h +++ b/MathPad/MPLayout.h @@ -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 diff --git a/MathPad/MPLayout.m b/MathPad/MPLayout.m index 27612f4..59d468a 100644 --- a/MathPad/MPLayout.m +++ b/MathPad/MPLayout.m @@ -7,8 +7,8 @@ // #import "MPLayout.h" -#import "MPRangePath.h" +#import "MPRangePath.h" #import "NSIndexPath+MPAdditions.h" @interface MPLayout () diff --git a/MathPad/MPMathRules.h b/MathPad/MPMathRules.h index d14010e..0f9b0b0 100644 --- a/MathPad/MPMathRules.h +++ b/MathPad/MPMathRules.h @@ -6,12 +6,12 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import - FOUNDATION_EXPORT NSString *MPMathRulesMaximumOperatorChainLengthKey; FOUNDATION_EXPORT NSString *MPMathRulesMaximumOperatorChainLengthInMultiplicationKey; FOUNDATION_EXPORT NSString *MPMathRulesIsUsingDegreesKey; +@class MPMathRules; + @interface MPMathRules : NSObject + (MPMathRules *)sharedRules; diff --git a/MathPad/MPNumber.h b/MathPad/MPNumber.h index d7fbf08..cfb1805 100644 --- a/MathPad/MPNumber.h +++ b/MathPad/MPNumber.h @@ -6,9 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPValueGroup.h" +@class MPNumber; + @interface MPNumber : NSObject @property (readonly, nonatomic, strong) NSDecimalNumber *number; diff --git a/MathPad/MPNumber.m b/MathPad/MPNumber.m index 53dffdb..d9c787b 100644 --- a/MathPad/MPNumber.m +++ b/MathPad/MPNumber.m @@ -8,6 +8,9 @@ #import "MPNumber.h" +#import "MPTokenStream.h" +#import "MPToken.h" + @implementation MPNumber - (instancetype)init diff --git a/MathPad/MPOperatorChain.h b/MathPad/MPOperatorChain.h index d3ee31d..1e911ca 100644 --- a/MathPad/MPOperatorChain.h +++ b/MathPad/MPOperatorChain.h @@ -6,9 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPExpressionTreeElement.h" +@class MPOperatorChain; + @interface MPOperatorChain : NSObject @property (readonly, nonatomic) BOOL negating; diff --git a/MathPad/MPOperatorChain.m b/MathPad/MPOperatorChain.m index 69e89c4..b52209e 100644 --- a/MathPad/MPOperatorChain.m +++ b/MathPad/MPOperatorChain.m @@ -8,6 +8,9 @@ #import "MPOperatorChain.h" +#import "MPTokenStream.h" +#import "MPToken.h" + @implementation MPOperatorChain - (id)init diff --git a/MathPad/MPParenthesisFunction.h b/MathPad/MPParenthesisFunction.h index 31dcfae..0c82fe2 100644 --- a/MathPad/MPParenthesisFunction.h +++ b/MathPad/MPParenthesisFunction.h @@ -6,7 +6,9 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +#import "MPFunction.h" + +@class MPParenthesisFunction, MPExpression; @interface MPParenthesisFunction : MPFunction diff --git a/MathPad/MPParenthesisFunction.m b/MathPad/MPParenthesisFunction.m index 149883b..4d138ce 100644 --- a/MathPad/MPParenthesisFunction.m +++ b/MathPad/MPParenthesisFunction.m @@ -9,6 +9,7 @@ #import "MPParenthesisFunction.h" +#import "MPExpression.h" #import "MPExpressionTree.h" @implementation MPParenthesisFunction diff --git a/MathPad/MPParenthesisFunctionLayout.h b/MathPad/MPParenthesisFunctionLayout.h index f5ba164..a1b6037 100644 --- a/MathPad/MPParenthesisFunctionLayout.h +++ b/MathPad/MPParenthesisFunctionLayout.h @@ -7,7 +7,8 @@ // #import "MPFunctionLayout.h" -#import "MPParenthesisFunction.h" + +@class MPParenthesisFunctionLayout, MPParenthesisFunction; @interface MPParenthesisFunctionLayout : MPFunctionLayout diff --git a/MathPad/MPParenthesisFunctionLayout.m b/MathPad/MPParenthesisFunctionLayout.m index 2b324eb..00f83f7 100644 --- a/MathPad/MPParenthesisFunctionLayout.m +++ b/MathPad/MPParenthesisFunctionLayout.m @@ -8,6 +8,8 @@ #import "MPParenthesisFunctionLayout.h" +#import "MPParenthesisFunction.h" + #define MPParenthesisFunctionOpeningParensOffset 2 #define MPParenthesisFunctionClosingParensOffset 0 diff --git a/MathPad/MPPowerFunction.h b/MathPad/MPPowerFunction.h index 0ae7c2f..e69aee3 100644 --- a/MathPad/MPPowerFunction.h +++ b/MathPad/MPPowerFunction.h @@ -6,9 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPSuffixFunction.h" +@class MPPowerFunction, MPExpression; + @interface MPPowerFunction : MPSuffixFunction @property (nonatomic, strong) MPExpression *exponentExpression; diff --git a/MathPad/MPPowerFunction.m b/MathPad/MPPowerFunction.m index 0b4142c..742049a 100644 --- a/MathPad/MPPowerFunction.m +++ b/MathPad/MPPowerFunction.m @@ -7,10 +7,12 @@ // #import "MPPowerFunction.h" -#import "MPExpression.h" +#import "MPExpression.h" #import "MPExpressionTree.h" +#import "MPValueGroup.h" + @implementation MPPowerFunction MPFunctionAccessorImplementation(ExponentExpression, _exponentExpression) diff --git a/MathPad/MPPowerFunctionLayout.h b/MathPad/MPPowerFunctionLayout.h index 9aeced3..9d12caa 100644 --- a/MathPad/MPPowerFunctionLayout.h +++ b/MathPad/MPPowerFunctionLayout.h @@ -8,7 +8,7 @@ #import "MPFunctionLayout.h" -#import "MPPowerFunction.h" +@class MPPowerFunctionLayout, MPPowerFunction; @interface MPPowerFunctionLayout : MPFunctionLayout diff --git a/MathPad/MPPowerFunctionLayout.m b/MathPad/MPPowerFunctionLayout.m index 506f3cd..ca5ed13 100644 --- a/MathPad/MPPowerFunctionLayout.m +++ b/MathPad/MPPowerFunctionLayout.m @@ -7,7 +7,8 @@ // #import "MPPowerFunctionLayout.h" -#import "MPExpressionLayout.h" + +#import "MPPowerFunction.h" #define kPowerFunctionExponentXOffset 1 #define kPowerFunctionTrailingOffset 2 diff --git a/MathPad/MPProduct.h b/MathPad/MPProduct.h index b195d61..c43e029 100644 --- a/MathPad/MPProduct.h +++ b/MathPad/MPProduct.h @@ -6,9 +6,9 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPExpressionTreeElement.h" -#import "MPFactor.h" + +@class MPProduct; @interface MPProduct : NSObject diff --git a/MathPad/MPProduct.m b/MathPad/MPProduct.m index 365024b..2d7ffe8 100644 --- a/MathPad/MPProduct.m +++ b/MathPad/MPProduct.m @@ -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; } diff --git a/MathPad/MPRangePath.h b/MathPad/MPRangePath.h index 0674a9c..05ee62d 100644 --- a/MathPad/MPRangePath.h +++ b/MathPad/MPRangePath.h @@ -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)] diff --git a/MathPad/MPRangePath.m b/MathPad/MPRangePath.m index c2c46a2..be6eba0 100644 --- a/MathPad/MPRangePath.m +++ b/MathPad/MPRangePath.m @@ -7,7 +7,6 @@ // #import "MPRangePath.h" -#import "MPExpression.h" @implementation MPRangePath diff --git a/MathPad/MPRootFunction.h b/MathPad/MPRootFunction.h index 30fac2c..f932029 100644 --- a/MathPad/MPRootFunction.h +++ b/MathPad/MPRootFunction.h @@ -6,7 +6,9 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +#import "MPFunction.h" + +@class MPRootFunction, MPExpression; @interface MPRootFunction : MPFunction diff --git a/MathPad/MPRootFunction.m b/MathPad/MPRootFunction.m index 89924af..3d4db2b 100644 --- a/MathPad/MPRootFunction.m +++ b/MathPad/MPRootFunction.m @@ -8,6 +8,7 @@ #import "MPRootFunction.h" +#import "MPExpression.h" #import "MPExpressionTree.h" @implementation MPRootFunction diff --git a/MathPad/MPRootFunctionLayout.h b/MathPad/MPRootFunctionLayout.h index 4f95328..5e8fef8 100644 --- a/MathPad/MPRootFunctionLayout.h +++ b/MathPad/MPRootFunctionLayout.h @@ -7,7 +7,8 @@ // #import "MPFunctionLayout.h" -#import "MPRootFunction.h" + +@class MPRootFunctionLayout, MPRootFunction; @interface MPRootFunctionLayout : MPFunctionLayout diff --git a/MathPad/MPRootFunctionLayout.m b/MathPad/MPRootFunctionLayout.m index 0bb20a9..48941fd 100644 --- a/MathPad/MPRootFunctionLayout.m +++ b/MathPad/MPRootFunctionLayout.m @@ -8,6 +8,8 @@ #import "MPRootFunctionLayout.h" +#import "MPRootFunction.h" + #define kRootFunctionSpaceBetweenRadicantAndExponent 5 @implementation MPRootFunctionLayout diff --git a/MathPad/MPSuffixFunction.h b/MathPad/MPSuffixFunction.h index 2ae51e1..be3d9cc 100644 --- a/MathPad/MPSuffixFunction.h +++ b/MathPad/MPSuffixFunction.h @@ -6,9 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +#import "MPFunction.h" -#import "MPValueGroup.h" +@class MPSuffixFunction; +@protocol MPValue; @interface MPSuffixFunction : MPFunction diff --git a/MathPad/MPSumFunction.h b/MathPad/MPSumFunction.h index 03a165c..dcbeb0b 100644 --- a/MathPad/MPSumFunction.h +++ b/MathPad/MPSumFunction.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -@import Foundation; #import "MPFunction.h" @class MPSumFunction, MPExpression; diff --git a/MathPad/MPSumFunction.m b/MathPad/MPSumFunction.m index b504161..29008f4 100644 --- a/MathPad/MPSumFunction.m +++ b/MathPad/MPSumFunction.m @@ -7,11 +7,10 @@ // #import "MPSumFunction.h" + #import "MPExpression.h" - -#import "MPEvaluationContext.h" - #import "MPExpressionTree.h" +#import "MPEvaluationContext.h" @implementation MPSumFunction diff --git a/MathPad/MPSumFunctionLayout.m b/MathPad/MPSumFunctionLayout.m index c59fee6..b855c7a 100644 --- a/MathPad/MPSumFunctionLayout.m +++ b/MathPad/MPSumFunctionLayout.m @@ -7,6 +7,7 @@ // #import "MPSumFunctionLayout.h" + #import "MPSumFunction.h" #import "NSIndexPath+MPAdditions.h" diff --git a/MathPad/MPSummand.h b/MathPad/MPSummand.h index 3088aa1..e46fbcb 100644 --- a/MathPad/MPSummand.h +++ b/MathPad/MPSummand.h @@ -6,10 +6,9 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPExpressionTreeElement.h" -#import "MPProduct.h" -#import "MPOperatorChain.h" + +@class MPSummand, MPOperatorChain, MPProduct; @interface MPSummand : NSObject diff --git a/MathPad/MPSummand.m b/MathPad/MPSummand.m index 152972b..eb3126a 100644 --- a/MathPad/MPSummand.m +++ b/MathPad/MPSummand.m @@ -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 diff --git a/MathPad/MPToken.h b/MathPad/MPToken.h index 58132d8..067d1d7 100644 --- a/MathPad/MPToken.h +++ b/MathPad/MPToken.h @@ -6,7 +6,8 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +@class MPToken; +@protocol MPToken; typedef NS_ENUM(NSUInteger, MPTokenType) { MPEOFToken = 0, diff --git a/MathPad/MPTokenStream.h b/MathPad/MPTokenStream.h index 3a06005..a65965c 100644 --- a/MathPad/MPTokenStream.h +++ b/MathPad/MPTokenStream.h @@ -6,8 +6,8 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import -#import "MPToken.h" +@class MPTokenStream; +@protocol MPToken; @interface MPTokenStream : NSObject @@ -21,8 +21,8 @@ - (BOOL)hasMoreTokens; -- (MPToken *)currentToken; -- (MPToken *)peekNextToken; +- (id)currentToken; +- (id)peekNextToken; - (void)currentTokenConsumed; @end diff --git a/MathPad/MPTokenStream.m b/MathPad/MPTokenStream.m index af71ff0..e7f3249 100644 --- a/MathPad/MPTokenStream.m +++ b/MathPad/MPTokenStream.m @@ -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)currentToken { [self skipWhitespaces]; if (_currentTokenIndex >= _tokens.count) { @@ -95,11 +97,11 @@ return _tokens[_currentTokenIndex]; } -- (MPToken *)peekNextToken +- (id)peekNextToken { NSUInteger currentTokenIndex = _currentTokenIndex; [self currentTokenConsumed]; // Pretend the current token has been consumed - MPToken *token = [self currentToken]; + id token = [self currentToken]; _currentTokenIndex = currentTokenIndex; // Undo the lookahead return token; } diff --git a/MathPad/MPUnexpectedSymbolValue.h b/MathPad/MPUnexpectedSymbolValue.h index ee54543..708178e 100644 --- a/MathPad/MPUnexpectedSymbolValue.h +++ b/MathPad/MPUnexpectedSymbolValue.h @@ -6,9 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPValueGroup.h" +@class MPUnexpectedSymbolValue; + @interface MPUnexpectedSymbolValue : NSObject @property (readonly, nonatomic, copy) NSString *symbol; diff --git a/MathPad/MPUnexpectedSymbolValue.m b/MathPad/MPUnexpectedSymbolValue.m index ccd8dd3..87ae1ce 100644 --- a/MathPad/MPUnexpectedSymbolValue.m +++ b/MathPad/MPUnexpectedSymbolValue.m @@ -8,6 +8,11 @@ #import "MPUnexpectedSymbolValue.h" +#import "MPTokenStream.h" +#import "MPToken.h" + +#import "MPExpression.h" + @implementation MPUnexpectedSymbolValue - (instancetype)init diff --git a/MathPad/MPValueGroup.h b/MathPad/MPValueGroup.h index 840bc33..2dcabfb 100644 --- a/MathPad/MPValueGroup.h +++ b/MathPad/MPValueGroup.h @@ -6,8 +6,11 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPExpressionTreeElement.h" +#import "MPTokenStream.h" + +@class MPValueGroup; +@protocol MPValue; @protocol MPValue diff --git a/MathPad/MPValueGroup.m b/MathPad/MPValueGroup.m index d3fc944..40b2379 100644 --- a/MathPad/MPValueGroup.m +++ b/MathPad/MPValueGroup.m @@ -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 { diff --git a/MathPad/MPVariable.h b/MathPad/MPVariable.h index 8d0bba4..bb801d3 100644 --- a/MathPad/MPVariable.h +++ b/MathPad/MPVariable.h @@ -6,9 +6,10 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import #import "MPValueGroup.h" +@class MPVariable; + @interface MPVariable : NSObject @property (readonly, nonatomic, strong) NSString *variableName; diff --git a/MathPad/MPVariable.m b/MathPad/MPVariable.m index eb7ebfd..594002d 100644 --- a/MathPad/MPVariable.m +++ b/MathPad/MPVariable.m @@ -7,6 +7,11 @@ // #import "MPVariable.h" + +#import "MPTokenStream.h" +#import "MPToken.h" + +#import "MPExpression.h" #import "MPEvaluationContext.h" @implementation MPVariable { diff --git a/MathPad/MPWhiteView.h b/MathPad/MPWhiteView.h index 01c3d4a..a0b5457 100644 --- a/MathPad/MPWhiteView.h +++ b/MathPad/MPWhiteView.h @@ -6,7 +6,7 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import +@class MPWhiteView; @interface MPWhiteView : NSView diff --git a/MathPad/NSIndexPath+MPAdditions.h b/MathPad/NSIndexPath+MPAdditions.h index f40ab5d..1e0e21c 100644 --- a/MathPad/NSIndexPath+MPAdditions.h +++ b/MathPad/NSIndexPath+MPAdditions.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -@import Foundation; - @interface NSIndexPath (MPAdditions) - (NSUInteger)firstIndex; diff --git a/MathPad/NSRegularExpression+MPParsingAdditions.h b/MathPad/NSRegularExpression+MPParsingAdditions.h index 58f4c18..bb98bb3 100644 --- a/MathPad/NSRegularExpression+MPParsingAdditions.h +++ b/MathPad/NSRegularExpression+MPParsingAdditions.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -#import - #define MPStringRange(string) NSMakeRange(0, [string length]) #define MPStringRangeFrom(from, string) NSMakeRange(from, [string length]-from) diff --git a/MathPad/NSString+MPExpressionElement.h b/MathPad/NSString+MPExpressionElement.h index 59a0cdf..96d138b 100644 --- a/MathPad/NSString+MPExpressionElement.h +++ b/MathPad/NSString+MPExpressionElement.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // -@import Foundation; #import "MPExpressionElement.h" @interface NSString (MPExpressionElement)