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
0
votes
3 answers

Understanding of spirit grammar

While going through the documentation I read that for a string of doubles separated by a comma we could go like this (which I understand) double_ >> * (',' >> double_) or double_ % but what does the following expression mean. Its supposed to split…
Rajeshwar
  • 11,179
  • 26
  • 86
  • 158
0
votes
1 answer

boost::spirit and grammars

I'm trying to parse this simply and consise xml-minded structure with Boost::Spirit, One{ Two{ Three{ } } } And the code is organized as follows: Struct definition to keep the spirit-stuff: struct config; typedef…
Tomaz Canabrava
  • 2,320
  • 15
  • 20
0
votes
1 answer

Boost Wave custom input policy

What I'm trying to do is, during preprocessing of c like files in boost::wave (I'm actually processing glsl files), instead of loading included files from disk, I want to 'load' them from a map, where map.first is the filename and map.second is the…
Jarrett
  • 1,767
  • 25
  • 47
0
votes
1 answer

Skipper does not work in boost::spirit

I use boost spirit to parse a color. That worked quite well, but after I changed the the iterator type, the skipper stopped working. "rgb(1.0,1.0,0.5)" // this works " rgb(0.2,0.2,0.2)" // this fails Here is the header: struct ColorGrammar :…
Databyte
  • 1,420
  • 1
  • 15
  • 24
0
votes
1 answer

How extract unsigned value from matched string?

I need to write lexical analyzer with ability to parse tokens like x(t-1), u(t), u(t-4), a0, a1,... and attributes of this lexemes should be "unsigned" (as example attribute value for token x(t-2) should be 2). I can define all this tokens via…
Anton
  • 575
  • 2
  • 7
  • 27
0
votes
2 answers

Using Boost (Spirit) with g++ (and later Eclipse)

How can I configure g++ to use boost libraries? I Googled and tried many combinations but failed. I managed to get it working a few weeks ago ... g++ test.cpp -o test -lboost g++ test.cpp -o test -lboost_spirit And afew with -I and -L flags ...…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
0
votes
1 answer

BOOST_SPIRIT_DEBUG_NODE fails to compile on variant node

The following code doesn't compile BOOST_SPIRIT_DEBUG_NODE( expression ) where expression is a variant node (I'm not 100% certain variant nodes have anything to do with it, though). If I comment out the line, everything seems to run ok. Doing an…
kfmfe04
  • 14,936
  • 14
  • 74
  • 140
0
votes
0 answers

boost spirit and char16_t / UTF-16 support?

Is there any support, today or in the near future, for char16_t / UTF-16 in boost spirit? I did try the word count lexer example using char16_t but ran into al sorts of compile errors. Thanks, Henry Roeland
Henry Roeland
  • 492
  • 5
  • 19
0
votes
0 answers

Boost Spirit QI grammar slow for parsing delimited strings

Possible Duplicate: Boost Spirit QI slow I'm currently experimenting to use Boost Spirit QI for CSV data parsing. I'm running my tests with a 1GB CSV file. Each row looks like 123|123|\n and the file has about 60Mio. rows. I later want to…
muehlbau
  • 1,897
  • 13
  • 23
0
votes
1 answer

BUG on boost spirit?

I'm trying to migrate my code from VSC++ 6 to VSC++ 2008 express edition and from Intel compiler to Microsoft compiler. Everything were easy to migrate except that I'm receiving this errors now: 1>------ Build started: Project: Base, Configuration:…
0
votes
1 answer

Why is this Boost Spirit example not compiling?

I decided to learn Boost Spirit and started studying look here. But, I am disappointed because the very first example calc1.cpp isn't compiling on my computer and it gives this error message: calc1.cpp: In constructor…
Barış Akkurt
  • 2,255
  • 3
  • 22
  • 37
0
votes
1 answer

Boost Spirit Classic - micro SQL parser

I am new to boost spirit and playing around with the microSQL-Parser. It's not possible to parse quoted strings like: 'It's driving me crazy' in the example with the following grammar definition: string_literal = lexeme_d[ch_p( '\'' ) >> +(anychar_p…
user1584987
0
votes
1 answer

Boost.Spirit semantic action to parse a string does not work

I try to write a Boost.Spirit parser that parses a string that should represent a simple command like "print foo.txt". Each time the input fulfills the grammar a semantic action should be called. Here is the code: template struct…
Franz
  • 93
  • 6
0
votes
0 answers

Parsing a peculiar unary minus sign using Spirit.Lex

I'm trying to parse a language where a unary minus is distinguished from a binary minus by the whitespaces existing around the sign. Below are some pseudo rules defining how the minus sign is interpreted in this language: -x // unary x - y …
Haitham Gad
  • 1,529
  • 2
  • 13
  • 23
0
votes
1 answer

Parse elements into vector using boost::spirit, using semicolon or newlines as separators

I'd like to parse a sequence of integers into an std::vector, using boost::spirit. The integers may be separated by a semicolon or a newline. But this grammar doesn't compile: typedef std::vector IntVec; template
Frank
  • 64,140
  • 93
  • 237
  • 324
1 2 3
94
95