2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

Make the library modular usable.

This commit is contained in:
Rene Rivera
2024-03-11 08:38:16 -05:00
parent 43112c3f05
commit c31939d691
15 changed files with 130 additions and 88 deletions

36
Jamfile
View File

@@ -1,36 +0,0 @@
#==============================================================================
# Copyright (c) 2021 Nikita Kniazev
#
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#==============================================================================
import feature ;
if ! [ feature.valid known-warnings ] {
feature.feature known-warnings : hide show : incidental propagated ;
}
local 9.0-14.0 = 9.0 10.0 11.0 12.0 14.0 ;
project spirit
: requirements
# Warnings that we have not managed to fix yet
<known-warnings>hide,<toolset>msvc:<cxxflags>-wd4244 # conversion from 'T' to 'U', possible loss of data
<known-warnings>hide,<toolset>msvc:<cxxflags>-wd4365 # conversion from 'T' to 'U', signed/unsigned mismatch
<known-warnings>hide,<toolset>msvc:<cxxflags>-wd4459 # declaration of 'varname' hides global declaration
# Enable additional useful warnings
<warnings>extra,<toolset>gcc:<cxxflags>-Wshadow-local
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wshadow-field-in-constructor
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wshadow-uncaptured-local
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wundefined-reinterpret-cast
<warnings>extra,<toolset>msvc:<cxxflags>-w44555 # result of expression not used
# Broken or very high false-positive rate
<known-warnings>hide,<toolset>gcc:<cxxflags>-Wno-maybe-uninitialized # Too many pesky false-positives
<known-warnings>hide,<toolset>msvc-$(9.0-14.0):<cxxflags>-wd4100 # unreferenced formal parameter
<known-warnings>hide,<toolset>msvc-$(9.0-14.0):<cxxflags>-wd4512 # assignment operator could not be generated
<known-warnings>hide,<toolset>msvc-$(9.0-14.0):<cxxflags>-wd4714 # function 'x' marked as __forceinline not inlined
;

74
build.jam Normal file
View File

@@ -0,0 +1,74 @@
# Copyright René Ferdinand Rivera Morell 2023
# Copyright (c) 2021 Nikita Kniazev
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import project ;
import feature ;
if ! [ feature.valid known-warnings ] {
feature.feature known-warnings : hide show : incidental propagated ;
}
local 9.0-14.0 = 9.0 10.0 11.0 12.0 14.0 ;
project /boost/spirit
: common-requirements
<source>/boost/array//boost_array
<source>/boost/assert//boost_assert
<source>/boost/config//boost_config
<source>/boost/core//boost_core
<source>/boost/endian//boost_endian
<source>/boost/function//boost_function
<source>/boost/function_types//boost_function_types
<source>/boost/fusion//boost_fusion
<source>/boost/integer//boost_integer
<source>/boost/io//boost_io
<source>/boost/iterator//boost_iterator
<source>/boost/move//boost_move
<source>/boost/mpl//boost_mpl
<source>/boost/optional//boost_optional
<source>/boost/phoenix//boost_phoenix
<source>/boost/pool//boost_pool
<source>/boost/preprocessor//boost_preprocessor
<source>/boost/proto//boost_proto
<source>/boost/range//boost_range
<source>/boost/regex//boost_regex
<source>/boost/smart_ptr//boost_smart_ptr
<source>/boost/static_assert//boost_static_assert
<source>/boost/thread//boost_thread
<source>/boost/throw_exception//boost_throw_exception
<source>/boost/type_traits//boost_type_traits
<source>/boost/typeof//boost_typeof
<source>/boost/unordered//boost_unordered
<source>/boost/utility//boost_utility
<source>/boost/variant//boost_variant
<include>include
: requirements
# Warnings that we have not managed to fix yet
<known-warnings>hide,<toolset>msvc:<cxxflags>-wd4244 # conversion from 'T' to 'U', possible loss of data
<known-warnings>hide,<toolset>msvc:<cxxflags>-wd4365 # conversion from 'T' to 'U', signed/unsigned mismatch
<known-warnings>hide,<toolset>msvc:<cxxflags>-wd4459 # declaration of 'varname' hides global declaration
# Enable additional useful warnings
<warnings>extra,<toolset>gcc:<cxxflags>-Wshadow-local
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wshadow-field-in-constructor
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wshadow-uncaptured-local
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wundefined-reinterpret-cast
<warnings>extra,<toolset>msvc:<cxxflags>-w44555 # result of expression not used
# Broken or very high false-positive rate
<known-warnings>hide,<toolset>gcc:<cxxflags>-Wno-maybe-uninitialized # Too many pesky false-positives
<known-warnings>hide,<toolset>msvc-$(9.0-14.0):<cxxflags>-wd4100 # unreferenced formal parameter
<known-warnings>hide,<toolset>msvc-$(9.0-14.0):<cxxflags>-wd4512 # assignment operator could not be generated
<known-warnings>hide,<toolset>msvc-$(9.0-14.0):<cxxflags>-wd4714 # function 'x' marked as __forceinline not inlined
;
explicit
[ alias boost_spirit ]
[ alias all : boost_spirit example test ]
;
call-if : boost-library spirit
;

