Search code examples
objective-cparsingcompiler-constructionprogramming-languagesparser-generator

Parser Generator for Objective C?


I've been advised to use a Parser Generator to create a parser for my domain specific language.

Ideally I'd like it to output an objective-C parser and take BNF input to describe the language.

There seems to be very little choice.. is it possible to use one of the more popular Parser Generators with objective C?

Thanks!


Solution

  • Code generation is not the “true way” in dynamic languages like Objective-C. Anything that can be achieved by a parser generator can be achieved at runtime. So, I'd suggest you try something like ParseKit, which will take a BNF-like grammar, and give you various delegate hooks you can implement to construct your parser.

    Check out this tutorial for more details.