boost-spirit Questions

1

This may be very obvious, but why does the stream-based parsing in boost duplicate the last letter? I must be doing something wrong: #include <iostream> #include <sstream> #include &l...
Portfolio asked 16/10, 2013 at 10:37

1

Solved

I would like to define a function taking 2 arguments double func(double t, double x); where the actual implementation is read from an external text file. For example, specifying in the text f...
Marcasite asked 22/1, 2015 at 23:59

1

Solved

I've seen a few posts related to the nuances of keyword/identifier use in qi grammars, but I can't quite make sense of how the approach demonstrated in the boost examples is supposed to work... Ke...
Homogenesis asked 13/12, 2014 at 20:33

2

Solved

I'm using Boost Spirit to implement functionality in some software that allows the user to enter a mathematical equation that will be repeatedly applied to an input stream. Input stream values are ...
Fragmentation asked 28/5, 2014 at 13:12

1

Solved

I would like my boost::spirit-based parser to be able to parse a file, convert the parsed rules into different types, and emit a vector containing all of the matches it found. All of the types that...
Dobby asked 25/4, 2014 at 17:46

1

Solved

I already asked question about this issue. But since there were no answers i'm asking again now with full compilable source code snippet. This code snippet should be compiled with no std=c++11 opt...
Brezhnev asked 23/4, 2014 at 11:6

1

Solved

I have a code base which is quite equivalent to the code below. I try to generate a text file with two times the content of a variable. I feel that the answer is in semantic actions and _a and _val...
Corrie asked 2/4, 2014 at 13:16

1

Solved

#include <iostream> #include <boost/spirit/include/qi.hpp> namespace qi = boost::spirit::qi; int main () { using qi::string; std::string input("a"); std::string::iterator strbegin ...
Fantasia asked 22/2, 2014 at 19:23

1

Solved

How can I prevent the Boost Spirit Symbol parser from accepting a keyword (symbol) when starts with a valid keyword (symbol). I would like the construct to fail parsing ‘ONEMORE’ as a whole and not...
Curitiba asked 22/2, 2014 at 20:34

1

Solved

#include <iostream> #include <boost/spirit/include/qi.hpp> namespace qi = boost::spirit::qi; int main () { // the following parses "1.0 2.0" into a pair of double std::string input("...
Nyala asked 22/2, 2014 at 17:32

2

Solved

I have the following code: #include <boost/fusion/include/define_struct.hpp> #include <boost/spirit/include/qi.hpp> #include <iostream> #include <string> BOOST_FUSION_DEF...
Do asked 10/2, 2014 at 8:37

1

Solved

I’m trying to parse a character string into an attribute of a custom type symbol, which contains a std::string member. I thought I could use BOOST_FUSION_ADAPT_STRUCT here but that doesn’t work. I...
Weisler asked 2/2, 2014 at 14:31

2

Solved

I would like to convert some old hand-written parsing code to Boost Spirit and learn (more of) spirit in the process. The old code uses streams and templates to parse definitions for some data-type...
Heldentenor asked 20/1, 2014 at 15:53

1

Solved

I develop my code in my spare time. Preferably in debug mode. Recently, when I tried to build release version, then I got the error (runtime, output: 1\n2\n then failure). I located the piece of co...
Lychnis asked 24/12, 2013 at 16:3

1

Solved

c++0x compiler fails to compile boost.spirit example mini_xml2.cpp (and no errors from not c++0x compiler) $> c++ -std=c++0x mini_xml2.cpp (errors) $> c++ mini_xml2.cpp (no errors) The err...
Kaciekacy asked 21/12, 2013 at 17:12

1

Solved

I have a working grammar similar to the following: stock_price = symbol_ >> date_ >> price_; stock_prices_ = stock_price_ >> stock_prices_ | eps; grammar_ = lit( "PRICES" ) >&...
Obadias asked 19/12, 2013 at 16:26

1

Solved

I'm trying to write a parser for a C-like language with boost::spirit that uses inherited attributes to transfer information about variable scope. For instance, "namespace a { var b }" would pass "...
Plossl asked 7/12, 2013 at 10:26

2

Solved

I'm trying to parse a sequence of the syntax: < direction > < type > < name >. For example: in float foo where the direction can be either in, out, or in_out. I've succeeded in parsing ...
Acatalectic asked 21/11, 2013 at 20:23

1

Solved

My goal is to create a workaround so that I may use C++11 lambdas inside Boost Spirit Qi semantic actions, while still having access to a more expanded set of qi placeholders, such as qi::_pass or ...
Luteal asked 12/11, 2013 at 7:15

2

Solved

I have a lot of rules that have common prefix and suffix: rule = begin_stuff >> some >> other >> stuff >> end_stuff. (where begin_stuff and end_stuff are composed from li...
Spoilage asked 14/11, 2012 at 22:8

1

Solved

I have an compilation issue with Spirit Qi where it complains that value_type is not a member of identifier. For some reason, Qi's attribute system considers identifier to be a container type, and ...
Yellowwood asked 6/11, 2013 at 21:41

1

Solved

Dear Spirit Qi experts. I have played around with the MiniC example in Spirit Qi, and have noticed an issue with "empty" AST nodes in the expression grammar. It will generate "expression" nodes th...
Veii asked 31/10, 2013 at 13:2

1

Solved

in boost::spirit, I added error handling code based on example roman. #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/phoenix_operator.hpp> #include <boost/spi...
Shanley asked 15/10, 2013 at 7:43

1

Solved

edit : I have ripped out the lexer as it does not cleanly integrate with Qi and just obfuscates grammars (see answer below). My lexer looks as follows : template <typename Lexer> struct ...
Mahan asked 8/10, 2013 at 9:46

0

^ No it is not. This was part of the problem, but if review the code as is right now, it already does what the pointed out question/answer shows ... and the errors are still not triggered. I have ...
Ribbing asked 7/10, 2013 at 1:37

© 2022 - 2024 — McMap. All rights reserved.