Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 42 lines (32 sloc) 0.588 kb
98b7f3c Beginnings of porting the Obj-C code to Obj-J.
Ross Boucher authored
1
2 @import "TDParser.j"
3
4 @implementation TDCollectionParser : TDParser
5 {
6 CPArray subparsers @accessors;
7 }
8
9 - (id)init
10 {
11 if (self = [super init]) {
12 self.subparsers = [];
13 }
14
15 return self;
16 }
17
18 - (void)add:(TDParser)p
19 {
20 [subparsers addObject:p];
21 }
22
23 - (TDParser)parserNamed:(CPString)s
24 {
25 if (name === s)
26 return self;
27 else
28 {
29 for (var i=0, length = [subparsers count]; i<length; i++)
30 {
31 var sub = [subparsers[i] parserNamed:s];
32
33 if (sub)
34 return sub;
35 }
36 }
37
38 return nil;
39 }
40
41 @end
Something went wrong with that request. Please try again.