Question

I recently tried to integrate ParseKit into my iPhone app. I downloaded release-1.5-tag, and integrated it into my project (XCode 4.4, iOS 5.1), and it builds without issue. When I run a simple example to try and parse some Javascript (using the grammar that comes bundled with ParseKit itself):

NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"javascript" ofType:@"grammar"];
NSString *g = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
PKParser *parser = [[PKParserFactory factory] parserFromGrammar:g assembler:self];
NSString *s = @"var x = 0;";
[parser parse:s];

My app hangs for a bit, then I get an EXC_BAD_ACCESS after what appear to be tens of thousands of calls to PKParser:matchAndAssemble, and PKSequence:allMatchesFor. At the end of all of these calls, it ends up calling PKTerminal:matchOneAssembly, then PKCaseInsensitiveLiteral:qualifies, then the EXC_BAD_ACCESS. Am I doing something wrong?

Was it helpful?

Solution

Developer of ParseKit here.

Use head of trunk from Google code:

http://code.google.com/p/parsekit/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top