-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSTSymbol.h
68 lines (50 loc) · 1.66 KB
/
STSymbol.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// STSymbol.h
// stein
//
// Created by Kevin MacWhinnie on 2009/12/11.
// Copyright 2009 Stein Language. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef STSymbol_h
#define STSymbol_h 1
@class STSymbol;
@class STCreationLocation;
///Look up a symbol in the process-wide symbol cache.
ST_EXTERN STSymbol *STSymbolCachedSymbolWithName(NSString *name);
#define ST_SYM(string) STSymbolCachedSymbolWithName(string)
///The STSymbol class is used to describe identifiers in the Stein programming language.
@interface STSymbol : NSObject
{
NSString *mString;
BOOL mIsQuoted;
STCreationLocation *mCreationLocation;
}
#pragma mark Creation
///Initialize a symbol with a string.
///
/// \param string The string the symbol is to represent. May not be nil.
///
/// \result A fully initialized symbol object.
- (id)initWithString:(NSString *)string;
#pragma mark - Identity
///Returns whether or not the receiver is equal to a specified object.
///
/// \param object An STSymbol or NSString object to compare the receiver to.
///
/// \result YES if the receiver is equal to `object`; NO otherwise.
- (BOOL)isEqualTo:(id)object;
///Returns whether or not the receiver is equal to a specified symbol.
- (BOOL)isEqualToSymbol:(STSymbol *)symbol;
///Returns whether or not the receiver is equal to a specified string.
- (BOOL)isEqualToString:(NSString *)string;
#pragma mark - Properties
///The string the symbol represents.
@property (readonly) NSString *string;
///Whether or not the symbol is quoted.
@property BOOL isQuoted;
#pragma mark -
///The location at which the list was created.
@property STCreationLocation *creationLocation;
@end
#endif /* STSymbol_h */