I want to parse an input file that has syntax similar to c++ source. The file will have components such as these:
//It will have comments.
//It will be able to recursively open other files.
include OtherInputFile.txt
//It will resolve scope
ObjectName::MemberVariable = 0.0;
OtherObjectName
{
MemberVariable1 = 1.0;
MemberVariable2 = 2.0;
}
The trouble is, I have no idea what I’m doing. I suppose what I need is a textbook chapter on parsing to orient myself to what technologies or algorithms are available.
Lots of tools exist to build parsers:
lex and yacc
flex and bison
antlr
boost::spirit
Coco/R