-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.h
81 lines (61 loc) · 1.94 KB
/
parser.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
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// parser.h
// appscript
//
#import "types.h"
#import "utils.h"
#import "objectrenderer.h"
/**********************************************************************/
@interface ASParserDef : NSObject {
NSString *name;
OSType code;
unsigned hash;
}
- (id)initWithName:(NSString*)name_ code:(OSType)code_;
- (NSString *)name;
- (OSType)fourCharCode;
@end
/**********************************************************************/
@interface ASParserCommandDef : ASParserDef {
OSType classCode;
NSMutableSet *parameters;
}
- (id)initWithName:(NSString*)name eventClass:(OSType)classCode_ eventID:(OSType)code_;
- (OSType)eventClass;
- (OSType)eventID;
- (void)addParameter:(ASParserDef *)def;
- (NSSet *)parameters;
@end
/**********************************************************************/
@interface ASAETEParser : NSObject {
char *aeteData;
unsigned long aeteSize;
unsigned long cursor;
/* terminology tables; order is significant where synonym definitions occur */
NSMutableDictionary *commands;
NSMutableSet *properties, *elements, *classes, *enumerators;
/* use sets to record previously found definitions, and avoid adding duplicates to lists
** (i.e. 'name+code not in <set>' is quicker than using 'name+code not in <list>')
*/
NSMutableSet *foundProperties, *foundElements, *foundClasses, *foundEnumerators;
/* ideally, aetes should define both singular and plural names for each class, but
** some define only one or the other so we need to fill in any missing ones afterwards
*/
NSMutableDictionary *classAndElementDefsByCode;
NSMutableSet *foundClassCodes, *foundElementCodes;
}
- (unsigned short)integer;
- (OSType)word;
- (NSString *)name NS_RETURNS_RETAINED;
- (void)parseCommand;
- (void)parseClass;
- (void)parseComparison;
- (void)parseEnumeration;
- (void)parseSuite;
- (ASAETEParser *)parse:(id)aetes;
- (NSArray *)classes;
- (NSArray *)enumerators;
- (NSArray *)properties;
- (NSArray *)elements;
- (NSArray *)commands;
@end