View File

@@ -9,7 +9,7 @@
# build all examples
local examples = [ glob-tree [jJ]amfile [jJ]amfile.v2 ] ;
local examples = [ glob-tree "[jJ]amfile" "[jJ]amfile.v2" ] ;
for local ex in $(examples) {
local dir = $(ex:P) ;

View File

@@ -12,9 +12,9 @@ project spirit-karma-example
:
;
exe actions_example : actions.cpp ;
exe actions_example : actions.cpp /boost/lambda//boost_lambda ;
exe auto_facilities : auto_facilities.cpp ;
exe basic_facilities : basic_facilities.cpp /boost//date_time ;
exe basic_facilities : basic_facilities.cpp /boost/date_time//boost_date_time /boost/tokenizer//boost_tokenizer ;
exe karma_calc2_ast_dump : calc2_ast_dump.cpp ;
exe karma_calc2_ast_rpn : calc2_ast_rpn.cpp ;
exe karma_calc2_ast_vm : calc2_ast_vm.cpp ;
@@ -31,7 +31,7 @@ exe mini_xml_karma : mini_xml_karma.cpp ;
exe printf_style_double_format : printf_style_double_format.cpp ;
exe quick_start1 : quick_start1.cpp ;
exe karma_reference : reference.cpp ;
exe karma_reorder_struct : reorder_struct.cpp ;
exe karma_reorder_struct : reorder_struct.cpp /boost/assign//boost_assign ;
exe karma_escaped_string : escaped_string.cpp ;
exe simple_columns_directive : simple_columns_directive.cpp ;
exe quoted_strings : quoted_strings.cpp ;

View File

@@ -24,7 +24,7 @@ exe print_number_tokenids : print_number_tokenids.cpp ;
exe word_count : word_count.cpp ;
exe word_count_functor : word_count_functor.cpp ;
exe word_count_lexer : word_count_lexer.cpp ;
exe word_count_functor_flex : word_count_functor_flex.cpp ;
exe word_count_functor_flex : word_count_functor_flex.cpp /boost/timer//boost_timer ;
exe strip_comments : strip_comments.cpp ;
exe strip_comments_lexer : strip_comments_lexer.cpp ;
exe custom_token_attribute : custom_token_attribute.cpp ;

View File

@@ -11,22 +11,22 @@ project spirit-qi-example
:
;
exe actions_ : actions.cpp ;
exe actions_ : actions.cpp /boost/lambda//boost_lambda ;
exe sum : sum.cpp ;
exe complex_number : complex_number.cpp ;
exe employee : employee.cpp ;
exe roman : roman.cpp ;
exe reference : reference.cpp ;
exe mini_xml1 : mini_xml1.cpp ;
exe mini_xml2 : mini_xml2.cpp ;
exe mini_xml3 : mini_xml3.cpp ;
exe mini_xml1 : mini_xml1.cpp /boost/foreach//boost_foreach ;
exe mini_xml2 : mini_xml2.cpp /boost/foreach//boost_foreach ;
exe mini_xml3 : mini_xml3.cpp /boost/foreach//boost_foreach ;
exe num_list1 : num_list1.cpp ;
exe num_list2 : num_list2.cpp ;
exe num_list3 : num_list3.cpp ;
exe num_list4 : num_list4.cpp ;
exe reorder_struct : reorder_struct.cpp ;
exe reorder_struct : reorder_struct.cpp /boost/foreach//boost_foreach ;
exe parse_date : parse_date.cpp ;
exe expect : expect.cpp ;
exe expect : expect.cpp /boost/foreach//boost_foreach ;
exe key_value_sequence : key_value_sequence.cpp ;
exe key_value_sequence_ordered : key_value_sequence_ordered.cpp ;

View File

@@ -12,48 +12,52 @@ project spirit-qi-compiler_tutorial
import modules ;
exe calc1 : calc1.cpp ;
exe calc2 : calc2.cpp ;
exe calc3 : calc3.cpp ;
exe calc4 : calc4.cpp ;
exe calc5 : calc5.cpp ;
exe calc6 : calc6.cpp ;
exe calc1_exe : calc1.cpp ;
exe calc2_exe : calc2.cpp ;
exe calc3_exe : calc3.cpp ;
exe calc4_exe : calc4.cpp /boost/foreach//boost_foreach ;
exe calc5_exe : calc5.cpp /boost/foreach//boost_foreach ;
exe calc6_exe : calc6.cpp /boost/foreach//boost_foreach ;
exe calc7 :
exe calc7_exe :
calc7/vm.cpp
calc7/compiler.cpp
calc7/expression.cpp
calc7/statement.cpp
calc7/main.cpp
/boost/foreach//boost_foreach
;
exe calc8 :
exe calc8_exe :
calc8/vm.cpp
calc8/compiler.cpp
calc8/expression.cpp
calc8/statement.cpp
calc8/main.cpp
/boost/foreach//boost_foreach
;
exe mini_c :
exe mini_c_exe :
mini_c/vm.cpp
mini_c/compiler.cpp
mini_c/expression.cpp
mini_c/statement.cpp
mini_c/function.cpp
mini_c/main.cpp
/boost/foreach//boost_foreach
;
exe conjure1 :
exe conjure1_exe :
conjure1/vm.cpp
conjure1/compiler.cpp
conjure1/expression.cpp
conjure1/statement.cpp
conjure1/function.cpp
conjure1/main.cpp
/boost/foreach//boost_foreach
;
exe conjure2 :
exe conjure2_exe :
conjure2/compiler.cpp
conjure2/expression.cpp
conjure2/function.cpp
@@ -61,6 +65,7 @@ exe conjure2 :
conjure2/main.cpp
conjure2/statement.cpp
conjure2/vm.cpp
/boost/foreach//boost_foreach
;
#==============================================================================
@@ -117,7 +122,7 @@ if $(LLVM_PATH)
build_exe_1 $(target-name) : $(sources) : <variant>release ;
}
build_exe conjure3 :
build_exe conjure3_exe :
conjure3/compiler.cpp
conjure3/expression.cpp
conjure3/function.cpp

