-
Notifications
You must be signed in to change notification settings - Fork 1
/
PKParser.h
135 lines (109 loc) · 2.63 KB
/
PKParser.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#import <Foundation/Foundation.h>
#import <LanguageKit/LanguageKit.h>
@interface PKParser: NSObject
{
id input;
id rules;
id delegate;
}
+ (BOOL)supportsGrammar: (NSString*)grammarName;
+ (NSArray*)loadGrammarsFromBundle: (NSBundle*)bundle;
+ (NSArray*)loadGrammarsFromString: (NSString*)string;
- (id)initWithGrammar: (NSString*)grammarName;
- (void)setDelegate: (id)delegate;
- (id)match: (id)inputStream rule: (NSString*)ruleName;
- (id)getEmptyMatch: (id) list;
@end
@interface PKInputStream : NSObject
{
id memo;
id stream;
id position;
id positionStack;
id environmentStack;
}
- (id) position;
- (unsigned long long) length;
- (id) stream;
- (id) lastPosition;
- (id) initWithStream: (id) input;
@end
@interface PKParseFail: NSObject
{
}
- (id) isSuccess;
@end
@interface PKParseMatch : NSObject
{
id input;
id range;
id action;
id delegate;
}
+ (id) emptyMatch: (id)string;
- (id) sequenceWith: (id) match;
- (id) initWithInput: (id) list length: (id) length;
- (id) isSuccess;
- (id) isFailure;
- (id) isEmpty;
- (id) matchText;
@end
@interface PKParserAbstractGenerator : NSObject
{
id delegate;
id specialCharToChar;
}
@end
@interface PKParserASTGenerator : PKParserAbstractGenerator
{
id externalParsers;
id inputStreamDeclaration;
id tempDecl;
id methodStatements;
id currentTempsCount;
}
- (id)genTemp;
@end
@interface PKEnvironmentStack : NSObject
@end
@interface PKDelayInvocation : NSObject
{
id selector;
id args;
id original;
}
+ (id )invocationWithSelector: (id)aSelector arguments: (id)someArgs originalMatch: (id)match;
- (id) initWithSelector: (id)aSelector arguments: (id)someArgs originalMatch: (id)match;
- (id) reduceOn: (id)target;
- (id) canReduce;
@end
@interface PKParseExpression : NSObject
{
}
- (id) parseInput: (id)list withCurrentParser: (id)parser delegate: (id)delegate ifFailed: (id)aBlock;
- (id) parseInput: (id)list withCurrentParser: (id)parser ifFailed: (id)aBlock;
- (id) parseInput: (id)list withCurrentParser: (id)parser delegate: (id)delegate;
- (id) parseInput: (id)list withCurrentParser: (id)parser;
- (id) parseInput: (id)list;
@end
@interface PKDotExpression : PKParseExpression
@end
@interface PKAlphabeticExpression : PKParseExpression
@end
@interface PKEmptyExpression : PKParseExpression
@end
@interface PKAnythingExpression : PKParseExpression
@end
@interface PKUppercaseExpression : PKParseExpression
@end
@interface PKWhitespaceExpression : PKParseExpression
@end
@interface PKRangeExpression : PKParseExpression
{
}
- (id) initFrom: (id)fromChar to: (id)toChar;
@end
@interface PKNumericExpression : PKParseExpression
@end
@interface PKLowercaseExpression : PKParseExpression
@end