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/MPToken.h
Kim Wittenburg f4f924bd71 Cleaned Imports
2014-11-08 01:05:08 +01:00

50 lines
941 B
Objective-C

//
// MPToken.h
// MathPad
//
// Created by Kim Wittenburg on 19.09.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
@class MPToken;
@protocol MPToken;
typedef NS_ENUM(NSUInteger, MPTokenType) {
MPEOFToken = 0,
MPMultiplicationSymbolToken,
MPOperatorListToken,
MPSinToken,
MPCosToken,
MPTanToken,
MPASinToken,
MPACosToken,
MPATanToken,
MPNumberToken,
MPVariableToken,
MPFactorialToken,
MPEqualsToken,
MPGenericFunctionToken,
MPWhitespaceToken,
MPUnidentifiedToken,
};
@protocol MPToken <NSObject>
- (MPTokenType)tokenType;
- (NSRange)range;
- (NSString *)stringValue;
@end
@interface MPToken : NSObject <MPToken>
- (instancetype)initEOFTokenAtLocation:(NSUInteger)eofLocation;
- (instancetype)initWithTokenType:(MPTokenType)tokenType
range:(NSRange)range
stringValue:(NSString *)input;
@end