View File

@@ -47,7 +47,7 @@ exe x3_calc7 :
;
exe x3_calc8 :
/boost//filesystem
/boost/filesystem//boost_filesystem
calc/calc8/vm.cpp
calc/calc8/compiler.cpp
calc/calc8/expression.cpp
@@ -56,7 +56,7 @@ exe x3_calc8 :
;
exe x3_calc9 :
/boost//filesystem
/boost/filesystem//boost_filesystem
calc/calc9/vm.cpp
calc/calc9/compiler.cpp
calc/calc9/expression.cpp

View File

@@ -8,7 +8,6 @@
project spirit-x3-example-rexpr
: requirements
<c++-template-depth>512
<use>/boost//headers
<define>BOOST_SPIRIT_X3_NO_FILESYSTEM
<include>.
;

View File

@@ -10,8 +10,8 @@ import testing ;
project
: requirements
<source>..//rexpr
<source>/boost//regex
<source>/boost//filesystem
<source>/boost/regex//boost_regex
<source>/boost/filesystem//boost_filesystem
<c++-template-depth>300
;

View File

@@ -68,7 +68,7 @@ rule compile-fail ( sources + : requirements * : target-name ? )
compile-fail grammar_fail.cpp ;
compile-fail rule_fail.cpp ;
run actions.cpp ;
run actions.cpp /boost/lambda//boost_lambda ;
run alternative1.cpp ;
run alternative2.cpp ;
run and_predicate.cpp ;
@@ -96,7 +96,7 @@ run duplicate.cpp ;
run encoding.cpp ;
run eol.cpp ;
run eps.cpp ;
run format_manip.cpp ;
run format_manip.cpp /boost/assign//boost_assign ;
run format_manip_attr.cpp ;
run format_pointer_container.cpp ;
run generate_attr.cpp ;
@@ -104,10 +104,10 @@ run grammar.cpp ;
run int1.cpp ;
run int2.cpp ;
run int3.cpp ;
run kleene.cpp ;
run kleene.cpp /boost/assign//boost_assign ;
run lazy.cpp ;
run left_alignment.cpp ;
run list.cpp ;
run list.cpp /boost/assign//boost_assign ;
run lit.cpp ;
run maxwidth.cpp ;
run not_predicate.cpp ;
@@ -117,12 +117,12 @@ run pattern1.cpp ;
run pattern2.cpp ;
run pattern3.cpp ;
run pattern4.cpp ;
run plus.cpp ;
run real1.cpp ;
run real2.cpp ;
run real3.cpp ;
run repeat1.cpp ;
run repeat2.cpp ;
run plus.cpp /boost/assign//boost_assign ;
run real1.cpp /boost/math//boost_math ;
run real2.cpp /boost/math//boost_math ;
run real3.cpp /boost/math//boost_math ;
run repeat1.cpp /boost/assign//boost_assign ;
run repeat2.cpp /boost/assign//boost_assign ;
run right_alignment.cpp ;
run sequence1.cpp ;
run sequence2.cpp ;

