What are the standard grammar parsers for iOS?

江枫思渺然 提交于 2020-01-02 20:17:21

问题


Does iOS for iPad and iPhone have support for a parser? In particular, is lex/yacc or flex/bison available for iOS development? Does xcode4 have a natively supported library? (I could generate my grammar via lex/yacc and then take the *.c files and put them in my project, but I was hoping for more tightly supported libraries.)

Any ideas?


回答1:


lex, yacc, flex, and bison all come with the Mac/iOS developer tools. Xcode has built-in rules for processing .l files with flex and .y files with bison, and it automatically compiles the generated .c files with your project. If you use .lm or .ym file extensions, it will generate .m files, allowing you to use actions written in Objective-C.

A sample use case is available at

https://github.com/dgkris/ObjectiveC-STL-Parser/tree/master/STLParser



来源:https://stackoverflow.com/questions/5427544/what-are-the-standard-grammar-parsers-for-ios

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!