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/MPExpressionTreeElement.h
2014-10-13 23:53:04 +02:00

31 lines
842 B
Objective-C

//
// MPExpressionTreeElement.h
// MathPad
//
// Created by Kim Wittenburg on 09.10.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MPTokenStream.h"
#import "MPParseError.h"
#import "MPTokenStream.h"
#define MPTokenStreamRecordCurrentLocation(tokenStream) NSUInteger __tokenStreamStart = tokenStream.currentToken.range.location
#define MPTokenStreamRecordedRange(tokenStream) NSMakeRange(__tokenStreamStart, tokenStream.currentToken.range.location - __tokenStreamStart)
@protocol MPExpressionTreeElement <NSObject>
@required
- (instancetype)init;
- (instancetype)initWithTokenStream:(MPTokenStream *)tokenStream;
- (NSRange)range;
- (BOOL)validate:(MPParseError *__autoreleasing *)error;
- (NSDecimalNumber *)evaluate;
- (NSArray *)expressionElements; // Converts
@end