Unfortunately, we can't take advantage of it. We need to create a query parser, similar to SQL language, which is quite large and complex. The end result after parsing needs to be represented as an expression tree using our own class definitions and API to build it. The AST support in Spirit 2 & 3 requires to define a set of structs to map the grammar. For a big grammar, there is a lot of extra work; and the generated AST structs still needs to be traversed and be transformed into our own tree structures. For our application, that's a waste of effort. What we really need is the old AST support provided in Spirit Classic, which uses the internal generated parser tree and a few notation in the grammar to identify the node types and child/parent relationships. There is very few effort needed to generate an AST that can be used to generate the ultimate expression tree.
I am so disappointed that the Parse Tree (pt_parse) & AST (ast_parse) provided in Spirit Classic, are not continued to be supported in Spirit 2 & 3. Any particular reason for this? Can you give guidance how can we use Spirit 3 to do what we would like to do described above?
From: Joel de Guzman [mailto:[hidden email]]
Sent: Saturday, May 16, 2015 5:15 PM
To: [hidden email] Subject: [Spirit-general] [Boost.Spirit] Spirit 3.0.0
Boost.Spirit has posted a new item, 'Spirit 3.0.0'
C++ Now 2015. Today is the official release of Spirit X3, aka Spirit
C++ 3.0.0. X3
will be in beta, coexisting side by side with Qi, Karma, Lex and Classic.
If you are a Qi user. The best place to start are the examples, especially rexpr and x3 fun.
Remember to use a compile with c++14 capabilities: