• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#import <Foundation/Foundation.h>
2#import "Fuzzy.h"
3#import <ANTLR/ANTLR.h>
4
5int main(int argc, const char * argv[])
6{
7    NSError *error;
8	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
9	NSString *input = [NSString stringWithContentsOfFile:@"/Users/acondit/source/antlr/code/antlr3/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	CommonTokenStream *tokens = [CommonTokenStream newCommonTokenStreamWithTokenSource:lex];
14	NSLog( [tokens toString] );
15
16	id<Token> currentToken;
17	while ((currentToken = [lex nextToken]) && currentToken.type != TokenTypeEOF) {
18		NSLog(@"### %@", [currentToken toString]);
19	}
20
21	[lex release];
22	[stream release];
23
24	[pool release];
25	return 0;
26}