forked from pmougin/F-Script
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSymbolTableOld.h
More file actions
executable file
·109 lines (68 loc) · 2.79 KB
/
Copy pathSymbolTableOld.h
File metadata and controls
executable file
·109 lines (68 loc) · 2.79 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* SymbolTable.h Copyright (c) 1998-2005 Philippe Mougin. */
/* This software is open source. See the license. */
#import <Foundation/Foundation.h>
#import "FSContext.h"
@class Array;
enum SymbolTable_value_type {VARIABLE,CLASS,CONSTANT,ARGUMENT};
enum SymbolTable_symbol_status {DEFINED,UNDEFINED};
@interface SymbolTableValueWrapper : NSObject <NSCopying , NSCoding>
{
@public
enum SymbolTable_value_type type;
enum SymbolTable_symbol_status status;
id value;
NSString *symbol;
NSUInteger retainCount;
}
- (id)copy;
- (id)copyWithZone:(NSZone *)zone;
- (void)encodeWithCoder:(NSCoder *)coder;
- (id)initWithCoder:(NSCoder *)coder;
- initWrapperWithValue:(id)theValue type:(enum SymbolTable_value_type)theType
symbol:(NSString *)theSymbol;
- initWrapperWithValue:(id)theValue type:(enum SymbolTable_value_type)theType
symbol:(NSString *)theSymbol
status:(enum SymbolTable_symbol_status)theStatus;
// symbol is not copied.
- (void)setValue:(id)theValue;
- (enum SymbolTable_symbol_status)status;
- (NSString *)symbol;
- (enum SymbolTable_value_type)type;
- (id)value;
@end
@interface SymbolTable : FSContext
{
NSMutableDictionary *symbTable;
Array *valueWrappers;
BOOL tryToAttachWhenDecoding;
}
+ (void)initialize;
+ symbolTable;
- (Array *)allDefinedSymbols;
- (BOOL) containsSymbolAtFirstLevel:(NSString *)theKey;
- (id)copy;
- (id)copyWithZone:(NSZone *)zone;
- (void)dealloc;
- (void)encodeWithCoder:(NSCoder *)coder;
- (struct FSContextIndex)findOrInsertSymbol:(NSString*)theKey;
- (struct FSContextIndex)indexOfSymbol:(NSString *)theKey;
- init;
- initWithParent:(SymbolTable *)theParent;
- initWithParent:(SymbolTable *)theParent tryToAttachWhenDecoding:(BOOL)shouldTry;
- (id)initWithCoder:(NSCoder *)coder;
- (struct FSContextIndex)insertSymbol:(NSString*)theKey value:(id)theValue;
- (struct FSContextIndex)insertSymbol:(NSString*)theKey value:(id)theValue
type:(enum SymbolTable_value_type)theType;
- (struct FSContextIndex)insertSymbol:(NSString*)theKey value:(id)theValue
type:(enum SymbolTable_value_type)theType
status:(enum SymbolTable_symbol_status)theStatus;
// theKey is not copied
- (BOOL) isEmpty;
- (id)objectForSymbol:(NSString *)symbol found:(BOOL *)found; // foud may be passed as NULL
- (SymbolTable *) parent;
- (void)removeAllObjects;
-(void)setObject:(id)object forSymbol:(NSString *)symbol;
- (void) setParent:(SymbolTable *)theParent;
- (void)setToNilSymbolsFrom:(NSUInteger)ind;
- (NSString *)symbolForIndex:(struct FSContextIndex)index;
@end