1324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// [The "BSD licence"]
2324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver// Copyright (c) 2006-2007 Kay Roepke 2010 Alan Condit
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
28324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver#import <Cocoa/Cocoa.h>
29324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver#import "ANTLRRuntimeException.h"
30324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver#import "ANTLRToken.h"
31324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver#import "ANTLRIntStream.h"
32324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver#import "ANTLRBaseTree.h"
33324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
34324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@interface ANTLRRecognitionException : ANTLRRuntimeException {
35324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	id<ANTLRIntStream> input;
36324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	NSInteger index;
37324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	id<ANTLRToken> token;
38324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	id<ANTLRBaseTree> node;
39324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	unichar c;
40324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	NSUInteger line;
41324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver	NSUInteger charPositionInLine;
42324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver}
43324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
44324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@property (retain, getter=getStream, setter=setStream:) id<ANTLRIntStream> input;
45324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@property (assign) NSInteger index;
46324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@property (retain, getter=getToken, setter=setToken:) id<ANTLRToken>token;
47324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@property (retain, getter=getNode, setter=setNode:) id<ANTLRBaseTree>node;
48324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@property (assign) unichar c;
49324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@property (assign) NSUInteger line;
50324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@property (assign) NSUInteger charPositionInLine;
51324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
52324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver+ (id) newException;
53324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver+ (id) newException:(id<ANTLRIntStream>) anInputStream;
54324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id) init;
55324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id) initWithStream:(id<ANTLRIntStream>)anInputStream;
56324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id) initWithStream:(id<ANTLRIntStream>)anInputStream reason:(NSString *)aReason;
57324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id) initWithName:(NSString *)aName reason:(NSString *)aReason userInfo:(NSDictionary *)aUserInfo;
58324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
59324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (NSInteger) unexpectedType;
60324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id<ANTLRToken>)getUnexpectedToken;
61324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
62324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id<ANTLRIntStream>) getStream;
63324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setStream: (id<ANTLRIntStream>) aStream;
64324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
65324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id<ANTLRToken>) getToken;
66324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setToken: (id<ANTLRToken>) aToken;
67324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
68324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (id<ANTLRBaseTree>) getNode;
69324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (void) setNode: (id<ANTLRBaseTree>) aNode;
70324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
71324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver- (NSString *)getMessage;
72324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
73324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
74324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver@end
75