1324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// [The "BSD licence"]
2324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// Copyright (c) 2006-2007 Kay Roepke
3324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// All rights reserved.
4324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver//
5324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// Redistribution and use in source and binary forms, with or without
6324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// modification, are permitted provided that the following conditions
7324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// are met:
8324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// 1. Redistributions of source code must retain the above copyright
9324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver//    notice, this list of conditions and the following disclaimer.
10324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// 2. Redistributions in binary form must reproduce the above copyright
11324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver//    notice, this list of conditions and the following disclaimer in the
12324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver//    documentation and/or other materials provided with the distribution.
13324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// 3. The name of the author may not be used to endorse or promote products
14324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver//    derived from this software without specific prior written permission.
15324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver//
16324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
27324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver#import <Cocoa/Cocoa.h>
28324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver#import "ANTLRCommonTree.h"
29324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
30324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@interface ANTLRUnbufferedCommonTreeNodeStreamState : NSObject {
31324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	ANTLRCommonTree *currentNode;
32324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	ANTLRCommonTree *previousNode;
33324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
34324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	int currentChildIndex;
35324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	int absoluteNodeIndex;
36324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	unsigned int nodeStackSize;
37324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	unsigned int indexStackSize;
38324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
39324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	NSMutableArray *lookahead;
40324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver}
41324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
42324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (ANTLRCommonTree *) currentNode;
43324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setCurrentNode: (ANTLRCommonTree *) aCurrentNode;
44324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
45324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (ANTLRCommonTree *) previousNode;
46324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setPreviousNode: (ANTLRCommonTree *) aPreviousNode;
47324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
48324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (NSInteger) currentChildIndex;
49324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setCurrentChildIndex: (NSInteger) aCurrentChildIndex;
50324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
51324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (NSInteger) absoluteNodeIndex;
52324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setAbsoluteNodeIndex: (NSInteger) anAbsoluteNodeIndex;
53324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
54324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (NSUInteger) nodeStackSize;
55324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setNodeStackSize: (NSUInteger) aNodeStackSize;
56324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
57324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (NSUInteger) indexStackSize;
58324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setIndexStackSize: (NSUInteger) anIndexStackSize;
59324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
60324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (NSMutableArray *) lookahead;
61324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setLookahead: (NSMutableArray *) aLookahead;
62324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
63324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) addToLookahead: (id)lookaheadObject;
64324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) removeFromLookahead: (id)lookaheadObject;
65324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
66324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@end
67