|
Boost Users : |
Subject: Re: [Boost-users] What is the equivalent of pt_parse() in Spirit 2.1
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2009-11-09 07:30:26
> I want to be able to generate ParseTree and dump it into xml like in
> Spirit Classic. In the Classic we call pt_parse() which return
> tree_parse_info and we can dump it into XML easily using tree_to_xml().
>
> Do we have the same functionality in Spirit 2.1?
Spirit 2.1 does not have any special API functions for AST generation. It's
all intrinsic. You really should look at the examples (for instance
mini_xml[1-3].cpp) and read the docs (http://tinyurl.com/ojalum). The
introduction there guides you nicely through how it's done.
As for XML generation, we don't have this in Spirit 2.1 at all. Every parser
may now generate a structurally different PT/AST, so having a common dump
function is not feasible. You'll have to craft your own (the examples show
how you may want to do that as well).
Regards Hartmut
-------------------
Meet me at BoostCon
http://boostcon.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net