I’m about to parse a lot of files, with a precise hierarchy for the XML ones and a precise syntax for the others. I would like to abstract these files at “token level” to simplify my code and logic. I also need UTF-8 support.
Is there a library, or perhaps a library only formed by several headers, that can do this in C++?
EDIT:
supposing that my file is something like that
COLOR=red Language=en
COLOR=blue Language=se
COLOR=green Language=fr
with token level i mean that i can access this values after parsing in this way:
Object.getValue(color, 1)
and this should return red.
Well, there is boost::spirit, that I think may be what you are looking for. You can use it to create rules for parsing input. I personally have never used it but heard good comments for it. Hope it helps.