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.m
2014-11-10 21:45:50 +01:00

56 lines
803 B
Objective-C

//
// MPToken.m
// MathPad
//
// Created by Kim Wittenburg on 19.09.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import "MPToken.h"
@implementation MPToken {
NSRange _range;
MPTokenType _tokenType;
NSString *_stringValue;
}
- (instancetype)initWithTokenType:(MPTokenType)tokenType
range:(NSRange)range
stringValue:(NSString *)input
{
self = [super init];
if (self) {
_range = range;
_stringValue = input.copy;
_tokenType = tokenType;
}
return self;
}
- (NSRange)range
{
return _range;
}
- (MPTokenType)tokenType
{
return _tokenType;
}
- (NSString *)stringValue
{
return _stringValue;
}
- (NSString *)description
{
return self.stringValue;
}
@end