1 // 2 // AntlrReaderStream.h 3 // ANTLR 4 // 5 // Created by Alan Condit on 2/21/11. 6 // Copyright 2011 Alan's MachineWorks. All rights reserved. 7 // 8 9 #import <Foundation/Foundation.h> 10 #import "ANTLRStringStream.h" 11 12 @interface ANTLRReaderStream : ANTLRStringStream { 13 NSInputStream *is; 14 NSInteger size; 15 NSInteger rbSize; 16 //NSData *data; /* ANTLRStringStream has NSString *data */ 17 NSInteger p1; 18 } 19 20 @property (retain) NSInputStream *is; 21 @property (assign) NSInteger size; 22 @property (assign) NSInteger rbSize; 23 //@property (retain) NSData *data; 24 25 + (NSInteger) READ_BUFFER_SIZE; 26 + (NSInteger) INITIAL_BUFFER_SIZE; 27 28 + (id) newANTLRReaderStream; 29 + (id) newANTLRReaderStream:(NSInputStream *)r; 30 + (id) newANTLRReaderStream:(NSInputStream *)r size:(NSInteger)aSize; 31 + (id) newANTLRReaderStream:(NSInputStream *)r size:(NSInteger)aSize readBufferSize:(NSInteger)aReadChunkSize; 32 - (id) initWithReader:(NSInputStream *)r size:(NSInteger)aSize readBufferSize:(NSInteger)aReadChunkSize; 33 - (void) load:(NSInteger)aSize readBufferSize:(NSInteger)aReadChunkSize; 34 - (void) setUpStreamForFile; 35 - (void) stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode; 36 - (void) close; 37 38 @end 39