Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:02:34

0001 /*=============================================================================
0002     Copyright (c) 2001-2014 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 #if !defined(BOOST_SPIRIT_X3_CHAR_APRIL_16_2006_1051AM)
0008 #define BOOST_SPIRIT_X3_CHAR_APRIL_16_2006_1051AM
0009 
0010 #include <boost/spirit/home/x3/char/any_char.hpp>
0011 #include <boost/spirit/home/support/char_encoding/ascii.hpp>
0012 #include <boost/spirit/home/support/char_encoding/iso8859_1.hpp>
0013 #include <boost/spirit/home/support/char_encoding/standard.hpp>
0014 #include <boost/spirit/home/support/char_encoding/standard_wide.hpp>
0015 
0016 namespace boost { namespace spirit { namespace x3
0017 {
0018     namespace standard
0019     {
0020         typedef any_char<char_encoding::standard> char_type;
0021         constexpr auto char_ = char_type{};
0022 
0023         constexpr literal_char<char_encoding::standard, unused_type>
0024         lit(char ch)
0025         {
0026             return { ch };
0027         }
0028 
0029         constexpr literal_char<char_encoding::standard, unused_type>
0030         lit(wchar_t ch)
0031         {
0032             return { ch };
0033         }
0034 
0035     }
0036 
0037     using standard::char_type;
0038     using standard::char_;
0039     using standard::lit;
0040 
0041 #ifndef BOOST_SPIRIT_NO_STANDARD_WIDE
0042     namespace standard_wide
0043     {
0044         typedef any_char<char_encoding::standard_wide> char_type;
0045         constexpr auto char_ = char_type{};
0046 
0047         constexpr literal_char<char_encoding::standard_wide, unused_type>
0048         lit(wchar_t ch)
0049         {
0050             return { ch };
0051         }
0052     }
0053 #endif
0054 
0055     namespace ascii
0056     {
0057         typedef any_char<char_encoding::ascii> char_type;
0058         constexpr auto char_ = char_type{};
0059 
0060         constexpr literal_char<char_encoding::ascii, unused_type>
0061         lit(char ch)
0062         {
0063             return { ch };
0064         }
0065 
0066         constexpr literal_char<char_encoding::ascii, unused_type>
0067         lit(wchar_t ch)
0068         {
0069             return { ch };
0070         }
0071     }
0072 
0073     namespace iso8859_1
0074     {
0075         typedef any_char<char_encoding::iso8859_1> char_type;
0076         constexpr auto char_ = char_type{};
0077 
0078         constexpr literal_char<char_encoding::iso8859_1, unused_type>
0079         lit(char ch)
0080         {
0081             return { ch };
0082         }
0083 
0084         constexpr literal_char<char_encoding::iso8859_1, unused_type>
0085         lit(wchar_t ch)
0086         {
0087             return { ch };
0088         }
0089     }
0090 
0091     namespace extension
0092     {
0093         template <>
0094         struct as_parser<char>
0095         {
0096             typedef literal_char<
0097                 char_encoding::standard, unused_type>
0098             type;
0099 
0100             typedef type value_type;
0101 
0102             static constexpr type call(char ch)
0103             {
0104                 return { ch };
0105             }
0106         };
0107 
0108 #ifndef BOOST_SPIRIT_NO_STANDARD_WIDE
0109         template <>
0110         struct as_parser<wchar_t>
0111         {
0112             typedef literal_char<
0113                 char_encoding::standard_wide, unused_type>
0114             type;
0115 
0116             typedef type value_type;
0117 
0118             static constexpr type call(wchar_t ch)
0119             {
0120                 return { ch };
0121             }
0122         };
0123 #endif
0124 
0125         template <>
0126         struct as_parser<char [2]>
0127         {
0128             typedef literal_char<
0129                 char_encoding::standard, unused_type>
0130             type;
0131 
0132             typedef type value_type;
0133 
0134             static constexpr type call(char const ch[])
0135             {
0136                 return { ch[0] };
0137             }
0138         };
0139 
0140 #ifndef BOOST_SPIRIT_NO_STANDARD_WIDE
0141         template <>
0142         struct as_parser<wchar_t [2]>
0143         {
0144             typedef literal_char<
0145                 char_encoding::standard_wide, unused_type>
0146             type;
0147 
0148             typedef type value_type;
0149 
0150             static constexpr type call(wchar_t const ch[] )
0151             {
0152                 return { ch[0] };
0153             }
0154         };
0155 #endif
0156 
0157     }
0158 
0159 }}}
0160 
0161 #endif