1#import <Foundation/Foundation.h> 2#import "TestLexer.h" 3#import <ANTLR/ANTLR.h> 4#import <unistd.h> 5 6int main(int argc, const char * argv[]) 7{ 8 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 9 10 ANTLRStringStream *stream = [ANTLRStringStream newANTLRStringStream:@"abB9Cdd44"]; 11 TestLexer *lexer = [[TestLexer alloc] initWithCharStream:stream]; 12 id<Token> currentToken; 13 while ((currentToken = [[lexer nextToken] retain]) && currentToken.type != TokenTypeEOF) { 14 NSLog(@"%@", currentToken); 15 } 16 [lexer release]; 17 [stream release]; 18 19 [pool release]; 20 // sleep for objectalloc 21 // while (1) sleep(60); 22 return 0; 23}