c++algorithmparsingqjson

What QJson use to parse syntax of JSON?


I checked source code of qjson library , and it seems to use some .yy files , what was that ?

Can such thing be used for any wanted syntax ?


Solution

  • .yy file contains rules to generate Lexical Analyzer code. Whose output is used subsequently by a Parser. Flex is a well-known tool for building Lexical Analyzer code. After that you can use tools like Bison for building Parser code. So yes any syntax which is Context Free can be parsed using above tools.