// Copyright (c) 2001-2008 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_SPIRIT_LEX_SET_STATE_FEB_13_2008_0719PM) #define BOOST_SPIRIT_LEX_SET_STATE_FEB_13_2008_0719PM #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once // MS compatible compilers support #pragma once #endif #include /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { namespace tag { /////////////////////////////////////////////////////////////////////// // This is the tag returned by the set_state function template struct set_state_tag { String name; }; } /////////////////////////////////////////////////////////////////////////// // These are the different overloads allowed for the set_state(...) // construct, which is used by qi and by lex for lexer state switching // from inside a (parser or lexer) semantic action /////////////////////////////////////////////////////////////////////////// inline proto::terminal >::type set_state(char const *s) { proto::terminal >::type that = {{s}}; return that; } inline proto::terminal >::type set_state(wchar_t const *s) { proto::terminal >::type that = {{s}}; return that; } template inline proto::terminal >::type set_state(std::basic_string const& s) { typename proto::terminal >::type that = {{s.c_str()}}; return that; } /////////////////////////////////////////////////////////////////////////////// }} #endif