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

49 lines
940 B
Objective-C

//
// MPToken.h
// MathPad
//
// Created by Kim Wittenburg on 19.09.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import <Foundation/Foundation.h>
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