Questions tagged [semantic-actions]
4 questions
1
vote
1 answer
In boost spirit how can one set the force-rule-to-not-match bool reference parameter from a semantic action routine creating an attribute?
Currently I have something like this:
qi::_val = boost::phoenix::bind(
[](const std::string&, const boost::optional&)
{ return std::string();
},
qi::_1,
qi::_2
)
I would like to optionally…

Frank Puck
- 467
- 1
- 11
1
vote
3 answers
Discarding parsed result after semantic action
In Boost.Spirit one can read from a stream to a std::vector simply by doing:
#include
#include
namespace sqi = boost::spirit::qi;
int main(){
std::string const v_str = "AA BB CC";
…

alfC
- 14,261
- 4
- 67
- 118
1
vote
1 answer
Boost spirit parser fails with incomplete type error
I've been trying all sorts of things but still not quite understanding why the following fails with 'incomplete type' error
#define BOOST_PHOENIX_LIMIT 30
#define SPIRIT_ARGUMENTS_LIMIT 30
#include
#include…

Danny
- 391
- 2
- 12
0
votes
1 answer
Simple sematic action destroys the result in Spirit X3
I have this Spirit X3 parser
auto xyz_def =
x3::omit[x3::int_] >> x3::eol >>
(x3::lexeme[+(x3::char_ - x3::eol)]) >> x3::eol >>
(*(chemical::parser::atom >> x3::eol)
;
Which parses, with no problem something like…

alfC
- 14,261
- 4
- 67
- 118