Parse/tokenize objective-c with objective-c (iPhon

2019-08-04 16:01发布

What are the options available of parsing and/or tokenizing Objective-C on iPhone?

Essentially I'm thinking of parsing/tokenizing enough to power syntax highlighting and autocompletion at somewhat the same level as Xcode does.

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-08-04 16:43

I know the topic is old, but this might help someone else.

Apple already provides the (very nice) CFStringTokenizer, with support for multiple languages. Here's a good presentation on that, including sample code. In case tokenization is enough, that should do it.

If parsing is required however (it shouldn't for syntax highlight) there's ParseKit or C-based solutions, such as YACC.

Best.

查看更多
登录 后发表回答