[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -14,6 +14,7 @@ SOURCES =
../instantiate_cpp_grammar
../instantiate_cpp_literalgrs
../instantiate_defined_grammar
../instantiate_has_include_grammar
../instantiate_slex_lexer
;
@@ -25,7 +26,6 @@ exe cpp_tokens
/boost/filesystem//boost_filesystem
/boost/system//boost_system
/boost/thread//boost_thread
/boost/date_time//boost_date_time
;
for local source in $(SOURCES)

View File

@@ -30,6 +30,8 @@
#include "slex/cpp_slex_lexer.hpp"
#endif // !defined(BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION)
#include <iostream>
///////////////////////////////////////////////////////////////////////////////
// import required names
using namespace boost::spirit::classic;

View File

@@ -13,12 +13,12 @@
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED)
#define CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED
#if !defined(BOOST_CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED)
#define BOOST_CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED
///////////////////////////////////////////////////////////////////////////////
// include often used files from the stdlib
#include <iostream>
#include <iosfwd>
#include <fstream>
#include <string>
@@ -35,4 +35,4 @@
#include <boost/assert.hpp>
#include <boost/pool/pool_alloc.hpp>
#endif // !defined(CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED)
#endif // !defined(BOOST_CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED)

View File

@@ -11,8 +11,8 @@
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED)
#define CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED
#if !defined(BOOST_CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED)
#define BOOST_CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED
///////////////////////////////////////////////////////////////////////////////
// Uncomment the following, if you need debug output, the
@@ -52,4 +52,4 @@
#pragma inline_recursion(on)
#endif // defined(BOOST_MSVC)
#endif // !defined(CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED)
#endif // !defined(BOOST_CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED)

View File

@@ -0,0 +1,39 @@
/*=============================================================================
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)
=============================================================================*/
#include "cpp_tokens.hpp" // config data
#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
#include <string>
#include <boost/wave/token_ids.hpp>
#include "slex_token.hpp"
#include "slex_iterator.hpp"
#include <boost/wave/grammars/cpp_has_include_grammar.hpp>
///////////////////////////////////////////////////////////////////////////////
//
// Explicit instantiation of the has_include_grammar_gen template
// with the correct token type. This instantiates the corresponding parse
// function, which in turn instantiates the has_include_grammar
// object (see wave/grammars/cpp_has_include_grammar.hpp)
//
///////////////////////////////////////////////////////////////////////////////
typedef boost::wave::cpplexer::slex::slex_iterator<
boost::wave::cpplexer::slex_token<> >
lexer_type;
template struct boost::wave::grammars::has_include_grammar_gen<lexer_type>;
#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0

View File

