我正在尝试解析一小部分 HTML 标记。
PKSequence *parrser = [PKSequence sequence];
[parrser add:[PKSymbol symbolWithString:@"<title>"]];
PKWord *word = [PKWord word];
[word setAssembler:self selector:@selector(workOnWordAssembly:)];
[parrser add:word];
[parrser add:[PKSymbol symbolWithString:@"</title>"]];
PKAssembly *result = [parrser bestMatchFor:[PKTokenAssembly assemblyWithString:@"<title>teeest</title>"]];
-(void)workOnWordAssembly:(PKAssembly *)a {
NSLog(@"We entered this");
}
但workOnWordAssembly
没有被调用。