1 #import <Cocoa/Cocoa.h> 2 #import "Fuzzy.h" 3 #import "antlr3.h" 4 5 int main(int argc, const char * argv[]) 6 { 7 NSError *error; 8 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 9 NSString *input = [NSString stringWithContentsOfFile:@"/Users/acondit/source/antlr3/acondit_localhost/code/antlr/antlr3-main/runtime/ObjC/Framework/examples/fuzzy/input" encoding:NSASCIIStringEncoding error:&error]; 10 NSLog(@"%@", input); 11 ANTLRStringStream *stream = [ANTLRStringStream newANTLRStringStream:input]; 12 Fuzzy *lex = [Fuzzy newFuzzyWithCharStream:stream]; 13 ANTLRCommonTokenStream *tokens = [ANTLRCommonTokenStream newANTLRCommonTokenStreamWithTokenSource:lex]; 14 NSLog( [tokens toString] ); 15 16 id<ANTLRToken> currentToken; 17 while ((currentToken = [lex nextToken]) && [currentToken getType] != ANTLRTokenTypeEOF) { 18 NSLog(@"### %@", [currentToken toString]); 19 } 20 21 [lex release]; 22 [stream release]; 23 24 [pool release]; 25 return 0; 26 }