main
 1//
 2// Licensed under the terms in License.txt
 3//
 4// Copyright 2010 Allen Ding. All rights reserved.
 5//
 6
 7#import "KWRegisterMatchersNode.h"
 8#import "KWExampleNodeVisitor.h"
 9
10@implementation KWRegisterMatchersNode
11
12#pragma mark -
13#pragma mark Initializing
14
15- (id)initWithCallSite:(KWCallSite *)aCallSite namespacePrefix:(NSString *)aNamespacePrefix {
16    if ((self = [super init])) {
17        callSite = [aCallSite retain];
18        namespacePrefix = [aNamespacePrefix copy];
19    }
20
21    return self;
22}
23
24+ (id)registerMatchersNodeWithCallSite:(KWCallSite *)aCallSite namespacePrefix:(NSString *)aNamespacePrefix {
25    return [[[self alloc] initWithCallSite:aCallSite namespacePrefix:aNamespacePrefix] autorelease];
26}
27
28- (void)dealloc {
29    [callSite release];
30    [namespacePrefix release];
31    [super dealloc];
32}
33
34#pragma mark -
35#pragma mark Getting Call Sites
36
37@synthesize callSite;
38
39#pragma mark -
40#pragma mark Getting Namespace Prefixes
41
42@synthesize namespacePrefix;
43
44#pragma mark -
45#pragma mark Accepting Visitors
46
47- (void)acceptExampleNodeVisitor:(id<KWExampleNodeVisitor>)aVisitor {
48    [aVisitor visitRegisterMatchersNode:self];
49}
50
51@end