Questions tagged [boost-spirit]

Boost.Spirit is a set of C++ libraries for parsing and output generation implemented as Domain Specific Embedded Languages (DSEL) using Expression templates and Template Meta-Programming. The Spirit libraries enable a target grammar to be written exclusively in C++. Inline grammar specifications can mix freely with other C++ code and, thanks to the generative power of C++ templates, are immediately executable.

Boost.Spirit is a set of C++ libraries for parsing and output generation implemented as Domain Specific Embedded Languages (DSEL) using Expression Templates and Template Meta-Programming. The Spirit libraries enable a target grammar to be written exclusively in C++. Inline grammar specifications can mix freely with other C++ code and, thanks to the generative power of C++ templates, are immediately executable.

Spirit is part of Boost Libraries, a peer-reviewed, open collaborative development effort (see: http://www.boost.org).

You can find more information on Spirit's website here: http://boost-spirit.com/home/.

1419 questions
-1
votes
1 answer

Parsing file input with spirit

I played around with boost::spirit recently and wanted to use it to parse file input. What i got is this: defining some semantic actions: data = ifstream("herpderp", ios::in); std::string line; auto pri = [&](auto &ctx){cout << "got this" <<…
drinker
  • 41
  • 7
-1
votes
1 answer

Expectation failure not triggered if file ends with Boost Spirit Qi parser

When the file ends in the middle of a rule with remaining expectations, it doesn't trigger an expectation error (it does, of course, fail to parse). A simplified example that triggers the behavior is this: data_var_decls_r %= (lit("data") >…
Bob Carpenter
  • 3,613
  • 1
  • 20
  • 13
-1
votes
1 answer

Failing to parse correctly when using Boost.Spirit

I am working on a programming language (full project here) implemented using Boost.Spirit, and I am struggling with the following problem. I have the following declaration for a function (line 77 in this file): function_body_rule %= …
Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166
-1
votes
1 answer

Mixed usage of the sequence parser and the expectation parser

> qi::double_ v.s. >> qi::double_ I want to parse the following string "***: @a_-091 , *** 1" to a struct defined as using type = boost::fusion::vector; When the parser *qi::omit[qi::char_ - '@'] >> '@' >>…
cqdjyy01234
  • 1,180
  • 10
  • 20
-2
votes
1 answer

How to create own parser similar to double_ in Boost.Spirit?

I try to learn how Boost.Spirit works. Unfortunately, the documentation is too laconic for me and I can't figure out, how it really works. So, let's move to my problem. I try to write parser for std::complex type, that will work in the same way like…
Archie
  • 6,391
  • 4
  • 36
  • 44
-2
votes
1 answer

I'm using boost::spirit to write a parser lexer

I'm using boost::spirit to write a parser, lexer here is what i want to do. i want to put functions and classes into data structures with the variables they use. so i want to know what would be the best way to do this. and what parts of…
zeitue
  • 1,674
  • 2
  • 20
  • 45
-2
votes
1 answer

Boost Spirit Qi - C++ Grammar for string parsing

C++ Spirit Experts, I am looking for generic parser for the below use case. Any help will be greatly appreciated KEY = alphanumeric value Value = alphanumeric value Array of values alphanumeric separated by () List of Array – 2D ex: Key1…
-3
votes
1 answer

Implementation of a parser of nested and optional structure in boost spirit

I would like to implement a parser for a nested (and optional) structure with boos::spirit as "namespace" in C++ language. What is the simplest way to do it?
Claudio La Rosa
  • 141
  • 1
  • 2
  • 7
1 2 3
94
95