简体   繁体   中英

What are the standard grammar parsers for iOS?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM