217 Commits

Author SHA1 Message Date
Jeff Trull ee5bfe517f Fix slex and lexertl example token counts for MSVC
The non-MS-extension case was updated correctly but this was missed
until Appveyor CI
2026-05-06 12:28:40 -07:00
Jeff Trull 147b685795 Introduce c++23 feature flag and condition size_t literals with it 2026-05-06 12:28:40 -07:00
Jeff Trull 453493e640 Tweak PR #241 for correctness and tidy code
- Fix RE2C code for numbers (binary and digit separators)
- Revert to RE2C version 1.0.2, for now
- Revamp token ids to minimize changes
- Restore existing and more accurate name OPTSIGN in slex
- Add binary literal support to lexertl
- Fix xlex support for size_t literals
- Add test tokens for octal, binary, and hex literals
2026-05-06 12:28:40 -07:00
Andreas Pokorny f776d2ed40 fix(lexer): support size_t literal, separator chars, 'module'
The integer parsing grammars still have to be updated.
2026-05-06 12:28:40 -07:00
Andrey Semashev 27392d2cc1 Avoid including deprecated header.
`boost/detail/atomic_count.hpp` was moved to `boost/smart_ptr/detail` and the old header is deprecated and emits warnings.
2025-02-28 23:23:36 +03:00
René Ferdinand Rivera Morell 7ce8b53d9d Add support for modular build structure. (#214)
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add wave tool build to all target.

* Add missing NO_LIB usage requirements.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
2024-08-26 22:01:03 -07:00
Jeff Trull 7265c575a8 Use vsnprintf instead of vsprintf
Issue noted by MSVC (as a warning)
2024-06-25 16:31:13 -07:00
Jeff Trull d8474c3e2d Handle some previously deprecated, now removed, filesystem code
- convenience.hpp is removed
- no_push and branch_path are removed
2024-01-14 15:06:47 -08:00
Jeff Trull 3586cf3706 Support \e and \E in character and string literals
Updates the non-strict lexer to support e and E, both with value 27
(ASCII ESC). Also adds tests for lexing these literals, and checks
that they are usable in conditional preprocessor expressions.
2022-11-07 22:44:24 -08:00
Jeff Trull 83cb264b5f Use constexpr instead of macros for tokenid constants in samples (#167)
Under Visual Studio 2019 (and possibly 2017), building with /permissive- causes three samples to fail to compile. Adding the /Zc:twoPhase- option makes them compile successfully again. See bug #160 for more details.

It's unclear what the source of this issue is, but using constexpr variables instead of a macro is better practice anyway, and fixes the errors.
2022-06-22 17:35:44 -07:00
Jeff Trull 572f4f644a Clean up C++11 requirements further (#157)
- Test the requirement of "constexpr" for the deprecation error
- Ensure C++11 requirements are checked for the samples build
2022-03-09 14:49:54 -08:00
Jeff Trull 9382ac9e8b MSVC-related cleanups (#150)
* Replace several sprintf's with boost::format or std::to_string
* Clean up MSVC builds by removing pre-C++11 toolsets
* Update build badges
2022-02-20 17:54:26 -08:00
Jeff Trull a95fa213ef Clean up sprintf usage (#146)
* Replace some sprintfs using boost::format and std::to_string to fix warnings and possibly #145
2022-01-28 15:04:20 -08:00
Jeff Trull 88369abfd5 Remove long-deprecated hooks API
Removal in 1.76 was noted in the docs and warned about since 1.74.
2020-12-13 15:53:32 -08:00
Jeff Trull 0ff9eafa04 Add the spaceship <=> operator to the C++20 tokens 2020-10-24 22:01:43 -07:00
Giovanni Mascellani cf26b1567c Fix typo in copyright headers. 2020-10-15 15:52:21 +02:00
Jeff Trull 06c2ca14bf Clarify loop logic to satisfy a Clang warning
Clang warns that a for loop in a sample increments an iterator in both
the header and the body. This seems to be done on purpose to skip
whitespace. I used std::advance in the header instead, for clarity.

Also cleaned up an unused type in the same file while I was there.
2020-09-24 20:58:15 -07:00
Jeff Trull 465fe2291f Merge pull request #109 from jefftrull/feature/cpp20-tokens
Introduce C++20 tokens
2020-08-16 11:55:39 -07:00
Jeff Trull 200f91e71d Introduce C++20 tokens 2020-08-11 13:17:01 -07:00
Jeff Trull 35fc5aa381 Add C++11 token support to all lexers
Support was already in slex, though it wasn't covered by the token
test. This updates the tests while adding virtually identical code
to lexertl and xlex.
2020-08-10 04:47:04 -07:00
Jeff Trull ca08e74947 Correct spelling of thread_local keyword 2020-08-10 04:41:49 -07:00
Jeff Trull 9d68ca319a Track the location tokens were expanded from, for __LINE__ and __FILE__
An (optional) extra position field is added to token_data and set for
any identifier token created from a macro expansion. This information
is used to correctly calculate the filename and line number.
2020-07-20 20:51:14 -07:00
Jeff Trull ee0a7c14c5 Implement __has_include() (#102)
Resolve #96 by introducing C++17 feature (and frequent vendor extension) __has_include(), along with appropriate unit tests and documentation updates
2020-06-27 07:22:52 -07:00
Jeff Trull d2610b0584 Try a potential fix for a Windows portability problem
filesystem paths in MSVC are based on wchar_t so my 8b regex (and
std::string) were a problem for matching against native paths. Trying
again with the generic std::string interface to see if it works.
2020-06-26 17:57:26 -07:00
Jeff Trull 8504d24bf8 Introduce a new sample that checks macro naming conventions (#97)
* Introduce a new sample that checks macro naming conventions

This has a direct use in Boost's own QA checks and demonstrates
the use of macro definition and include guard callbacks, as well
as Boost.Filesystem.
2020-06-15 13:22:21 -07:00
Jeff Trull 6fd0da8780 Rename include guard macros that don't begin with BOOST_ 2020-06-15 10:52:30 -07:00
Jeff Trull 895ea836e9 Remove unused headers
Reduce build time by:
- using iosfwd instead of iostream, where possible
- where iostream is necessary but only used for debugging,
  making its inclusion conditional
- removing old C-style headers

I used IWYU to guide this work
2020-05-19 10:41:22 -07:00
Andrey Semashev 2970a40ac4 Remove use of deprecated header boost/detail/iterator.hpp. (#91)
Remove deprecated boost header and use std::iterator_traits instead
2020-05-12 08:28:52 -07:00
Jeff Trull 2e8eeeeb4d Add BOOST_OVERRIDE to virtual functions in derived classes (#89) 2020-04-13 21:12:34 -07:00
Jeff Trull b68940a83b Disallow mixed-case long long integer literals (#80)
- Update all four lexers to allow ll/LL but not lL/Ll
- Add unit tests for checking
- Remove invalid token from test
2020-03-15 22:54:01 -07:00
Jeff Trull 849da9fb6a Remove linking to newly header-only date_time (#81)
Boost develop branch has an updated date_time that is header-only so
Wave's builds will now fail unless this dependency is removed.
2020-03-15 17:37:19 -07:00
Jeff Trull 750e0cb68c Repair lexertl lexer and add to test suite (#78)
- Update DFA index code to reflect newer Spirit versions
- Update corresponding static lexer, adding explanatory comments
- Incorporate lexertl into test framework
2020-03-13 12:24:49 -07:00
Jeff Trull 940071ed55 Repair xlex and add to test suite (#79)
* Pass tests by matching lexertl blank handling
* Remedial improvement to position tracking to avoid exception
* Fix token statistics sample's count map index calculation
* Add xlex to test suite

Also, prune includes somewhat.
2020-03-12 22:37:46 -07:00
Hartmut Kaiser 40945efd71 Merge pull request #68 from jefftrull/bugfix/waveidl-lexer
Restore waveidl sample to working condition
2020-02-12 08:59:45 -06:00
Jeff Trull fd9c53001c Restore waveidl sample to working condition
- use the idllexer generator instead of the cpp one
- eliminate a double free encountered during fix
2020-02-11 22:10:29 -08:00
Jeff Trull 46c348fd4b Merge branch 'develop' into bugfix/include-next 2020-02-11 13:15:41 -08:00
Jeff Trull 592c55a2ab Incorporate samples and wave driver into CI system
Also:
- fix a few minor issues that were revealed by the process
- add build status badge in minimal README
2020-02-10 21:20:37 -08:00
Jeff Trull df4bff9b03 Fix invalid C++03 syntax
Some bozo broke this last year.

(It was me)
2020-02-10 12:03:07 -08:00
Jeff Trull 5efdff6766 Merge branch 'develop' into bugfix/include-next 2020-02-09 21:44:05 -08:00
Jeff Trull 9413a718f6 tighten up effect of SUPPORT_INCLUDE_NEXT 2020-02-09 15:05:19 -08:00
Jeff Trull a9cf9c4757 Replace deprecated iterator trait with new name 2020-02-09 14:03:37 -08:00
Jeff Trull 38b1f18651 Merge pull request #45 from jefftrull/bugfix/link_fs
Link against Boost.Filesystem to resolve missing symbols in samples
2020-01-11 22:03:01 -08:00
Jeff Trull c530f720d9 Merge pull request #46 from jefftrull/bugfix/instantiate_stdstring
Instantiate lexers with std::string, not flex_string
2020-01-11 22:02:35 -08:00
Jeff Trull 21c3813265 Fix compile errors in 2 samples under gcc 2019-05-03 11:14:50 -07:00
Jeff Trull 27dc2862a8 Instantiate lexers with std::string, not flex_string
The main programs of these samples use std::string to instantiate
their context object, which propagates down to the type of the lexer.
The manual instantiations use BOOST_WAVE_STRINGTYPE a.k.a flex_string
and so do not satisfy the missing symbols, giving a link error.
2019-05-03 08:10:49 -07:00
Jeff Trull f5c417a2f4 Link against Boost.Filesystem to resolve missing symbols in samples 2019-05-03 08:06:40 -07:00
Jeff Trull ed4fe59464 Update waveidl for Scanner class template conversion
Similar changes to those made to re2clex in 2017 (re2c output in its
own file, many more templates)

Also fixed some issues with Boost.Filesystem usage
2019-05-02 21:46:43 -07:00
Nikita Kniazev 0ea2aa7ca2 Fixed usage of auto_ptr on systems where it is deprecated
The macro `BOOST_NO_AUTO_PTR` is defined on systems where both `auto_ptr` and
`unique_ptr` are available (and `auto_ptr` usage produces a deprecation warning).
By using `BOOST_NO_CXX11_SMART_PTR` we will favor `unique_ptr` over `auto_ptr`.

```
slex/lexer.hpp:2423:13: error: 'template<class> class std::auto_ptr' is deprecated [-Werror=deprecated-declarations]
```
2018-10-02 17:59:26 +03:00
malickf cb7e674efc Fix missing parameter
There was a small missing parameter, as a result it was not possible to redirect stdout to a file.
2017-09-24 22:52:03 +02:00
Hartmut Kaiser 20d4dd1f81 Fixing #1 2017-09-02 10:02:53 -05:00