开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