Learning parsing with C++
I want to learn the basics of Parsing with C++.
For that matter I thought of a simple Configuration Language that might look like this:
/*
same comment syntax as in C++
keywords:
"section" = begins a new section block
"var" = defines a new var
...
*/
section MySection { // also valid: section "MySection" { ... }
var someVar = "foo";
section st开发者_开发百科uff {
var things = "data";
};
};
Dummy grammar:
"section" <section_name> "{" <block> "}" ";"
"var" <name> "=" <value> ";"
Now I wonder where I would find a beginners tutorial that might cover this Project?
The wikipedia entry on recursive descent parsers should get you started.
精彩评论