@@ -10,8 +10,8 @@
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED)
#define SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED
#if !defined(BOOST_SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED)
#define BOOST_SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED
#include <string>
#if defined(BOOST_SPIRIT_DEBUG)
@@ -58,6 +58,7 @@ namespace lexer {
#define INIT_DATA_CPP_SIZE 15
#define INIT_DATA_PP_NUMBER_SIZE 2
#define INIT_DATA_CPP0X_SIZE 15
#define INIT_DATA_CPP2A_SIZE 10
///////////////////////////////////////////////////////////////////////////////
//
@@ -114,6 +115,7 @@ private:
static typename base_type::lexer_data const init_data_cpp[INIT_DATA_CPP_SIZE]; // C++ only patterns
static typename base_type::lexer_data const init_data_pp_number[INIT_DATA_PP_NUMBER_SIZE]; // pp-number only patterns
static typename base_type::lexer_data const init_data_cpp0x[INIT_DATA_CPP0X_SIZE]; // C++0X only patterns
static typename base_type::lexer_data const init_data_cpp2a[INIT_DATA_CPP2A_SIZE]; // C++2A only patterns
};
///////////////////////////////////////////////////////////////////////////////
@@ -142,13 +144,13 @@ private:
#define INTEGER_SUFFIX "(" "[uU][lL]?|[lL][uU]?" ")"
#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0
#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "[lL][lL]" ")" OR \
"(" "[lL][lL]" ")" "[uU]" "?" OR \
#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "ll" OR "LL" ")" OR \
"(" "ll" OR "LL" ")" "[uU]" "?" OR \
"i64" \
")"
#else
#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "[lL][lL]" ")" OR \
"(" "[lL][lL]" ")" "[uU]" "?" ")"
#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "ll" OR "LL" ")" OR \
"(" "ll" OR "LL" ")" "[uU]" "?" ")"
#endif
#define FLOAT_SUFFIX "(" "[fF][lL]?" OR "[lL][fF]?" ")"
#define CHAR_SPEC "L?"
@@ -432,7 +434,7 @@ lexer<IteratorT, PositionT>::init_data_pp_number[INIT_DATA_PP_NUMBER_SIZE] =
};
///////////////////////////////////////////////////////////////////////////////
// C++ only token definitions
// C++11 only token definitions
#define T_EXTCHARLIT token_id(T_CHARLIT|AltTokenType)
#define T_EXTSTRINGLIT token_id(T_STRINGLIT|AltTokenType)
@@ -459,10 +461,31 @@ lexer<IteratorT, PositionT>::init_data_cpp0x[INIT_DATA_CPP0X_SIZE] =
TOKEN_DATA(NOEXCEPT, "noexcept"),
TOKEN_DATA(NULLPTR, "nullptr"),
TOKEN_DATA(STATICASSERT, "static_assert"),
TOKEN_DATA(THREADLOCAL, "threadlocal"),
TOKEN_DATA(THREADLOCAL, "thread_local"),
{ token_id(0) } // this should be the last entry
};
///////////////////////////////////////////////////////////////////////////////
// C++20 only token definitions
template <typename IteratorT, typename PositionT>
typename lexer_base<IteratorT, PositionT>::lexer_data const
lexer<IteratorT, PositionT>::init_data_cpp2a[INIT_DATA_CPP2A_SIZE] =
{
TOKEN_DATA(CHAR8_T, "char8_t"),
TOKEN_DATA(CONCEPT, "concept"),
TOKEN_DATA(CONSTEVAL, "consteval"),
TOKEN_DATA(CONSTINIT, "constinit"),
TOKEN_DATA(CO_AWAIT, "co_await"),
TOKEN_DATA(CO_RETURN, "co_return"),
TOKEN_DATA(CO_YIELD, "co_yield"),
TOKEN_DATA(REQUIRES, "requires"),
TOKEN_DATA(SPACESHIP, "<=>"),
{ token_id(0) } // this should be the last entry
};
///////////////////////////////////////////////////////////////////////////////
// undefine macros, required for regular expression definitions
#undef INCLUDEDEF
@@ -528,9 +551,9 @@ lexer<IteratorT, PositionT>::init_dfa(boost::wave::language_support lang)
}
}
// if in C++0x mode, add all new keywords
// if in C++0x mode, add appropriate keywords
#if BOOST_WAVE_SUPPORT_CPP0X != 0
if (boost::wave::need_cpp0x(lang)) {
if (boost::wave::need_cpp0x(lang) || boost::wave::need_cpp2a(lang)) {
for (int j = 0; 0 != init_data_cpp0x[j].tokenid; ++j) {
this->register_regex(init_data_cpp0x[j].tokenregex,
init_data_cpp0x[j].tokenid, init_data_cpp0x[j].tokencb,
@@ -539,6 +562,18 @@ lexer<IteratorT, PositionT>::init_dfa(boost::wave::language_support lang)
}
#endif
// if in C++2a mode, add those keywords
#if BOOST_WAVE_SUPPORT_CPP2A != 0
if (wave::need_cpp2a(lang)) {
for (int j = 0; 0 != init_data_cpp2a[j].tokenid; ++j) {
this->register_regex(init_data_cpp2a[j].tokenregex,
init_data_cpp2a[j].tokenid,
init_data_cpp2a[j].tokencb,
init_data_cpp2a[j].lexerstate);
}
}
#endif
for (int i = 0; 0 != init_data[i].tokenid; ++i) {
this->register_regex(init_data[i].tokenregex, init_data[i].tokenid,
init_data[i].tokencb, init_data[i].lexerstate);
@@ -624,7 +659,7 @@ public:
virtual ~slex_functor() {}
// get the next token from the input stream
token_type& get(token_type& result)
token_type& get(token_type& result) BOOST_OVERRIDE
{
if (!at_eof) {
do {
@@ -687,20 +722,20 @@ public:
}
break;
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
case T_PP_HHEADER:
case T_PP_QHEADER:
case T_PP_INCLUDE:
// convert to the corresponding ..._next token, if appropriate
{
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
// Skip '#' and whitespace and see whether we find an
// 'include_next' here.
typename string_type::size_type start = value.find("include");
if (0 == value.compare(start, 12, "include_next", 12))
id = token_id(id | AltTokenType);
#endif // BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
break;
}
#endif // BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
case T_EOF:
// T_EOF is returned as a valid token, the next call will
@@ -740,7 +775,7 @@ public:
return result = token_type(); // return T_EOI
}
void set_position(PositionT const &pos)
void set_position(PositionT const &pos) BOOST_OVERRIDE
{
// set position has to change the file name and line number only
first.get_position().set_file(pos.get_file());
@@ -748,7 +783,7 @@ public:
}
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
bool has_include_guards(std::string& guard_name) const
bool has_include_guards(std::string& guard_name) const BOOST_OVERRIDE
{ return guards.detected(guard_name); }
#endif
@@ -824,4 +859,4 @@ new_lexer_gen<IteratorT, PositionT>::new_lexer(IteratorT const &first,
} // namespace wave
} // namespace boost
#endif // !defined(SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED)
#endif // !defined(BOOST_SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED)

View File

@@ -40,6 +40,7 @@
#define BOOST_SPIRIT_LEXER_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
#include <boost/spirit/include/classic_core.hpp>
@@ -49,10 +50,13 @@
#include <set>
#include <map>
#include <memory> // for auto_ptr/unique_ptr
#include <vector>
#include <stack>
#include <utility> // for pair
#if defined(BOOST_SPIRIT_DEBUG)
#include <iostream>
#endif
#include <fstream>
#include <boost/assert.hpp>
#include <boost/limits.hpp>
@@ -115,16 +119,16 @@ public:
char_node(const char_node& x);
virtual ~char_node(){}
virtual node* clone() const;
virtual bool nullable() const;
virtual node_set firstpos() const;
virtual node_set lastpos() const;
virtual void compute_followpos(followpos_t& followpos) const;
virtual void compute_state_match(state_match_t& state_match ) const;
virtual void get_eof_ids(node_set& eof_set) const;
virtual void assign_node_ids(node_id_t& node_count);
node* clone() const BOOST_OVERRIDE;
bool nullable() const BOOST_OVERRIDE;
node_set firstpos() const BOOST_OVERRIDE;
node_set lastpos() const BOOST_OVERRIDE;
void compute_followpos(followpos_t& followpos) const BOOST_OVERRIDE;
void compute_state_match(state_match_t& state_match ) const BOOST_OVERRIDE;
void get_eof_ids(node_set& eof_set) const BOOST_OVERRIDE;
void assign_node_ids(node_id_t& node_count) BOOST_OVERRIDE;
#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX)
virtual void dump(std::ostream& out) const;
void dump(std::ostream& out) const BOOST_OVERRIDE;
#endif
private:
@@ -231,16 +235,16 @@ public:
epsilon_node(const epsilon_node& x);
virtual ~epsilon_node(){}
virtual node* clone() const;
virtual bool nullable() const;
virtual node_set firstpos() const;
virtual node_set lastpos() const;
virtual void compute_followpos(followpos_t& followpos) const;
virtual void compute_state_match(state_match_t& state_match ) const;
virtual void get_eof_ids(node_set& eof_set) const;
virtual void assign_node_ids(node_id_t& node_count);
node* clone() const BOOST_OVERRIDE;
bool nullable() const BOOST_OVERRIDE;
node_set firstpos() const BOOST_OVERRIDE;
node_set lastpos() const BOOST_OVERRIDE;
void compute_followpos(followpos_t& followpos) const BOOST_OVERRIDE;
void compute_state_match(state_match_t& state_match ) const BOOST_OVERRIDE;
void get_eof_ids(node_set& eof_set) const BOOST_OVERRIDE;
void assign_node_ids(node_id_t& node_count) BOOST_OVERRIDE;
#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX)
virtual void dump(std::ostream& out) const;
void dump(std::ostream& out) const BOOST_OVERRIDE;
#endif
private:
@@ -341,21 +345,21 @@ public:
or_node(const or_node& x);
virtual ~or_node(){}
virtual node* clone() const;
virtual bool nullable() const;
virtual node_set firstpos() const;
virtual node_set lastpos() const;
virtual void compute_followpos(followpos_t& followpos) const;
virtual void compute_state_match(state_match_t& state_match ) const;
virtual void get_eof_ids(node_set& eof_set) const;
virtual void assign_node_ids(node_id_t& node_count);
node* clone() const BOOST_OVERRIDE;
bool nullable() const BOOST_OVERRIDE;
node_set firstpos() const BOOST_OVERRIDE;
node_set lastpos() const BOOST_OVERRIDE;
void compute_followpos(followpos_t& followpos) const BOOST_OVERRIDE;
void compute_state_match(state_match_t& state_match ) const BOOST_OVERRIDE;
void get_eof_ids(node_set& eof_set) const BOOST_OVERRIDE;
void assign_node_ids(node_id_t& node_count) BOOST_OVERRIDE;
#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX)
virtual void dump(std::ostream& out) const;
void dump(std::ostream& out) const BOOST_OVERRIDE;
#endif
private:
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
std::unique_ptr<node> m_left;
std::unique_ptr<node> m_right;
#else
@@ -474,21 +478,21 @@ public:
cat_node(const cat_node& x);
virtual ~cat_node(){}
virtual node* clone() const;
virtual bool nullable() const;
virtual node_set firstpos() const;
virtual node_set lastpos() const;
virtual void compute_followpos(followpos_t& followpos) const;
virtual void compute_state_match(state_match_t& state_match ) const;
virtual void get_eof_ids(node_set& eof_set) const;
virtual void assign_node_ids(node_id_t& node_count);
node* clone() const BOOST_OVERRIDE;
bool nullable() const BOOST_OVERRIDE;
node_set firstpos() const BOOST_OVERRIDE;
node_set lastpos() const BOOST_OVERRIDE;
void compute_followpos(followpos_t& followpos) const BOOST_OVERRIDE;
void compute_state_match(state_match_t& state_match ) const BOOST_OVERRIDE;
void get_eof_ids(node_set& eof_set) const BOOST_OVERRIDE;
void assign_node_ids(node_id_t& node_count) BOOST_OVERRIDE;
#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX)
virtual void dump(std::ostream& out) const;
void dump(std::ostream& out) const BOOST_OVERRIDE;
#endif
private:
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
std::unique_ptr<node> m_left;
std::unique_ptr<node> m_right;
#else
@@ -630,21 +634,21 @@ public:
star_node(const star_node& x);
virtual ~star_node(){}
virtual node* clone() const;
virtual bool nullable() const;
virtual node_set firstpos() const;
virtual node_set lastpos() const;
virtual void compute_followpos(followpos_t& followpos) const;
virtual void compute_state_match(state_match_t& state_match ) const;
virtual void get_eof_ids(node_set& eof_set) const;
virtual void assign_node_ids(node_id_t& node_count);
node* clone() const BOOST_OVERRIDE;
bool nullable() const BOOST_OVERRIDE;
node_set firstpos() const BOOST_OVERRIDE;
node_set lastpos() const BOOST_OVERRIDE;
void compute_followpos(followpos_t& followpos) const BOOST_OVERRIDE;
void compute_state_match(state_match_t& state_match ) const BOOST_OVERRIDE;
void get_eof_ids(node_set& eof_set) const BOOST_OVERRIDE;
void assign_node_ids(node_id_t& node_count) BOOST_OVERRIDE;
#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX)
virtual void dump(std::ostream& out) const;
void dump(std::ostream& out) const BOOST_OVERRIDE;
#endif
private:
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
std::unique_ptr<node> m_left;
#else
std::auto_ptr<node> m_left;
@@ -753,16 +757,16 @@ public:
eof_node(const eof_node& x);
virtual ~eof_node(){}
virtual node* clone() const;
virtual bool nullable() const;
virtual node_set firstpos() const;
virtual node_set lastpos() const;
virtual void compute_followpos(followpos_t& followpos) const;
virtual void compute_state_match(state_match_t& state_match ) const;
virtual void get_eof_ids(node_set& eof_set) const;
virtual void assign_node_ids(node_id_t& node_count);
node* clone() const BOOST_OVERRIDE;
bool nullable() const BOOST_OVERRIDE;
node_set firstpos() const BOOST_OVERRIDE;
node_set lastpos() const BOOST_OVERRIDE;
void compute_followpos(followpos_t& followpos) const BOOST_OVERRIDE;
void compute_state_match(state_match_t& state_match ) const BOOST_OVERRIDE;
void get_eof_ids(node_set& eof_set) const BOOST_OVERRIDE;
void assign_node_ids(node_id_t& node_count) BOOST_OVERRIDE;
#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX)
virtual void dump(std::ostream& out) const;
void dump(std::ostream& out) const BOOST_OVERRIDE;
#endif
private:
@@ -867,16 +871,16 @@ public:
ccl_node(const ccl_node& x);
virtual ~ccl_node(){}
virtual node* clone() const;
virtual bool nullable() const;
virtual node_set firstpos() const;
virtual node_set lastpos() const;
virtual void compute_followpos(followpos_t& followpos) const;
virtual void compute_state_match(state_match_t& state_match ) const;
virtual void get_eof_ids(node_set& eof_set) const;
virtual void assign_node_ids(node_id_t& node_count);
node* clone() const BOOST_OVERRIDE;
bool nullable() const BOOST_OVERRIDE;
node_set firstpos() const BOOST_OVERRIDE;
node_set lastpos() const BOOST_OVERRIDE;
void compute_followpos(followpos_t& followpos) const BOOST_OVERRIDE;
void compute_state_match(state_match_t& state_match ) const BOOST_OVERRIDE;
void get_eof_ids(node_set& eof_set) const BOOST_OVERRIDE;
void assign_node_ids(node_id_t& node_count) BOOST_OVERRIDE;
#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX)
virtual void dump(std::ostream& out) const;
void dump(std::ostream& out) const BOOST_OVERRIDE;
#endif
private:
@@ -2417,7 +2421,7 @@ bool find_acceptance_state(const node_set& eof_node_ids,
}
template <typename RegexListT, typename GrammarT>
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
inline std::unique_ptr<node>
#else
inline std::auto_ptr<node>
@@ -2429,7 +2433,7 @@ parse_regexes(const RegexListT& regex_list, GrammarT& g)
boost::throw_exception(bad_regex());
typename RegexListT::const_iterator ri = regex_list.begin();
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
std::unique_ptr<node> tree(lexerimpl::parse(g, (*ri).str));
#else
std::auto_ptr<node> tree(lexerimpl::parse(g, (*ri).str));
@@ -2440,14 +2444,14 @@ parse_regexes(const RegexListT& regex_list, GrammarT& g)
++ri;
for (/**/; ri != regex_list.end(); ++ri)
{
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
std::unique_ptr<node> next_tree(lexerimpl::parse(g, (*ri).str));
#else
std::auto_ptr<node> next_tree(lexerimpl::parse(g, (*ri).str));
#endif
if (next_tree.get() == 0)
boost::throw_exception(bad_regex());
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
tree = std::unique_ptr<node>(new or_node(tree.release(), next_tree.release()));
#else
tree = std::auto_ptr<node>(new or_node(tree.release(), next_tree.release()));
@@ -2473,7 +2477,7 @@ inline void
lexer<IteratorT, TokenT, CallbackT>::create_dfa_for_state(int state)
{
using lexerimpl::node;
#ifdef BOOST_NO_AUTO_PTR
#ifndef BOOST_NO_CXX11_SMART_PTR
std::unique_ptr<node> tree = lexerimpl::parse_regexes(m_regex_list[state], g);
#else
std::auto_ptr<node> tree = lexerimpl::parse_regexes(m_regex_list[state], g);

View File

@@ -10,8 +10,8 @@
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
#define SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
#if !defined(BOOST_SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
#define BOOST_SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
#include <boost/wave/language_support.hpp>
#include <boost/wave/util/file_position.hpp>
@@ -85,4 +85,4 @@ struct slex_input_interface
} // namespace wave
} // namespace boost
#endif // !defined(SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
#endif // !defined(BOOST_SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)

View File

@@ -14,7 +14,7 @@
#define SLEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED
#include <string>
#include <iostream>
#include <iosfwd>
#include <boost/assert.hpp>
#include <boost/shared_ptr.hpp>

View File

@@ -10,8 +10,8 @@
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
#define SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED
#if !defined(BOOST_SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
#define BOOST_SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED
#include <iomanip>
#include <ios>
@@ -20,6 +20,7 @@
#include <boost/wave/token_ids.hpp>
#include <boost/wave/language_support.hpp>
#include <boost/wave/util/file_position.hpp>
#include <boost/optional.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace boost {
@@ -61,12 +62,19 @@ public:
operator token_id() const { return id; }
string_type const &get_value() const { return value; }
position_type const &get_position() const { return pos; }
position_type const &get_expand_position() const {
if (expand_pos)
return *expand_pos;
else
return pos;
}
bool is_eoi() const { return id == T_EOI; }
bool is_valid() const { return id != T_UNKNOWN; }
void set_token_id (token_id id_) { id = id_; }
void set_value (string_type const &newval) { value = newval; }
void set_position (position_type const &pos_) { pos = pos_; }
void set_expand_position (position_type const &pos_) { expand_pos = pos_; }
friend bool operator== (slex_token const& lhs, slex_token const& rhs)
{
@@ -115,6 +123,7 @@ private:
boost::wave::token_id id; // the token id
string_type value; // the text, which was parsed into this token
PositionT pos; // the original file position
boost::optional<PositionT> expand_pos;
};
template <typename PositionT>
@@ -142,4 +151,4 @@ token_is_valid(slex_token<Position> const& t)
} // namespace wave
} // namespace boost
#endif // !defined(SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
#endif // !defined(BOOST_SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)