-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathgherkin-objective-c-header.razor
79 lines (58 loc) · 2.34 KB
/
gherkin-objective-c-header.razor
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
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Berp (http://https://github.com/gasparnagy/berp/).
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
@using Berp;
typedef enum GHTokenType
{
GHTokenTypeNone,
@foreach(var rule in Model.RuleSet.TokenRules)
{<text> GHTokenType</text>@rule.Name.Replace("#", "")<text>,
</text>}
} GHTokenType;
typedef enum GHRuleType
{
GHRuleTypeNone,
@foreach(var rule in Model.RuleSet.Where(r => !r.TempRule))
{<text> GHRuleType</text>@rule.Name.Replace("#", "_")<text>, // @rule.ToString(true)
</text>}
} GHRuleType;
#import "GHToken.h"
#import "GHParserException.h"
@@protocol GHAstBuilderProtocol <NSObject>
- (void)buildWithToken:(GHToken *)theToken;
- (void)startRuleWithType:(GHRuleType)theRuleType;
- (void)endRuleWithType:(GHRuleType)theRuleType;
- (id)result;
- (void)reset;
@@end
@@protocol GHTokenScannerProtocol <NSObject>
- (GHToken *)read;
@@end
@@protocol GHTokenMatcherProtocol <NSObject>
@foreach(var rule in Model.RuleSet.TokenRules)
{
<text>- (BOOL)match</text>@rule.Name.Replace("#", "")<text>WithToken:(GHToken *)theToken;
</text>
}
- (void)reset;
@@end
#import "GHAstBuilder.h"
#import "GHTokenMatcher.h"
#import "GHParserException.h"
@@interface GHParserContext : NSObject
@@property (nonatomic, strong) id<GHTokenScannerProtocol> tokenScanner;
@@property (nonatomic, strong) id<GHTokenMatcherProtocol> tokenMatcher;
@@property (nonatomic, strong) NSMutableArray<GHToken *> * tokenQueue;
@@property (nonatomic, strong) NSMutableArray<GHParserException *> * errors;
@@end
@@interface @{ Write("GH"); }@Model.ParserClassName : NSObject
@@property (nonatomic, assign) BOOL stopAtFirstError;
- (id)initWithAstBuilder:(id<GHAstBuilderProtocol>)theAstBuilder;
- (id)parseWithTokenScanner:(id<GHTokenScannerProtocol>)theTokenScanner;
- (id)parseWithTokenScanner:(id<GHTokenScannerProtocol>)theTokenScanner tokenMatcher:(id<GHTokenMatcherProtocol>)theTokenMatcher;
@@end