1[/============================================================================== 2 Copyright (C) 2001-2011 Joel de Guzman 3 Copyright (C) 2001-2012 Hartmut Kaiser 4 5 Distributed under the Boost Software License, Version 1.0. (See accompanying 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7===============================================================================/] 8 9[section What's New] 10 11[/////////////////////////////////////////////////////////////////////////////] 12[section:spirit_2_5_8_boost_1_74 Spirit V2.5.8 (Boost V1.74.0)] 13 14* Ceased dependence on Boost.Iostreams [gh_pr 599] 15 16[endsect] 17 18[/////////////////////////////////////////////////////////////////////////////] 19[section:spirit_2_5_8_boost_1_73 Spirit V2.5.8 (Boost V1.73.0)] 20 21* Boost.Endian is now used instead of its bundled prerelease version [gh_pr 550] 22* Narrowed Proto and Phoenix inclusion for a 5-10% inclusion speed-up [gh_pr 558] 23* Ceased dependence on Boost.Algorithm and Boost.LexicalCast [gh_pr 560] 24* Added static assertion for meaningless rule attribute qualifiers [gh_pr 561] 25* String literal was matching everything when `<boost/spirit/include/qi_auto.hpp>` 26 header is included [gh_pr 579] 27 28[endsect] 29 30[/////////////////////////////////////////////////////////////////////////////] 31[section:spirit_2_5_8_boost_1_72 Spirit V2.5.8 (Boost V1.72.0)] 32 33* `<cctype>` functions were called with negative values. [gh_pr 543] 34 35[endsect] 36 37[/////////////////////////////////////////////////////////////////////////////] 38[section:spirit_2_5_8_boost_1_71 Spirit V2.5.8 (Boost V1.71.0)] 39 40* Explicitly delete all non implemented assignment operators. [gh_pr 489] Romain Geissler 41* Port `hold_any` to Boost.Core typeinfo. [gh_pr 510] Andrey Semashev 42* Lex: Removed variadic `tokenize_and_phrase_parse`. [gh_pr 491] 43* Qi: Floating point parser fixes. [trac 11608] [gh 421] [gh 495] [gh 498] [gh 503] 44* utree: Missing `<cstring>` include in `utree_detail2.hpp`. [gh 502] 45 46[endsect] 47 48[/////////////////////////////////////////////////////////////////////////////] 49[section:spirit_2_5_8 Spirit V2.5.8] 50 51[heading What's changed from V2.5.7 (Boost V1.69.0) to V2.5.8 (Boost V1.70.0)] 52 53* Removed use of deprecated `boost/detail/iterator.hpp` header [gh_pr 432] 54* Macro name collisions and namespace conflicts with Boost.Endian were fixed. [gh_pr 349] [gh_pr 482] 55 56[heading Bug Fixes in Qi] 57* Added static asserts for rule skipper type problems. [gh_pr 427] 58* The `check_overflow` trait default implementation now relies on 59 `std::numeric_limits<T>::is_bounded` instead of `boost::integer_traits<T>::is_integral` [gh_pr 429] 60* Integer parsers should now handle user defined types. [gh_pr 429] 61*[/^] [*Note:] The `check_overflow` trait default implementation now relies on 62 `std::numeric_limits<T>::is_bounded` instead of `boost::integer_traits<T>::is_integral`. 63* Removed broken 1.0#INF parser. It was poorly documented and never worked. [gh 415] [gh_pr 458] [trac 8699] 64* The undocumented `make_attribute` trait was merged into `transform_attribute` trait. [gh_pr 471] 65* The `pre_transform`, `post_transform`, and `fail_transform` utility functions 66 were removed in favor of directly using `pre`/`post`/`fail` of the transform trait. [gh_pr 467] 67* The integer value parser now respects `std::numeric_limits<T>::digits10` value. [gh_pr 469] 68* Fixed underflow check for a `(Min % Base) == 0` corner case. [gh_pr 469] 69* Fixed an output value on overflow of IgnoreOverflowDigits=true integer parser. [gh_pr 470] 70* Special handling of references in `transform_attribute` was removed. [gh_pr 480] 71 72[heading Bug Fixes in Lex] 73* Fixed UB in default constructor of lexer with user specified token type. [gh_pr 420] 74 75[heading Bug Fixes in utree] 76* Fixed UB in tag getter due to left shift of negative value. [gh_pr 423] 77* Fixed double-conversion (`spirit::string -> std::string -> spirit::string`). [gh_pr 462] 78 79[endsect] 80 81[/////////////////////////////////////////////////////////////////////////////] 82[section:spirit_2_5_7 Spirit V2.5.7] 83 84[heading What's changed from V2.5.6 (Boost V1.68.0) to V2.5.7 (Boost V1.69.0)] 85 86* Drop own FP routines in favor of `boost::math`. [gh_pr 392] [trac 13531] 87* Missing visibility mark on exception types. [gh_pr 409] 88* Fixed transform_attribute ambiguity. [gh_pr 407] [gh 396] 89* to_utf8: Fixed wchar_t handling on Windows. [gh_pr 413] [gh 395] 90 91[endsect] 92 93[/////////////////////////////////////////////////////////////////////////////] 94[section:spirit_2_5_6 Spirit V2.5.6] 95 96[heading What's changed from V2.5.5 (Boost V1.67.0) to V2.5.6 (Boost V1.68.0)] 97 98[heading Bug Fixes in Qi] 99* Fixed ADT support by permutation and sequence_or operator. [gh_pr 376] 100* Specialize iterator_source for random access. [gh_pr 383] 101* Removed redundant check in `skip_over`. [gh_pr 373] 102 103[heading Bug Fixes in Karma] 104* Fixed UB in `get_absolute_value` function. [gh_pr 246] 105* Fixed use after scope bug if ADT getter returns by value. [gh_pr 375] [trac 6126] 106 107[endsect] 108 109[/////////////////////////////////////////////////////////////////////////////] 110[section:spirit_2_5_5 Spirit V2.5.5] 111 112[heading What's changed from V2.5.4 (Boost V1.66.0) to V2.5.5 (Boost V1.67.0)] 113 114There was no version bump and changelog for Boost V1.61.0-1.66.0 releases. 115 116[heading Bug Fixes in Qi or Karma] 117* Fixed keyword directives compilation on C++11. [gh_pr 256] [trac 11493] 118* Fixed subrules compilation. [gh_pr 279] [gh_pr 259] 119* Fixed subrules use after scope bug. [gh_pr 284] [trac 5270] 120* Fixed undefined behavior in sequential or operator. Underlying parsers 121 order of execution was dependent on compiler. [gh_pr 310] 122* Spirit was accidentally relaying on `types` typedef of `boost::optional`. 123 The typedef was removed in the new optional implementation. [gh_pr 271] [trac 12349] 124* Fixed problems with `BOOST_SPIRIT_NO_PREDEFINED_TERMINALS` (`attr_cast`, 125 `confix`, `distinct`, `keywords`, and `flush_multi_pass`). [gh_pr 314] [trac 13311] 126* Added missing copy assignment operator to `hold_any`. [gh_pr 361] [trac 8268] 127 128[heading Bug Fixes in Qi] 129* Fixed alternate operator. [gh_pr 201] [gh_pr 271] [trac 12349] 130* Fixed signed integer overflow in real parser. [gh_pr 245] 131* Fixed overflow problem in `uint_parser<signed T>`. [gh_pr 297] 132* Fixed `get_current_line`, `get_line_start`, and added `get_line_end`. [gh_pr 304] 133* Permutations parser were always initializing optionals. [gh_pr 319] [trac 12473] 134* Changed iterator concept static assert from `ForwardIterator` to 135 `ReadableIteratorConcept` && `ForwardTraversalConcept`. [gh_pr 320] 136* Added assertations to real parsers to ensure that the `parse_frac_n` from 137 user defined real policy does not return negative values and also to prevent 138 static analyzers false-positives. [gh_pr 358] 139 140[heading Bug Fixes in Karma] 141* Fixed alternate operator. [gh_pr 271] 142* Fixed `no_buffering_policy` missing copy constructor. [gh_pr 261] 143* The `ostream_iterator` was inheriting `std::iterator` which is deprecated 144 in C++17. [gh_pr 345] 145 146[heading Bug Fixes in Lex] 147* Store id as promoted type to allow out-of-enum values. [gh_pr 247] 148* Fixed C2001 'newline in constant' warning in generated lexers. [gh_pr 324] [trac 11540] 149 150[endsect] 151 152[/////////////////////////////////////////////////////////////////////////////] 153[section:spirit_2_5_4 Spirit V2.5.4] 154 155[heading What's changed from V2.5.3 (Boost V1.50.0) to V2.5.4 (Boost V1.61.0)] 156 157* Phoenix V2 was completely removed in Boost V1.56. 158* Introduced the new expect parser directive (see __qi_expectd__) in addition to 159 the expecation operator (see __qi_expect__). 160 161[endsect] 162 163[/////////////////////////////////////////////////////////////////////////////] 164[section:spirit_2_5_3 Spirit V2.5.3] 165 166[heading What's changed from V2.5.2 (Boost V1.49.0) to V2.5.3 (Boost V1.50.0)] 167 168* The deprecated headers are removed. It's been there for a couple of years now 169 and it's about time to do some cleanup. 170 171[endsect] 172 173[/////////////////////////////////////////////////////////////////////////////] 174[section:spirit_2_5_2 Spirit V2.5.2] 175 176[heading What's changed from V2.5.1 (Boost V1.48.0) to V2.5.2 (Boost V1.49.0)] 177 178* Integrated Vitaly Budovski's patch to add binary floating point parsers and 179 generators. 180* Fixed [trac 6253]: `lex::lexertl::generate_static_dfa` compiler errors if lexer has 181 wchar_t as underlying stream type. 182* Added the possibility to match a token range when parsing with a lexer by 183 using `qi::token(min, max)`, or `qi::tokenid(min, max)`. Both parsers match 184 any token with a token id in the range [min, max]. 185* Fixed a problem in [karma_align `center`]`(num)[a]` and 186 [karma_align `center`]`(num, g)[a]` if used inside a compound generator (such 187 as sequences, Kleene, list, or plus. 188* Fixed `karma::subrule` from the [@../../repository/doc/html/index.html repository] 189 (thanks to Lee Clagett for submitting a patch). 190* Fixed __karma__ examples (thanks to Lee Clagett for submitting a patch). 191* Fixed [trac 6368]: [multi_pass] clear_queue isn't forwarded to the storage policy. 192* Fixed a problem in __karma__ when a variant holding a container was used as 193 a generator inside a sequence. 194 195[endsect] 196 197[/////////////////////////////////////////////////////////////////////////////] 198[section:spirit_2_5_1 Spirit V2.5.1] 199 200[heading What's changed from V2.5 (Boost V1.47.0) to V2.5.1 (Boost V1.48.0)] 201 202* The `spirit::istream_iterator` (see __multi_pass__) now checks at 203 construction time whether the underlying stream has reached eof (end of file). 204* __qi__ now properly collapses attributes generated from optionals embedded 205 inside another optional parser (i.e. `-('(' > -int_ >> ')'). That means that 206 attributes like `boost::optional<boost::optional<int> >` will be collapsed 207 to `boost::optional<int>`. Thanks to Peter Schueller for reporting that 208 problem. 209* Actions attached to binary parsers now properly propagate the parser's 210 attribute. Thanks to Mathias Born for reporting this issue. 211 212[heading Bug Fixes in Lex] 213 214* Fixed [trac 5701]: lexertl token_value_type returns const unused for 215 nonconst ref. 216* Fixed a problem in the lexer (position_token) causing problems with enabled 217 parser debugging (MSVC2010). 218 219[endsect] 220 221[/////////////////////////////////////////////////////////////////////////////] 222[section:spirit_2_5 Spirit V2.5] 223 224[heading What's changed in __qi__ and __karma__ from V2.4.2 (Boost V1.46.0) to V2.5 (Boost V1.47.0)] 225 226This version of __spirit__ now supports the new version of __phoenix__ (V3), 227which has been released as part of Boost V1.47. Please note that this support 228is purely preliminary and should not be considered production quality. The 229reason why we are releasing this now is to enable people who want to use the 230new version of __phoenix__ in their code to do so without any conflicts with 231existing code using __spirit__. Generally, no __spirit__ code needs to be 232changed. To activate the use of __phoenix__ V3 for __spirit__ you need to 233define the following preprocessor constant for your builds (before including 234any of Spirit's include files): 235 236 #define BOOST_SPIRIT_USE_PHOENIX_V3 1 237 238[heading New Features in Qi or Karma] 239 240* Added __utree__, a generic, hierarchical, and dynamic data structure that can 241 represent abstract syntax trees. It's well integrated with __qi__ and 242 __karma__. It can be passed as an attribute while parsing to almost any 243 grammar. At the same time, it can be used as an attribute to generate output 244 from. 245* Added a new macro `BOOST_SPIRIT_TERMINAL_NAME` which takes in two parameters 246 (the terminal name and its type). Before, there was only one parameter 247 (the terminal name) and the type assumed the terminal name with `_type` 248 appended. This produced invalid C++ identifiers with terminals such as 249 `int_`, which resulted in generated a type `int__type` with a bogus double 250 underscore that is reserved for system use in C++. 251* The numeric parsers now allow arbitrary radix from 2..10 and 16 252* The placeholder `_val` now can be used in top level semantic actions outside 253 of any right hand side of a rule. Here is an example: 254`` 255 int i = 0 256 BOOST_TEST(test_attr("456", int_[_val = _1], i) && i == 456); 257`` 258 In this case _val refers to the attribute value, which is passed in to the 259 `parse()` or `phrase_parse()` functions. 260 Similar constructs are now possible in __karma__ as well: 261`` 262 int i = 123; 263 BOOST_TEST(test("123", int_[_1 = _val], i)); 264`` 265 This change unifies the handling of the `_val` placeholder allowing to use it 266 everywhere, not only in semantic actions attached to the right hand sides of 267 a rule. 268* Added support for __karma__ [unsigned_int unsigned numeric generators] with 269 arbitrary radix values in the (inclusive) range from `2` .. `36`. 270 271[heading Bug Fixes in Qi or Karma] 272 273* __qi__ integer literals (like `int_(10)`) do not consume input on failure 274 anymore. 275* Fixed [trac 5246]: mmap_file_iterator Fails to initialize correctly. 276* Fixed [trac 5246]: mmap_file_iterator Fails to initialize correctly. 277* Fixed a const correctness problem in `karma::real_policies<>` preventing the 278 use of const floating point types with the generator. Thanks to Jeroen 279 Habraken (a.k.a. VeXocide) for reporting it and for submitting a patch and 280 a test. 281* Fixed the __qi__ __qi_attr__ parser, the __qi__ __qi_symbols__ parser, and 282 the __karma__ [karma_symbols `symbols<>`] generator to properly handle 283 container attributes. These were broken in Boost V1.46.1 (thanks to 284 Aaron Graham and Joerg Becker for reporting the problems). 285* Fixed the __qi_stream__ parser to properly adjust the iterator of the 286 underlying input stream in the case when the stream parser component was 287 successful. Thanks to Brian O'Kennedy who reported the problem on 288 Stackoverflow. 289* Fixed failing Karma numerics generators when used with adapted ADTs (thanks 290 to Colin Rundel for reporting that problem). 291 292[heading Breaking Changes] 293 294* The __qi__ directive __qi_repeat__ erroneously implemented commit/rollback 295 semantics for its attribute, leaving it untouched if the directive failed. 296 This behaviour has been removed as it is inconsistent with similar components. 297 Existing code relying on this functionality will break. Please refer to the 298 __qi__ directive __qi_hold__ to see how to fix your code. 299* Added a preprocessor define `BOOST_SPIRIT_NO_PREDEFINED_TERMINALS` to prevent 300 instantiations of predefined terminal objects which slows down compile time 301 a lot. When `BOOST_SPIRIT_NO_PREDEFINED_TERMINALS` is defined, the user 302 instantiates the terminals that he needs. So, instead of writing `using qi::uint_` 303 one writes instead: `qi::uint_type uint_`. 304 305[heading New Features in Lex] 306 307* Added the possibility to specify a token id while creating a token definition 308 using `lex::char_` and `lex::string`. Both primitives now accept a second 309 parameter which will be interpreted as the requested token id for any token 310 generated from this definition. 311* Added a new token type `lex::lexertl::position_token<>`, which is essentially 312 plup-in compatible with the existing `lex::lexertl::token<>` class. However 313 it additionally stores the pair of iterators pointing to the underlying 314 matched input sequence as an iterator_range. 315 316[heading Bug Fixes in Lex] 317 318* Fixed a problem with associating token definitions with all states (using 319 `"*"` as the state name) when actions were attached to them. 320 321[heading Making Stuff Work] 322 323* Added the __karma__ customization point __customize_extract_from_container__, 324 which will be invoked instead of the older customization point 325 __customize_extract_from__ if the attribute is a container (__customize_is_container__ 326 returns `true` for the attribute). 327* The type `hold_any` now takes a template argument: `basic_hold_any<Char>`, 328 where `Char` is the character type used for the streaming operators 329 (`operator>>()` and `operator<<()`). The `hold_any` is still available as a 330 `typedef basic_hold_any<char> hold_any`; 331* Semantic actions now support attribute compatibility. This is a breaking 332 change but #define BOOST_SPIRIT_ACTIONS_ALLOW_ATTR_COMPAT must be defined 333 in order for the new behavior to kick in. By default, the old behavior 334 is still in place. 335* Alternatives now support attribute compatibility. 336* The attribute handling for container attributes of sequences and container 337 components (list, Kleene, Plus, and repeat) has been completely rewritten. 338 It now supports many more use cases and behaves much more predictable than 339 the older version. Thanks to Thomas Taylor, Richard Crossley, Semen, 340 Adalberto Castelo, and many others for reporting bugs and helping in making 341 the new code behave as expected. 342 343[endsect] 344 345[/////////////////////////////////////////////////////////////////////////////] 346[section:spirit_2_4_2 Spirit V2.4.2] 347 348[heading What's changed in __qi__ and __karma__ from V2.4.1 (Boost V1.45.0) to V2.4.2 (Boost V1.46.0)] 349 350[heading New Features in Qi or Karma] 351 352* Added keyword indexes for __qi__ and __karma__ to the docs. 353* Introduced a new customization point __customize_assign_to_container_from_value__ 354 which is invoked for container attributes whenever an attribute value needs to 355 be added to that container. 356* Replaced `proto::lit` (which was used to implement `spirit::lit`) with a 357 separate version allowing to distinguish 'lit(foo)' from 'foo'. This should 358 not change any semantics nor should it break exiting code. 359* Added the __qi__ directive __qi_as__ (and its string specializations 360 __qi_as_string__ and __qi_as_wstring__) enabling assignment of container 361 attribute types as a whole. 362* Added the __karma__ directive __karma_as__ (and its string specializations 363 __karma_as_string__ and __karma_as_wstring__) enabling handling of container 364 attribute types during output generation as a whole. 365* In __qi__, `lit()` can now be used for numeric literals as well. 366* The __qi_symbols__ parser component now has an explicit name used for 367 error handling and debugging, which can be set using the new member functions 368 `sym.name(...)`. Thanks to teajay for contributing a patch. 369* The [karma_symbols `symbols<Attrib, T>`] generator component now has an 370 explicit name used for error handling and debugging, which can be set using 371 the new member functions `sym.name(...)`. 372 373[heading Bug Fixes in Qi or Karma] 374 375* Fixed a problem in handling container attributes for __qi__ sequences, which 376 caused the properly parsed attributes of the first elements being overwritten 377 by later elements of the sequence. 378* Fixed the __karma__ generator [karma_string `string(s)`]. It succeeded even 379 if `s` matched only a prefix of its attribute. 380 381[heading What's changed in __lex__ from V2.4.1 (Boost V1.45.0) to V2.4.2 (Boost V1.46.0)] 382 383[heading New Features in Lex] 384 385* Added `qi::tokenid()` primitive parser allowing to match arbitrary lexer 386 tokens based on a given token id. The difference to `qi::token()` is, that it 387 exposes as its attribute the token id of the matched token (instead of the 388 iterator_range of the matched input, as `qi::token()` does). 389* Added an additional template parameter to the default `lexertl::token<>` 390 definition: the type of the token id. This type defaults to `std::size_t`. 391 Any type used as the id type needs to be (explicitly) convertible from 392 `std::size_t`. 393* It's now possible to attach lexer semantic actions to token definitions 394 based on `lex::char()` and `lex::string()`. 395* It's now possible to specify a lexer state the lexer should automatically be 396 switched to after matching certain tokens. For this reason the token 397 definition syntax has been extended: 398`` 399 template <typename Lexer> 400 struct lexer : lex::lexer<Lexer> 401 { 402 lexer() 403 { 404 int_ = "[1-9][0-9]*"; 405 this->self("INITIAL", "TARGETSTATE") = int_; 406 } 407 lex::token_def<int> int_; 408 }; 409`` 410 This example lexer will match a `int_` token and will switch the lexer to 411 the state `"TARGETSTATE"` afterwards. If the second argument is not 412 specified the lexer remains in the previous state (as before). 413* The parser primitives `qi::token` and `qi::tokenid` can now be used without 414 any argument. In this case they will match any token. 415* `lex::lit()` has been removed. 416 417[heading Bug Fixes in Lex] 418 419* Fixed an issue in the Lexer giving problems while assigning tokens to all 420 lexer states at once. This is now possible by simply using "*" as the state 421 name. For instance this will add the token int_ to all lexer states: 422`` 423 template <typename Lexer> 424 struct lexer : lex::lexer<Lexer> 425 { 426 lexer() 427 { 428 int_ = "[1-9][0-9]*"; 429 this->self("*") = int_; 430 } 431 lex::token_def<int> int_; 432 }; 433`` 434 Note: the `self("*") = ...` must be executed after all lexer states have 435 been introduced to the lexer object. 436 437* Fixed lexer lookahead. The lookahead operation is now evaluated using the 438 lexer state the `token_def` instance used as its argument is associated 439 with. 440* Fixed a problem in the `multi_pass` iterator causing wrong tokens to be 441 returned to the user. This could happen in conjunction with a lexer which 442 performed lexer state changes and was using `pass_fail` in semantic actions 443 to make a token match fail. 444 445[heading Known Problems] 446 447* __qi__ integer literals (like `int_(10)`) consume input on failure, which can 448 lead to problems with the alternative operator. 449 450[endsect] 451 452[/ spirit_2_4_2] 453 454[/////////////////////////////////////////////////////////////////////////////] 455[section:spirit_2_4_1 Spirit V2.4.1] 456 457[heading What's changed in __qi__ and __karma__ from V2.4 (Boost V1.44.0) to V2.4.1 (Boost V1.45.0)] 458 459[heading Bug Fixes] 460 461* Fixed broken __qi__ debugging facilities for optional attributes. 462* The __qi__ auto parsers and __karma__ auto generators will now properly work 463 with `signed char` and `unsigned char` as well. 464* Fixed a problem in the multi_pass fixed_queue policy. 465* Enabled proper modifier handling for the __qi_skip__ directive. 466* Fixed a floating point formating problem in Karma ([trac 4742]). 467* Fixed a problem in [qi_repeat `repeat`]`[]`, which caused the `first` 468 iterator not to be reset on certain parsing failures (see 469 [@http://stackoverflow.com/questions/4009752/boost-spirit-bug-when-mixing-alternates-with-optionals Stack Overflow]). 470 471[endsect] [/ spirit_2_4_1] 472 473[/////////////////////////////////////////////////////////////////////////////] 474[section:spirit_2_4 Spirit V2.4] 475 476[heading What's changed in __qi__ and __karma__ from V2.3 (Boost V1.43.0) to V2.4 (Boost V1.44.0)] 477 478[heading New Features] 479 480* The customization point __customize_transform_attribute__ now takes an additional template 481 parameter `Domain` allowing to better specialize the customization point 482 for either `qi::domain` or `karma::domain`. 483 484[important This is a interface breaking change requiring to modify existing 485 code. If you have a specialization of this customization point in 486 your code you need to add the specialization for the new template 487 parameter, i.e. either `qi::domain` or `karma::domain`.] 488* Semantic actions in __qi__ now implicitly invoke the function `pre` of the 489 customization point __customize_transform_attribute__ to convert the supplied 490 attribute to the exposed attribute type, as needed. The functions 491 `post` and `fail` of this customization point are not invoked by this 492 component (as this would not make any sense). 493* Semantic actions in __karma__ now implicitly invoke the function `pre` of the 494 customization point __customize_transform_attribute__ to convert the supplied 495 attribute to the consumed attribute type, as needed. 496* Added the __karma__ __karma_skip__ directive which is semantically equivalent 497 to the __karma__ __karma_omit__ directive except that it will not execute the 498 embedded generator. 499* Added debug support to __karma__ rules. 500* Added strict mode to __karma__, leaving the current behavior (unchanged) as 501 relaxed mode. Added __karma__ compile time directives `strict[]` and 502 `relaxed[]` allowing to switch between the two. 503* Added __karma__ __karma_duplicate__ directive which duplicates the supplied 504 attribute to all elements of an embedded generator sequence. 505 506[heading Bug Fixes] 507 508* Components in __qi__ and __karma__ now accept one element Fusion sequences as 509 their attributes as long as the element in the Fusion sequence is compatible 510 with the component's attribute type. 511* The character range parser and generator components can now additionally be 512 written as `char_("a", "z")` instead of `char_('a', 'z')` making it 513 consistent with the syntax of the `char_('a')` component (which can be 514 written as `char_("a")` as well). Please note that the mixed syntax forms, 515 i.e. `char_('a', "z")` and `char_("a", 'z')`, are not supported. 516* Fixed attribute handling in __karma__ sequences when all elements of that 517 sequence consume either the same attribute type or containers of that 518 attribute type and the passed in attribute is a container of that attribute 519 type as well. In this case using a repetitive container was supported only 520 when it was the last element of the sequence. Now it is possible to 521 have a [karma_repeat `repeat`]`(num)[a]` generator at any position (well, 522 actually you can have any repetitive container at any position now, but this 523 doesn't always make sense as it normally would eat up all supplied attribute 524 values). 525* Fixed debug output for variants where a variant element is an STL sequence. 526* Fixed a problem in multi_pass, avoiding to loose a character at end of input 527 when switching iterators. 528 529[heading What's changed in __lex__ from V2.3 (Boost V1.43.0) to V2.4 (Boost V1.44.0)] 530 531[heading New Lexer Features] 532 533* The lexer is now well integrated with the debug output generated by Qi's 534 simple_trace utility. Tokens are printed as: '<' matched sequence '>'. 535 536[heading Lexer Bug Fixes] 537 538* Fixed a problem with using lex::_val as a rvalue in lexer semantic 539 expressions. 540* Token values are now available for introspection (as an iterator_range) 541 inside lexer semantic expressions as well. 542 543[endsect] [/ spirit_2_4] 544 545[/////////////////////////////////////////////////////////////////////////////] 546[section:spirit_2_3 Spirit V2.3] 547 548[heading What's changed in __qi__ and __karma__ from V2.2 (Boost V1.42.0) to V2.3 (Boost V1.43.0)] 549 550[heading New Features] 551 552* The customization point `transform_attribute` now has to implement a third 553 function: `void fail(Exposed&)`, which normally will do nothing. This function 554 will be called whenever the right hand side of the `rule` (or the embedded 555 parser of `attr_cast`) fail parsing. This change affects /Qi/ only. See 556 the description of the __customize_transform_attribute__ for more details. 557* Added support for attribute sequences created with `BOOST_FUSION_ADAPT_CLASS` 558 and `BOOST_FUSION_ADAPT_CLASS_NAMED`. This support requires to include the 559 new header file: `#include <boost/spirit/include/support_adapt_class_attributes.hpp>`. 560* Added `karma::ostream_iterator` as a counterpart to `qi::istream_iterator` 561 (see new header file: `#include <boost/spirit/home/support/iterators/ostream_iterator.hpp>`). 562* Added `qi::hold` allowing to make sure the embedded parser does not touch 563 the passed attribute in case it fails parsing. 564* Added [qi_no_skip `qi::no_skip`] directive, which is equivalent to 565 `qi::`__qi_lexeme__, except that it does not pre-skip. 566* Added [karma_no_delimit `karma::no_delimit`] directive, which is equivalent to 567 `karma::`__karma_verbatim__, except that it does not perform a post-delimiting 568 step. 569* Added a new input_iterator policy for the `multi_pass` iterator framework 570 (named `buffering_input_iterator`) allowing to wrap underlying input 571 iterators which do not store the last character read from the input (such as 572 `std::istream_iterator`). This is now used as the default input policy. 573 574[heading Bug Fixes] 575 576* Sequences (in /Qi/ and /Karma/) may now have a component having no attribute 577 even as their last element. 578* Sequences (in /Qi/ and /Karma/) can now take one element attribute sequences 579 as their attribute. 580* Constructs like `karma::buffer[karma::buffer[...]]` don't result in 581 performing double buffering anymore. The same is true if an alternative is 582 wrapped into a `karma::buffer[]` directive (as for instance: `buffer[a] | b`). 583* The __karma__ output iterator (which is used internally, but also is exposed 584 when using the stream based API) is now properly copyable (thanks to Jonas 585 Persson for reporting this issue). 586* The default `multi_pass` iterator is now usable with underlying input 587 iterators which do not store the last character read from the input (such as 588 `std::istream_iterator`). Thanks to Larry Evans and Peter Schueller for 589 independently reporting this problem. 590* The directive `karma::omit[]` now does not accept an arbitrary attribute 591 type anymore. 592* The __karma__ predicates (the and-predicate and the not-predicate) and the 593 directive `karma::omit[]` now disable output altogether instead of 594 intercepting the output into a buffer which got discarded as before. 595* Fixed `karma::rule` to properly handles optional attributes. 596 597[heading What's changed in __lex__ from V2.2 (Boost V1.42.0) to V2.3 (Boost V1.43.0)] 598 599[heading New Lexer Features] 600 601* The library does not minimize the generated lexer tables for dynamic lexers by 602 default anymore. The generated tables will now be minimized for static lexers 603 only. 604* The function `lexer<>::init_dfa()` now takes a single boolean parameter 605 (which defaults to `false`) allowing to force minimization of the generated 606 lexer tables. 607 608[endsect] [/ spirit_2_3] 609 610[//////////////////////////////////////////////////////////////////////////////] 611[section:spirit_2_2 Spirit V2.2] 612 613[heading What's changed in __qi__ and __karma__ from V2.1 (Boost V1.41.0) to V2.2 (Boost V1.42.0)] 614 615[heading New Features] 616 617* Added `auto_` component in __qi__ and __karma__, added API functions 618 `qi::`__create_parser__ and `karma::`__create_generator__. 619* Added `auto_` based overloads for all API functions taking no attributes (see 620 [link spirit.qi.reference.parse_api /Qi/ API] and 621 [link spirit.karma.reference.generate_api /Karma/ API]). 622* Added [karma_columns `karma::columns`] directive. 623* Added [karma_symbols `karma::symbols<Attr, T>`] generator. 624* The __qi__ customization point __customize_push_back_container__ now returns 625 a `bool` to report whether the item has been added to the container. 626* Added an overload for [karma_maxwidth `karma::maxwidth`] directive allowing 627 to specify an additional parameter (any compatible output iterator) receiving 628 the 'overspilled' output (output not fitting into the maxwidth limit). 629* It is now possible to use Phoenix expressions as __karma__ attributes. 630* Added [link spirit.support.multi_pass.reading_from_standard_input_streams `basic_istream_iterator<Char, Traits>`] 631 usable as an equivalent for `std::istream_iterator` except its a __fwditer__ 632 allowing to parse directly from any `std::basic_istream`. 633* Added `qi::`__qi_matches__ directive. 634 635[heading Bug Fixes] 636 637* Fixed karma::alternatives to work with embedded containers of hold_any (i.e. 638 constructs like `*stream | "empty"` (which fixes the Karma example 639 basic_facilities.cpp). 640* Fixed numeric __karma__ generators for character types. 641* Fixed `qi::repeat[]` for unused attributes. 642* Fixed rare compilation problem in `karma::repeat[]`. 643* Fixed sequences in __qi__ and __karma__ to compile properly if the attribute 644 is a (STL) container of (STL) containers. 645* Fixed a problem in `lex::token_def::what`. 646* Fixed __qi__ symbols not to match substrings anymore. Added 647 `qi::symbols::prefix_find` to allow matching of (prefix-) substrings. 648* Inherited parameters for rule's usually have to be wrapped in function 649 objects (i.e. `phoenix::val`), for integral values this was not necessary. 650 Now all string types can be passed without being wrapped as well (i.e. 651 `std::string`, `char const*`, etc.). 652* Added concept checks to all relevant __qi__ API functions enforcing the 653 iterator to be at least of the type `std::forward_iterator_tag`. 654* Fixed the `qi::match` and `qi::phrase_match` set of API functions not to 655 internally utilize a `std::stream_iterator` anymore as this iterator is of 656 the type `std::input_iterator_tag` only, which is not sufficient for __qi__. 657 658[endsect] [/ spirit_2_2] 659 660[//////////////////////////////////////////////////////////////////////////////] 661[section:spirit_2_1 Spirit V2.1] 662 663[heading What's changed in __qi__ and __karma__ from V2.0 (Boost V1.37.0) to V2.1 (Boost V1.41.0)] 664 665* __spirit__ is now based on the newest version of __boost_proto__ 666* `qi::phrase_parse`, `qi::phrase_format` now post-skip by default. 667* `karma::generate_delimited` and `karma::format_delimited` now don't do pre- 668 delimiting by default. 669* Changed parameter sequence of `qi::phrase_parse`, `qi::phrase_match`, 670 `karma::generate_delimited`, and `match_delimited`. The attribute is now 671 always the last parameter. 672* Added new overloads of those functions allowing to explicitly specify the 673 post-skipping and pre-delimiting behavior. 674* Added multi attribute API functions 675* Removed `grammar_def<>` 676* Removed functions `make_parser()` and `make_generator()` 677* Removed `qi::none` and `karma::none` 678* Sequences and lists now accept a standard container as their attribute 679* The string placeholder terminal now can take other strings as its parameter 680 (i.e. std::string) 681* All terminals taking literals now accept a (lazy) function object as well 682* All placeholders for terminals and directives (such as `int_`, `double_`, 683 `verbatim`, etc.) were previously defined in the namespace `boost::spirit` 684 only. Now these are additionally imported into the namespaces 685 `spirit::qi`, `spirit::karma`, and `spirit::lex` (if they are supported by 686 the corresponding sub-library). 687* The terminal placeholders `char_` and `string` are not defined in the 688 namespace `boost::spirit` anymore as they have been moved to the 689 character set namespaces, allowing to do proper character set 690 handling based on the used namespace (as `spirit::ascii`, etc.) 691* The `uint`, `ushort`, `ulong`, and `byte` terminal placeholders have been 692 renamed to `uint_`, `ushort_`, `ulong_`, and `byte_`. 693* `qi::skip[]` now re-enables outer skipper if used inside `lexeme[]` 694* Added `karma::maxwidth[]` directive (see [karma_maxwidth `maxwidth`]) 695* Added `karma::omit[]` allowing to consume the attribute of subject generator 696 without emitting any output (see __karma_omit__). 697* Added `karma::buffer[]` allowing to avoid unwanted output to be generated in 698 case of a generator failing in the middle of a sequence (see __karma_buffer__). 699* `karma::delimit[]` now re-enables outer delimiter if used inside `verbatim[]` 700* Karma: added and-predicate (`operator&()`) and not-predicate (`operator!()`) 701 Both now always consume an attribute. 702* Karma: changed semantics of `char_()`, `string()`, `int_()` et.al., and 703 `double_()` et.al.: all of these generators now always expose an attribute. 704 If they do not have an associated attribute, they generate their immediate 705 literal. If they have an associated attribute, the generators first test if 706 the attribute value is equal to the immediate literal. They fail and do not 707 generate anything if those are not equal. Otherwise they generate their 708 immediate literal. For more information see for instance [signed_int `int_`]. 709* `karma::lit()` can now be used to generate integer and floating point numbers 710* `qi::rule` and `karma::rule` now can be directly initialized using their copy 711 constructor. I.e. this works now: `qi::rule<...> r = ...some parser...;`. 712* Added `qi::attr()` exposing its immediate parameter as its attribute. 713* Added boolean parsers and generators (`bool_`, `true_`, `false_`). 714* Added `attr_cast<>` enabling in place attribute type conversion in Qi and Karma 715 grammars. 716* Almost all Karma generators now accept `optional<>` attributes and will fail 717 generating if this is not initialized. 718* Qi and Karma rules now automatically detect whether to apply auto-rule 719 semantics or not (no need for using `operator%=()` anymore, even if it's still 720 existing). Auto-rule semantics are applied if the right hand side has no 721 semantic actions attached to any of the elements. This works for rule 722 initialization and assignment. 723* Qi and Karma rules now do intrinsic attribute transformation based on the 724 attribute customization point __customize_transform_attribute__. 725* All char_ parsers now always expose an attribute. Earlier `char_(...)` didn't 726 expose an attribute while `char_` did. If you need a literal parser not exposing 727 any attribute use `lit(...)` instead. 728* The qi::int_spec, qi::real_spec, karma::int_spec, and karma real_spec types 729 do not exist anymore. These have been replaced with qi::int_parser, 730 qi::real_parser, karma::int_generator, and karma::real_generator. 731 732[heading What's changed in __lex__ from V2.0 (Boost V1.37.0) to V2.1 (Boost V1.41.0)] 733 734Here is a list of changes in __lex__ since version 2.0. __lex__ 2.1 is a 735complete rewrite of the __lex__ distributed with Boost V1.37. As with all 736code portions of the __spirit__ library, __lex__ is usable as stand alone piece. 737__lex__ now uses the infrastructure provided by __spirit__ version 2.1. 738 739* The lex::lexer_def class has been renamed to lex::lexer, while the original 740 class lex::lexer does not exist anymore. This simplifies the creation of 741 lexers. 742* The lex::lexer class does not have the function `def(Self& self)` anymore, 743 token definitions can be added to the lexer at any time, usually in the 744 constructor of the user defined lexer class: 745`` 746 template <typename Lexer> 747 struct example_tokens : lex::lexer<Lexer> 748 { 749 example_tokens() 750 { 751 // your token definitions here 752 this->self = ... 753 } 754 }; 755`` 756* The new lexer class can now be used directly. The function `make_lexer()` has 757 been removed. 758* The `lex::tokenize_and_parse()` and `lex::tokenize_and_phrase_parse()` functions 759 have been changed to match the parameter sequence as implemented by the 760 `qi::parse()` and `qi::phrase_parse()` functions. 761 Both take an arbitrary number of attribute arguments as the last 762 parameters. This argument list is limited by the macro 763 `SPIRIT_ARGUMENTS_LIMIT`. 764* The `lex::lexertl_lexer`, and `lex::lexertl_token` 765 classes have been moved to the `lex::lexertl` namespace and the names have been 766 changed to `lex::lexertl::lexer`, `lex::lexertl::token`. This also applies to 767 the `lex::lexert_actor_lexer`, and the `static_lexertl_*` family of types. 768* The class `lex::lexertl_token_set` has been removed. This functionality is now 769 available from the lexer class. 770* The __lex__ library has been updated to use the newest version of Ben 771 Hansons __lexertl__ lexer construction library (Boost review pending). 772* The `lex::lexer<Lexer>` template constructor now takes an optional parameter 773 specifying the `match_flags` to be used for table generation. Currently, there 774 are the following flags available: 775`` 776 match_flags::match_default, // no flags 777 match_flags::match_not_dot_newline, // the regex '.' doesn't match newlines 778 match_flags::match_icase // all matching operations are case insensitive 779`` 780 If no parameter is passed to the constructor, `match_flags::match_default` is 781 used, i.e. the `.` matches newlines and matching is case sensitive. 782 783* The `char_()` and `string()` placeholders can now be used for token 784 definitions and are synonymous with `token_def`. 785* Lexer semantic actions now have to conform to a changed interface (see 786 __sec_lex_semactions__ for details). 787* Added placeholder symbols usable from the inside of lexer semantic actions 788 while using Phoenix: `lex::_start`, `lex::_end`, `lex::_eoi`, `lex::_state`, 789 `lex::_val`, and `lex::_pass` (see __sec_lex_semactions__ for more details). 790* Added (lazy) support functions usable from the inside of lexer semantic 791 actions while using Phoenix: `lex::more()`, `lex::less()`, and 792 `lex::lookahead()` (see __sec_lex_semactions__ for more details). 793* Removed `lex::omitted` in favor of `lex::omit` to unify the overall 794 interface. 795 796[endsect] [/ spirit_2_1] 797 798[/////////////////////////////////////////////////////////////////////////////] 799[section:spirit_1_x Spirit Classic] 800 801The Spirit V1.8.x code base has been integrated with Spirit V2. It is 802now called __classic__. Since the directory structure has changed (the 803Spirit Classic headers are now moved to the 804'''$BOOST_ROOT/boost/spirit/home/classic''' directory), we created 805forwarding headers allowing existing applications to compile without 806any change. However, these forwarding headers are deprecated, which 807will result in corresponding warnings generated for each of the 808headers starting with Boost V1.38. The forwarding headers are expected 809to be removed in the future. 810 811The recommended way of using Spirit Classic now is to include header 812files from the directory '''$BOOST_ROOT/boost/spirit/include'''. All 813Spirit Classic headers in this directory have 'classic_' prefixed to 814their name. For example the include 815 816 #include <boost/spirit/core/core.hpp> 817 818now should be written as: 819 820 #include <boost/spirit/include/classic_core.hpp> 821 822To avoid namespace conflicts with the new Spirit V2 library we moved 823Spirit Classic into the namespace `boost::spirit::classic`. All 824references to the former namespace `boost::spirit` need to be adjusted 825as soon as the header names are corrected as described above. As an 826alternative you can define the preprocessor constant 827`BOOST_SPIRIT_USE_OLD_NAMESPACE`, which will force the Spirit Classic 828code to be in the namespace `boost::spirit` as before. This is not 829recommended, though, as it may result in naming clashes. 830 831The change of the namespace will be automatically deactivated whenever 832the deprecated include files are being used. This ensures full 833backwards compatibility for existing applications. 834 835[endsect] [/ spirit_1_x] 836 837[endsect] 838