1 #import <Cocoa/Cocoa.h> 2 #import "TestLexer.h" 3 #import "antlr3.h" 4 #import <unistd.h> 5 6 int 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<ANTLRToken> currentToken; 13 while ((currentToken = [[lexer nextToken] retain]) && [currentToken getType] != ANTLRTokenTypeEOF) { 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 }