View File

@@ -67,7 +67,7 @@ rule compile-fail ( sources + : requirements * : target-name ? )
compile-fail grammar_fail.cpp ;
compile-fail rule_fail.cpp ;
run actions.cpp : : : <pch>off ; # Enable PCH when boostorg/proto#13 is merged.
run actions.cpp /boost/lambda//boost_lambda : : : <pch>off ; # Enable PCH when boostorg/proto#13 is merged.
run actions2.cpp : : : <pch>off ;
run alternative.cpp ;
run attr.cpp ;
@@ -115,13 +115,13 @@ run pass_container1.cpp ;
run pass_container2.cpp ;
run permutation.cpp ;
run plus.cpp ;
run range_run.cpp ;
run range_run.cpp /boost/dynamic_bitset//boost_dynamic_bitset /boost/random//boost_random ;
run raw.cpp ;
run real1.cpp ;
run real2.cpp ;
run real3.cpp ;
run real4.cpp ;
run real5.cpp ;
run real1.cpp /boost/math//boost_math ;
run real2.cpp /boost/math//boost_math ;
run real3.cpp /boost/math//boost_math ;
run real4.cpp /boost/math//boost_math ;
run real5.cpp /boost/math//boost_math ;
run repeat.cpp ;
run rule1.cpp ;
run rule2.cpp ;

View File

@@ -60,7 +60,7 @@ rule compile-fail ( sources + : requirements * : target-name ? )
run char_encoding.cpp ;
run istream_iterator_basic.cpp ;
run line_pos_iterator.cpp ;
run line_pos_iterator.cpp /boost/assign//boost_assign ;
run multi_pass_error_handler.cpp ;
run multi_pass_parse.cpp ;
run unused_type.cpp ;

View File

@@ -16,16 +16,14 @@ import print ;
import sequence ;
import feature ;
project boost/spirit/test/test_headers
project
: requirements
<include>$(BOOST_ROOT)
<include>../../../..
<c++-template-depth>300
;
headers =
[
path.glob-tree ../../../../boost/spirit/include : *.hpp : classic* phoenix1*
glob-tree-ex ../../include/boost/spirit/include : *.hpp : classic* phoenix1*
] ;
for local file in $(headers)
@@ -35,7 +33,7 @@ for local file in $(headers)
<define>BOOST_SPIRIT_HEADER_NAME=$(file)
<dependency>$(file)
: # test name
[ regex.replace [ path.relative-to ../../../../boost/spirit $(file) ] "/" "_" ]
[ regex.replace [ path.relative-to ../../include/boost/spirit/include $(file) ] "/" "_" ]
;
}
@@ -45,6 +43,8 @@ rule generate-include-all ( target : sources * : properties * )
{
print.output $(target) ;
sources = [ MATCH "(.*[.]hpp)" : $(sources) ] ;
if <generate-include-all-order>reverse in $(properties)
{
sources = [ sequence.reverse $(sources) ] ;

View File

@@ -100,7 +100,7 @@ run raw.cpp ;
run real1.cpp ;
run real2.cpp ;
run real3.cpp ;
run real4.cpp ;
run real4.cpp /boost/math//boost_math ;
run rule1.cpp ;
run rule2.cpp ;
run rule3.cpp ;