I just discovered ParseKit but can't seem to get it working on a simple example.
NSString *test = @"FOO:BAR";
NSString *grammar = ...//get grammar txt file and read it into a string
PKParser *parser = nil;
parser = [[PKParserFactory factory] parserFromGrammar:grammar assembler:self];
[parser parse:test];
}
- (void)didMatchFoo:(PKAssembly *)a
{
NSLog(@"FOO");
}
- (void)didMatchBar:(PKAssembly *)a
{
NSLog(@"BAR");
}
My grammar file looks like this:
@start = foo;
foo = 'FOO:' bar;
bar = 'BAR';
But the methods don't fire.