2

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 stuff {
        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?

  • 1
    Related: There are a lot of good resources in reply to [Learning to write a compiler](http://stackoverflow.com/questions/1669/learning-to-write-a-compiler). While you may not be writing a compiler, the best descriptions of parsing are often found in compiler texts. – James McNellis Jul 23 '10 at 21:09
  • @James McNellis: Good Idea. you might want to write that as an answer, so I can accept it ;-) –  Jul 23 '10 at 21:51

1 Answers1

3

The wikipedia entry on recursive descent parsers should get you started.

IVlad
  • 43,099
  • 13
  • 111
  • 179
  • The Example program on TOW is pretty straightforwarded, though not exactly what i'm looking for... but still +1 for the link –  Jul 23 '10 at 21:52