update boost
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
#define CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED
|
||||
#if !defined(BOOST_CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
#define BOOST_CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED
|
||||
|
||||
#include <limits> // std::numeric_limits
|
||||
#include <climits> // CHAR_BIT
|
||||
@@ -166,7 +166,7 @@ struct chlit_grammar :
|
||||
|
||||
// the rule for a character literal
|
||||
ch_lit
|
||||
= eps_p[self.value = phx::val(0), self.long_lit = phx::val(false)]
|
||||
= eps_p[(self.value = phx::val(0), self.long_lit = phx::val(false))]
|
||||
>> !ch_p('L')[self.long_lit = phx::val(true)]
|
||||
>> ch_p('\'')
|
||||
>> +( (
|
||||
@@ -196,6 +196,11 @@ struct chlit_grammar :
|
||||
impl::compose(self.value, self.long_lit,
|
||||
phx::var(self.overflow), phx::val(0x0b))
|
||||
]
|
||||
| (ch_p('e') | ch_p('E')) // ESC
|
||||
[
|
||||
impl::compose(self.value, self.long_lit,
|
||||
phx::var(self.overflow), phx::val(0x1b))
|
||||
]
|
||||
| ch_p('f') // FF
|
||||
[
|
||||
impl::compose(self.value, self.long_lit,
|
||||
@@ -274,7 +279,7 @@ struct chlit_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ch_lit, TRACE_CHLIT_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return ch_lit; }
|
||||
};
|
||||
@@ -316,22 +321,22 @@ parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
token_val.c_str(), token.get_position());
|
||||
}
|
||||
else {
|
||||
// range check
|
||||
// range check
|
||||
if ('L' == token_val[0]) {
|
||||
// recognized wide character
|
||||
// recognized wide character
|
||||
if (g.overflow ||
|
||||
result > (IntegralResult)(std::numeric_limits<wchar_t>::max)())
|
||||
{
|
||||
// out of range
|
||||
// out of range
|
||||
status = error_character_overflow;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// recognized narrow ('normal') character
|
||||
// recognized narrow ('normal') character
|
||||
if (g.overflow ||
|
||||
result > (IntegralResult)(std::numeric_limits<unsigned char>::max)())
|
||||
{
|
||||
// out of range
|
||||
// out of range
|
||||
status = error_character_overflow;
|
||||
}
|
||||
}
|
||||
@@ -351,4 +356,4 @@ parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#define CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED
|
||||
#if !defined(BOOST_CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#define BOOST_CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -104,7 +104,7 @@ struct defined_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(identifier, TRACE_CPP_DEFINED_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return defined_op; }
|
||||
};
|
||||
@@ -182,4 +182,4 @@ defined_grammar_gen<LexIteratorT>::parse_operator_defined (
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#define CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
|
||||
#if !defined(BOOST_CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#define BOOST_CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -43,12 +43,12 @@ struct BOOST_WAVE_DECL defined_grammar_gen
|
||||
typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
|
||||
token_sequence_type;
|
||||
|
||||
// The parse_operator_defined function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer iterator type) to
|
||||
// correctly formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
// The parse_operator_defined function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer iterator type) to
|
||||
// correctly formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
|
||||
typedef boost::wave::util::unput_queue_iterator<
|
||||
typename token_sequence_type::iterator, token_type, token_sequence_type>
|
||||
@@ -58,7 +58,7 @@ struct BOOST_WAVE_DECL defined_grammar_gen
|
||||
LexIteratorT, token_type, token_sequence_type>
|
||||
iterator2_type;
|
||||
|
||||
// parse the operator defined and return the found qualified name
|
||||
// parse the operator defined and return the found qualified name
|
||||
static boost::spirit::classic::parse_info<iterator1_type>
|
||||
parse_operator_defined (iterator1_type const &first,
|
||||
iterator1_type const &last, token_sequence_type &found_qualified_name);
|
||||
@@ -82,4 +82,4 @@ struct BOOST_WAVE_DECL defined_grammar_gen
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
#define CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED
|
||||
#if !defined(BOOST_CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
#define BOOST_CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -573,6 +573,10 @@ struct expression_grammar :
|
||||
[
|
||||
constant.val = impl::as_intlit(arg1)
|
||||
]
|
||||
| ch_p(T_LONGINTLIT)
|
||||
[
|
||||
constant.val = impl::as_intlit(arg1)
|
||||
]
|
||||
| ch_p(T_CHARLIT)
|
||||
[
|
||||
constant.val = impl::as_chlit(arg1)
|
||||
@@ -694,6 +698,7 @@ struct expression_grammar :
|
||||
constant_nocalc
|
||||
= ch_p(T_PP_NUMBER)
|
||||
| ch_p(T_INTLIT)
|
||||
| ch_p(T_LONGINTLIT)
|
||||
| ch_p(T_CHARLIT)
|
||||
;
|
||||
|
||||
@@ -730,7 +735,7 @@ struct expression_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(constant_nocalc, TRACE_CPP_EXPR_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
simple_rule_t const& start() const
|
||||
{ return pp_expression; }
|
||||
};
|
||||
@@ -782,7 +787,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
ch_p(T_SPACE) | ch_p(T_CCOMMENT) | ch_p(T_CPPCOMMENT));
|
||||
|
||||
if (!hit.hit) {
|
||||
// expression is illformed
|
||||
// expression is illformed
|
||||
if (if_block_status) {
|
||||
string_type expression = as_string<string_type>(first, last);
|
||||
if (0 == expression.size())
|
||||
@@ -792,30 +797,30 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
// as the if_block_status is false no errors will be reported
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
catch (boost::wave::preprocess_exception const& e) {
|
||||
// expression is illformed
|
||||
// expression is illformed
|
||||
if (if_block_status) {
|
||||
boost::throw_exception(e);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
// as the if_block_status is false no errors will be reported
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!hit.full) {
|
||||
// The token list starts with a valid expression, but there remains
|
||||
// something. If the remainder consists out of whitespace only, the
|
||||
// expression is still valid.
|
||||
iterator_type next = hit.stop;
|
||||
// The token list starts with a valid expression, but there remains
|
||||
// something. If the remainder consists out of whitespace only, the
|
||||
// expression is still valid.
|
||||
iterator_type next = hit.stop;
|
||||
|
||||
while (next != last) {
|
||||
switch (token_id(*next)) {
|
||||
@@ -830,7 +835,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
return as_bool(result); // expression is valid
|
||||
|
||||
default:
|
||||
// expression is illformed
|
||||
// expression is illformed
|
||||
if (if_block_status) {
|
||||
string_type expression = as_string<string_type>(first, last);
|
||||
if (0 == expression.size())
|
||||
@@ -840,7 +845,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
// as the if_block_status is false no errors will be reported
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -851,7 +856,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
if (error_noerror != result.is_valid()) // division or other error by zero occurred
|
||||
status = result.is_valid();
|
||||
|
||||
// token sequence is a valid expression
|
||||
// token sequence is a valid expression
|
||||
return as_bool(result);
|
||||
}
|
||||
|
||||
@@ -867,4 +872,4 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
#define CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED
|
||||
#if !defined(BOOST_CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
#define BOOST_CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpp_iteration_context.hpp>
|
||||
@@ -72,4 +72,4 @@ struct BOOST_WAVE_DECL expression_grammar_gen {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
#define CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED
|
||||
#if !defined(BOOST_CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
#define BOOST_CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED
|
||||
|
||||
#if defined (BOOST_SPIRIT_DEBUG)
|
||||
#include <iostream>
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
value_type get_type() const { return type; }
|
||||
value_error is_valid() const { return valid; }
|
||||
|
||||
// explicit conversion
|
||||
// explicit conversion
|
||||
friend int_literal_type as_int(closure_value const& v)
|
||||
{
|
||||
switch (v.type) {
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
return v.value.i != 0.0;
|
||||
}
|
||||
|
||||
// assignment
|
||||
// assignment
|
||||
closure_value &operator= (closure_value const &rhs)
|
||||
{
|
||||
switch (rhs.get_type()) {
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
// arithmetics
|
||||
// arithmetics
|
||||
closure_value &operator+= (closure_value const &rhs)
|
||||
{
|
||||
switch (type) {
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
case is_int:
|
||||
if (as_long(rhs) != 0) {
|
||||
if (value.i == -value.i && -1 == rhs.value.i) {
|
||||
// LONG_MIN / -1 on two's complement
|
||||
// LONG_MIN / -1 on two's complement
|
||||
valid = error_integer_overflow;
|
||||
}
|
||||
else {
|
||||
@@ -494,7 +494,7 @@ public:
|
||||
case is_int:
|
||||
if (as_long(rhs) != 0) {
|
||||
if (value.i == -value.i && -1 == rhs.value.i) {
|
||||
// LONG_MIN % -1 on two's complement
|
||||
// LONG_MIN % -1 on two's complement
|
||||
valid = error_integer_overflow;
|
||||
}
|
||||
else {
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
return closure_value(!as_ulong(rhs), rhs.valid);
|
||||
}
|
||||
|
||||
// comparison
|
||||
// comparison
|
||||
friend closure_value
|
||||
operator== (closure_value const &lhs, closure_value const &rhs)
|
||||
{
|
||||
@@ -880,4 +880,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
#define CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED
|
||||
#if !defined(BOOST_CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
#define BOOST_CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED
|
||||
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
#include <boost/spirit/include/classic_parse_tree.hpp>
|
||||
@@ -164,7 +164,7 @@ struct cpp_grammar :
|
||||
template <typename ScannerT>
|
||||
struct definition
|
||||
{
|
||||
// non-parse_tree generating rule type
|
||||
// non-parse_tree generating rule type
|
||||
typedef typename ScannerT::iteration_policy_t iteration_policy_t;
|
||||
typedef boost::spirit::classic::match_policy match_policy_t;
|
||||
typedef typename ScannerT::action_policy_t action_policy_t;
|
||||
@@ -180,7 +180,7 @@ struct cpp_grammar :
|
||||
non_tree_scanner_t, boost::spirit::classic::dynamic_parser_tag>
|
||||
no_tree_rule_type;
|
||||
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
typedef
|
||||
boost::spirit::classic::rule<
|
||||
ScannerT, boost::spirit::classic::dynamic_parser_tag>
|
||||
@@ -207,12 +207,12 @@ struct cpp_grammar :
|
||||
|
||||
definition(cpp_grammar const &self)
|
||||
{
|
||||
// import the spirit and cpplexer namespaces here
|
||||
// import the spirit and cpplexer namespaces here
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
using namespace boost::wave::util;
|
||||
|
||||
// set the rule id's for later use
|
||||
// set the rule id's for later use
|
||||
pp_statement.set_id(BOOST_WAVE_PP_STATEMENT_ID);
|
||||
// include_file.set_id(BOOST_WAVE_INCLUDE_FILE_ID);
|
||||
// system_include_file.set_id(BOOST_WAVE_SYSINCLUDE_FILE_ID);
|
||||
@@ -593,8 +593,8 @@ struct cpp_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppifndef, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppif, TRACE_CPP_GRAMMAR);
|
||||
// BOOST_SPIRIT_DEBUG_TRACE_RULE(ppelse, TRACE_CPP_GRAMMAR);
|
||||
// BOOST_SPIRIT_DEBUG_TRACE_RULE(ppelif, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppendif, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppelif, TRACE_CPP_GRAMMAR);
|
||||
// BOOST_SPIRIT_DEBUG_TRACE_RULE(ppendif, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppline, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(pperror, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppwarning, TRACE_CPP_GRAMMAR);
|
||||
@@ -607,7 +607,7 @@ struct cpp_grammar :
|
||||
#endif
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_type const& start() const
|
||||
{ return pp_statement; }
|
||||
};
|
||||
@@ -627,7 +627,7 @@ struct cpp_grammar :
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_DUMP_PARSE_TREE != 0
|
||||
// helper function and data to get readable names of the rules known to us
|
||||
// helper function and data to get readable names of the rules known to us
|
||||
struct map_ruleid_to_name :
|
||||
public std::map<boost::spirit::classic::parser_id, std::string>
|
||||
{
|
||||
@@ -668,7 +668,7 @@ struct cpp_grammar :
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
// initialize parser_id to rule_name map
|
||||
// initialize parser_id to rule_name map
|
||||
for (int i = 0; 0 != init_ruleid_name_map[i].parser_id; ++i)
|
||||
base_type::insert(base_type::value_type(
|
||||
boost::spirit::classic::parser_id(init_ruleid_name_map[i].parser_id),
|
||||
@@ -762,4 +762,4 @@ cpp_grammar_gen<LexIteratorT, TokenContainerT>::parse_cpp_grammar (
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
#define CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED
|
||||
#if !defined(BOOST_CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
#define BOOST_CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/language_support.hpp>
|
||||
@@ -86,7 +86,7 @@ struct BOOST_WAVE_DECL cpp_grammar_gen
|
||||
// boost::pool_allocator<boost::spirit::nil_t>
|
||||
> node_factory_type;
|
||||
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
static boost::spirit::classic::tree_parse_info<iterator_type, node_factory_type>
|
||||
parse_cpp_grammar (iterator_type const &first, iterator_type const &last,
|
||||
position_type const &act_pos, bool &found_eof,
|
||||
@@ -107,4 +107,4 @@ struct BOOST_WAVE_DECL cpp_grammar_gen
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
|
||||
232
linx64/include/boost/wave/grammars/cpp_has_include_grammar.hpp
Normal file
232
linx64/include/boost/wave/grammars/cpp_has_include_grammar.hpp
Normal file
@@ -0,0 +1,232 @@
|
||||
/*=============================================================================
|
||||
Boost.Wave: A Standard compliant C++ preprocessor library
|
||||
|
||||
http://www.boost.org/
|
||||
|
||||
Copyright (c) 2020 Jeff Trull
|
||||
Copyright (c) 2001-2012 Hartmut Kaiser. 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)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#define BOOST_CPP_HAS_INCLUDE_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
#include <boost/spirit/include/classic_closure.hpp>
|
||||
#include <boost/spirit/include/classic_assign_actor.hpp>
|
||||
#include <boost/spirit/include/classic_push_back_actor.hpp>
|
||||
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
#include <boost/wave/util/pattern_parser.hpp>
|
||||
#include <boost/wave/grammars/cpp_has_include_grammar_gen.hpp>
|
||||
|
||||
#if !defined(spirit_append_actor)
|
||||
#define spirit_append_actor(actor) boost::spirit::classic::push_back_a(actor)
|
||||
#endif // !has_include(spirit_append_actor)
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
namespace boost {
|
||||
namespace wave {
|
||||
namespace grammars {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// define, whether the rule's should generate some debug output
|
||||
#define TRACE_CPP_HAS_INCLUDE_GRAMMAR \
|
||||
bool(BOOST_SPIRIT_DEBUG_FLAGS_CPP & BOOST_SPIRIT_DEBUG_FLAGS_HAS_INCLUDE_GRAMMAR) \
|
||||
/**/
|
||||
|
||||
template <typename ContainerT>
|
||||
struct has_include_grammar :
|
||||
public boost::spirit::classic::grammar<has_include_grammar<ContainerT> >
|
||||
{
|
||||
has_include_grammar(ContainerT &tokens_seq_,
|
||||
bool &is_quoted_filename_,
|
||||
bool &is_system_)
|
||||
: tokens_seq(tokens_seq_), is_quoted_filename(is_quoted_filename_),
|
||||
is_system(is_system_), true_(true)
|
||||
{
|
||||
BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(*this, "has_include_grammar",
|
||||
TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
is_quoted_filename = false;
|
||||
is_system = false;
|
||||
}
|
||||
|
||||
template <typename ScannerT>
|
||||
struct definition
|
||||
{
|
||||
typedef boost::spirit::classic::rule<ScannerT> rule_t;
|
||||
|
||||
rule_t has_include_op;
|
||||
rule_t system_include;
|
||||
rule_t nonsystem_include;
|
||||
|
||||
rule_t nonparen;
|
||||
rule_t parenthesized_exp;
|
||||
rule_t computed_include;
|
||||
|
||||
definition(has_include_grammar const & self)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
using namespace boost::wave::util;
|
||||
|
||||
has_include_op
|
||||
= ch_p(T_IDENTIFIER) >> // token contains '__has_include'
|
||||
ch_p(T_LEFTPAREN) >>
|
||||
(system_include | nonsystem_include | computed_include) >>
|
||||
ch_p(T_RIGHTPAREN)
|
||||
;
|
||||
|
||||
system_include
|
||||
= ch_p(T_LESS)
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
]
|
||||
>> * (~ch_p(T_GREATER))
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
]
|
||||
>> ch_p(T_GREATER)
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
][
|
||||
assign_a(self.is_quoted_filename, self.true_)
|
||||
][
|
||||
assign_a(self.is_system, self.true_)
|
||||
]
|
||||
;
|
||||
|
||||
nonsystem_include = ch_p(T_STRINGLIT)
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
][
|
||||
assign_a(self.is_quoted_filename, self.true_)
|
||||
]
|
||||
;
|
||||
|
||||
// an action to store a sequence of parsed tokens
|
||||
auto append_seq = [&](typename ScannerT::iterator_t first,
|
||||
typename ScannerT::iterator_t last) {
|
||||
for (;first != last;++first) {
|
||||
self.tokens_seq.push_back(*first);
|
||||
};
|
||||
};
|
||||
|
||||
// if neither of the above match we take everything between
|
||||
// the parentheses and evaluate it ("computed include")
|
||||
// supported expressions are "implementation defined" per the gcc manual
|
||||
// we've tried to be fairly generous in Wave
|
||||
// here we accept any set of non-whitespace characters with
|
||||
// properly nested parentheses:
|
||||
nonparen = (anychar_p - ch_p(T_LEFTPAREN) - ch_p(T_RIGHTPAREN)) [ append_seq ] ;
|
||||
|
||||
parenthesized_exp =
|
||||
ch_p(T_LEFTPAREN)[ spirit_append_actor(self.tokens_seq) ] >>
|
||||
computed_include >>
|
||||
ch_p(T_RIGHTPAREN)[ spirit_append_actor(self.tokens_seq) ] ;
|
||||
computed_include = * (nonparen | parenthesized_exp) ;
|
||||
|
||||
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(has_include_op, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(system_include, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(nonsystem_include, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(computed_include, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(parenthesized_exp, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(nonparen, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return has_include_op; }
|
||||
};
|
||||
|
||||
ContainerT &tokens_seq;
|
||||
bool &is_quoted_filename;
|
||||
bool &is_system;
|
||||
const bool true_; // Spirit Classic actors operate on references, not values
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#undef TRACE_CPP_HAS_INCLUDE_GRAMMAR
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The following parse function is has_include here, to allow the separation of
|
||||
// the compilation of the has_include_grammar from the function
|
||||
// using it.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
|
||||
#define BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
#else
|
||||
#define BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE inline
|
||||
#endif
|
||||
|
||||
// The parse_operator_define function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer type) to correctly
|
||||
// formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
|
||||
template <typename LexIteratorT>
|
||||
BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
boost::spirit::classic::parse_info<
|
||||
typename has_include_grammar_gen<LexIteratorT>::iterator1_type
|
||||
>
|
||||
has_include_grammar_gen<LexIteratorT>::parse_operator_has_include (
|
||||
iterator1_type const &first, iterator1_type const &last,
|
||||
token_sequence_type &tokens,
|
||||
bool &is_quoted_filename, bool &is_system)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
|
||||
has_include_grammar<token_sequence_type>
|
||||
g(tokens, is_quoted_filename, is_system);
|
||||
return boost::spirit::classic::parse (
|
||||
first, last, g, ch_p(T_SPACE) | ch_p(T_CCOMMENT));
|
||||
}
|
||||
|
||||
template <typename LexIteratorT>
|
||||
BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
boost::spirit::classic::parse_info<
|
||||
typename has_include_grammar_gen<LexIteratorT>::iterator2_type
|
||||
>
|
||||
has_include_grammar_gen<LexIteratorT>::parse_operator_has_include (
|
||||
iterator2_type const &first, iterator2_type const &last,
|
||||
token_sequence_type &found_qualified_name,
|
||||
bool &is_quoted_filename, bool &is_system)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
|
||||
has_include_grammar<token_sequence_type>
|
||||
g(found_qualified_name, is_quoted_filename, is_system);
|
||||
return boost::spirit::classic::parse (
|
||||
first, last, g, ch_p(T_SPACE) | ch_p(T_CCOMMENT));
|
||||
}
|
||||
|
||||
#undef BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
} // namespace grammars
|
||||
} // namespace wave
|
||||
} // namespace boost
|
||||
|
||||
// the suffix header occurs after all of the code
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
@@ -0,0 +1,87 @@
|
||||
/*=============================================================================
|
||||
Boost.Wave: A Standard compliant C++ preprocessor library
|
||||
|
||||
http://www.boost.org/
|
||||
|
||||
Copyright (c) 2001-2012 Hartmut Kaiser. 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)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#define BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
#include <list>
|
||||
|
||||
#include <boost/spirit/include/classic_parser.hpp>
|
||||
#include <boost/pool/pool_alloc.hpp>
|
||||
|
||||
#include <boost/wave/util/unput_queue_iterator.hpp>
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
// suppress warnings about dependent classes not being exported from the dll
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4251 4231 4660)
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
namespace boost {
|
||||
namespace wave {
|
||||
namespace grammars {
|
||||
|
||||
template <typename LexIteratorT>
|
||||
struct BOOST_WAVE_DECL has_include_grammar_gen
|
||||
{
|
||||
typedef typename LexIteratorT::token_type token_type;
|
||||
typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
|
||||
token_sequence_type;
|
||||
|
||||
// The parse_operator_has_include function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer iterator type) to
|
||||
// correctly formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
|
||||
typedef boost::wave::util::unput_queue_iterator<
|
||||
typename token_sequence_type::iterator, token_type, token_sequence_type>
|
||||
iterator1_type;
|
||||
|
||||
typedef boost::wave::util::unput_queue_iterator<
|
||||
LexIteratorT, token_type, token_sequence_type>
|
||||
iterator2_type;
|
||||
|
||||
// parse the operator has_include and return the found qualified name
|
||||
static boost::spirit::classic::parse_info<iterator1_type>
|
||||
parse_operator_has_include (iterator1_type const &first,
|
||||
iterator1_type const &last, token_sequence_type &found_qualified_name,
|
||||
bool &is_quoted_filename, bool &is_system);
|
||||
|
||||
static boost::spirit::classic::parse_info<iterator2_type>
|
||||
parse_operator_has_include (iterator2_type const &first,
|
||||
iterator2_type const &last, token_sequence_type &found_qualified_name,
|
||||
bool &is_quoted_filename, bool &is_system);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
} // namespace grammars
|
||||
} // namespace wave
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// the suffix header occurs after all of the code
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
#define CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED
|
||||
#if !defined(BOOST_CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
#define BOOST_CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -101,16 +101,16 @@ struct intlit_grammar :
|
||||
(ch_p('X') | ch_p('x'))
|
||||
>> uint_parser<uint_literal_type, 16>()
|
||||
[
|
||||
self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true
|
||||
(self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true)
|
||||
]
|
||||
,
|
||||
|
||||
oct_lit =
|
||||
!uint_parser<uint_literal_type, 8>()
|
||||
[
|
||||
self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true
|
||||
(self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true)
|
||||
]
|
||||
,
|
||||
|
||||
@@ -129,7 +129,7 @@ struct intlit_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(dec_lit, TRACE_INTLIT_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return int_lit; }
|
||||
};
|
||||
@@ -158,13 +158,12 @@ uint_literal_type
|
||||
intlit_grammar_gen<TokenT>::evaluate(TokenT const &token,
|
||||
bool &is_unsigned)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
|
||||
intlit_grammar g(is_unsigned);
|
||||
uint_literal_type result = 0;
|
||||
typename TokenT::string_type const &token_val = token.get_value();
|
||||
parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
parse(token_val.begin(), token_val.end(), g[spirit_assign_actor(result)]);
|
||||
intlit_grammar g(is_unsigned);
|
||||
uint_literal_type result = 0;
|
||||
typename TokenT::string_type const &token_val = token.get_value();
|
||||
using boost::spirit::classic::parse_info;
|
||||
parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
parse(token_val.begin(), token_val.end(), g[spirit_assign_actor(result)]);
|
||||
|
||||
if (!hit.hit) {
|
||||
BOOST_WAVE_THROW(preprocess_exception, ill_formed_integer_literal,
|
||||
@@ -185,4 +184,4 @@ parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
#define CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED
|
||||
#if !defined(BOOST_CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
#define BOOST_CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/grammars/cpp_value_error.hpp>
|
||||
@@ -74,4 +74,4 @@ struct BOOST_WAVE_DECL chlit_grammar_gen {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
#define CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED
|
||||
#if !defined(BOOST_CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
#define BOOST_CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED
|
||||
|
||||
#include <boost/spirit/include/classic_parse_tree.hpp>
|
||||
|
||||
@@ -58,7 +58,7 @@ struct BOOST_WAVE_DECL predefined_macros_grammar_gen
|
||||
{
|
||||
typedef LexIteratorT iterator_type;
|
||||
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
static boost::spirit::classic::tree_parse_info<iterator_type>
|
||||
parse_predefined_macro (iterator_type const &first, iterator_type const &last);
|
||||
};
|
||||
@@ -77,4 +77,4 @@ struct BOOST_WAVE_DECL predefined_macros_grammar_gen
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
#define CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED
|
||||
#if !defined(BOOST_CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
#define BOOST_CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED
|
||||
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
#include <boost/spirit/include/classic_parse_tree.hpp>
|
||||
@@ -45,7 +45,7 @@ struct predefined_macros_grammar :
|
||||
template <typename ScannerT>
|
||||
struct definition
|
||||
{
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
typedef boost::spirit::classic::rule<
|
||||
ScannerT, boost::spirit::classic::dynamic_parser_tag>
|
||||
rule_type;
|
||||
@@ -54,26 +54,26 @@ struct predefined_macros_grammar :
|
||||
|
||||
definition(predefined_macros_grammar const &/*self*/)
|
||||
{
|
||||
// import the spirit and cpplexer namespaces here
|
||||
// import the spirit and cpplexer namespaces here
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
using namespace boost::wave::util;
|
||||
|
||||
// set the rule id's for later use
|
||||
// set the rule id's for later use
|
||||
plain_define.set_id(BOOST_WAVE_PLAIN_DEFINE_ID);
|
||||
macro_parameters.set_id(BOOST_WAVE_MACRO_PARAMETERS_ID);
|
||||
macro_definition.set_id(BOOST_WAVE_MACRO_DEFINITION_ID);
|
||||
|
||||
// recognizes command line defined macro syntax, i.e.
|
||||
// -DMACRO
|
||||
// -DMACRO=
|
||||
// -DMACRO=value
|
||||
// -DMACRO(x)
|
||||
// -DMACRO(x)=
|
||||
// -DMACRO(x)=value
|
||||
// recognizes command line defined macro syntax, i.e.
|
||||
// -DMACRO
|
||||
// -DMACRO=
|
||||
// -DMACRO=value
|
||||
// -DMACRO(x)
|
||||
// -DMACRO(x)=
|
||||
// -DMACRO(x)=value
|
||||
|
||||
// This grammar resembles the overall structure of the cpp_grammar to
|
||||
// make it possible to reuse the parse tree traversal code
|
||||
// This grammar resembles the overall structure of the cpp_grammar to
|
||||
// make it possible to reuse the parse tree traversal code
|
||||
plain_define
|
||||
= ( ch_p(T_IDENTIFIER)
|
||||
| pattern_p(KeywordTokenType,
|
||||
@@ -87,7 +87,7 @@ struct predefined_macros_grammar :
|
||||
>> !macro_definition
|
||||
;
|
||||
|
||||
// parameter list
|
||||
// parameter list
|
||||
macro_parameters
|
||||
= confix_p(
|
||||
no_node_d[ch_p(T_LEFTPAREN) >> *ch_p(T_SPACE)],
|
||||
@@ -99,6 +99,7 @@ struct predefined_macros_grammar :
|
||||
ExtTokenTypeMask|PPTokenFlag) // and, bit_and etc.
|
||||
| pattern_p(BoolLiteralTokenType,
|
||||
TokenTypeMask|PPTokenFlag) // true/false
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
| ch_p(T_ELLIPSIS)
|
||||
#endif
|
||||
@@ -112,7 +113,7 @@ struct predefined_macros_grammar :
|
||||
)
|
||||
;
|
||||
|
||||
// macro body (anything left until eol)
|
||||
// macro body (anything left until eol)
|
||||
macro_definition
|
||||
= no_node_d[ch_p(T_ASSIGN)]
|
||||
>> *anychar_p
|
||||
@@ -123,7 +124,7 @@ struct predefined_macros_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(macro_parameters, TRACE_PREDEF_MACROS_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_type const& start() const
|
||||
{ return plain_define; }
|
||||
};
|
||||
@@ -175,4 +176,4 @@ predefined_macros_grammar_gen<LexIteratorT>::parse_predefined_macro (
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user