I am trying to build config file parser (c++ application)from scratch using tools like lex and yacc. The parser will be able to parse files like
# Sub group example
petName = Tommy
Owner = {
pet = "%petName%"
}
Is there any step by step guide/link to articles on how to achieve this using tools like lex and yacc? The idea is I will write a class say Config (c++) with methods like getConfig(string propName). If I invoke like config.getConfig(Owner.pet), it will return me Tommy.
Boost Property Tree
It was designed for configuration files. It does reading, writing in the following formats:
Here is the five minute tutorial page which should give you a good idea: