Started to Implement the Parser
This commit is contained in:
39
MathPad/MPParsedElement.h
Normal file
39
MathPad/MPParsedElement.h
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// MPParsedElement.h
|
||||
// MathPad
|
||||
//
|
||||
// Created by Kim Wittenburg on 05.09.14.
|
||||
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// DEBUG STUFF
|
||||
// Simple Operator: +/-/*
|
||||
// Simple Factor: * 5.4 * / * 5,4 / 5,4 * / 5,4
|
||||
// Independant Math: -1+2-3
|
||||
|
||||
@interface MPParsedElement : NSObject <NSCopying>
|
||||
|
||||
@property (nonatomic) BOOL isFactor;
|
||||
@property (nonatomic) double factor;
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *summands;
|
||||
|
||||
@property (nonatomic) double prefixMultiplicator;
|
||||
@property (nonatomic) BOOL hasPrefixMultiplicator;
|
||||
@property (nonatomic, getter = isPrefixOperatorExplicit) BOOL prefixOperatorExplicit;
|
||||
@property (nonatomic) double suffixMultiplicator;
|
||||
@property (nonatomic) BOOL hasSuffixMultiplicator;
|
||||
|
||||
// No error checking done. The string parsed may for example end with an operator
|
||||
- (double)valueAtBeginning;
|
||||
- (double)valueAtEnd;
|
||||
- (double)standaloneValue;
|
||||
|
||||
// For error checking
|
||||
- (BOOL)isValidElementAtBeginning;
|
||||
- (BOOL)isValidElementInBetween;
|
||||
- (BOOL)isValidElementAtEnd;
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user