Archived
1
This repository has been archived on 2022-08-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mathpad/MathPad/MPParsedElement.h
2014-09-06 01:54:15 +02:00

40 lines
1.0 KiB
Objective-C

//
// 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