-
Notifications
You must be signed in to change notification settings - Fork 49
/
CPToken.h
46 lines (36 loc) · 985 Bytes
/
CPToken.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// CPToken.h
// CoreParse
//
// Created by Tom Davie on 12/02/2011.
// Copyright 2011 In The Beginning... All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* The CPToken class reperesents a token in the token stream.
*
* All tokens respond to the -name message which is used to identify the token while parsing.
*
* CPToken is an abstract class. CPTokenRegnisers should add instances of CPTokens concrete subclasses to their token stream.
*/
@interface CPToken : NSObject
/**
* The token name.
*/
@property (readonly) NSString *name;
/**
* The line on which the token can be found.
*/
@property (readwrite, assign) NSUInteger lineNumber;
/**
* The column on which the token can be found.
*/
@property (readwrite, assign) NSUInteger columnNumber;
/**
* The index in the input string of the first character in this token.
*/
@property (readwrite, assign) NSUInteger characterNumber;
@end
@interface NSObject (CPIsToken)
- (BOOL)isToken;
@end