Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 94e84d94e4
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (32 sloc) 0.588 kb
@import "TDParser.j"
@implementation TDCollectionParser : TDParser
{
CPArray subparsers @accessors;
}
- (id)init
{
if (self = [super init]) {
self.subparsers = [];
}
return self;
}
- (void)add:(TDParser)p
{
[subparsers addObject:p];
}
- (TDParser)parserNamed:(CPString)s
{
if (name === s)
return self;
else
{
for (var i=0, length = [subparsers count]; i<length; i++)
{
var sub = [subparsers[i] parserNamed:s];
if (sub)
return sub;
}
}
return nil;
}
@end
Jump to Line
Something went wrong with that request. Please try again.