⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 operators.ipp

📁 著名的Parser库Spirit在VC6上的Port
💻 IPP
📖 第 1 页 / 共 2 页
字号:
template <typename A>
inline alternative<A, strlit<cstring<char> > >
operator|(parser<A> const& a, char const* b)
{
    return alternative<A, strlit<cstring<char> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline alternative<strlit<cstring<char> >, B>
operator|(char const* a, parser<B> const& b)
{
    return alternative<strlit<cstring<char> >, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline alternative<A, chlit<wchar_t> >
operator|(parser<A> const& a, wchar_t b)
{
    return alternative<A, chlit<wchar_t> >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline alternative<chlit<wchar_t>, B>
operator|(wchar_t a, parser<B> const& b)
{
    return alternative<chlit<wchar_t>, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline alternative<A, strlit<cstring<wchar_t> > >
operator|(parser<A> const& a, wchar_t const* b)
{
    return alternative<A, strlit<cstring<wchar_t> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline alternative<strlit<cstring<wchar_t> >, B>
operator|(wchar_t const* a, parser<B> const& b)
{
    return alternative<strlit<cstring<wchar_t> >, B>(a, b.derived());
}

///////////////////////////////////////////////////////////////////////////////
//
//  intersection class implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename A, typename B>
inline intersection<A, B>
operator&(parser<A> const& a, parser<B> const& b)
{
    return intersection<A, B>(a.derived(), b.derived());
}

//////////////////////////////////
template <typename A>
inline intersection<A, chlit<char> >
operator&(parser<A> const& a, char b)
{
    return intersection<A, chlit<char> >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline intersection<chlit<char>, B>
operator&(char a, parser<B> const& b)
{
    return intersection<chlit<char>, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline intersection<A, strlit<cstring<char> > >
operator&(parser<A> const& a, char const* b)
{
    return intersection<A, strlit<cstring<char> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline intersection<strlit<cstring<char> >, B>
operator&(char const* a, parser<B> const& b)
{
    return intersection<strlit<cstring<char> >, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline intersection<A, chlit<wchar_t> >
operator&(parser<A> const& a, wchar_t b)
{
    return intersection<A, chlit<wchar_t> >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline intersection<chlit<wchar_t>, B>
operator&(wchar_t a, parser<B> const& b)
{
    return intersection<chlit<wchar_t>, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline intersection<A, strlit<cstring<wchar_t> > >
operator&(parser<A> const& a, wchar_t const* b)
{
    return intersection<A, strlit<cstring<wchar_t> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline intersection<strlit<cstring<wchar_t> >, B>
operator&(wchar_t const* a, parser<B> const& b)
{
    return intersection<strlit<cstring<wchar_t> >, B>(a, b.derived());
}

///////////////////////////////////////////////////////////////////////////////
//
//  difference class implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename A, typename B>
inline difference<A, B>
operator-(parser<A> const& a, parser<B> const& b)
{
    return difference<A, B>(a.derived(), b.derived());
}

//////////////////////////////////
template <typename A>
inline difference<A, chlit<char> >
operator-(parser<A> const& a, char b)
{
    return difference<A, chlit<char> >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline difference<chlit<char>, B>
operator-(char a, parser<B> const& b)
{
    return difference<chlit<char>, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline difference<A, strlit<cstring<char> > >
operator-(parser<A> const& a, char const* b)
{
    return difference<A, strlit<cstring<char> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline difference<strlit<cstring<char> >, B>
operator-(char const* a, parser<B> const& b)
{
    return difference<strlit<cstring<char> >, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline difference<A, chlit<wchar_t> >
operator-(parser<A> const& a, wchar_t b)
{
    return difference<A, chlit<wchar_t> >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline difference<chlit<wchar_t>, B>
operator-(wchar_t a, parser<B> const& b)
{
    return difference<chlit<wchar_t>, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline difference<A, strlit<cstring<wchar_t> > >
operator-(parser<A> const& a, wchar_t const* b)
{
    return difference<A, strlit<cstring<wchar_t> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline difference<strlit<cstring<wchar_t> >, B>
operator-(wchar_t const* a, parser<B> const& b)
{
    return difference<strlit<cstring<wchar_t> >, B>(a, b.derived());
}

///////////////////////////////////////////////////////////////////////////////
//
//  exclusive_or class implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename A, typename B>
inline exclusive_or<A, B>
operator^(parser<A> const& a, parser<B> const& b)
{
    return exclusive_or<A, B>(a.derived(), b.derived());
}

//////////////////////////////////
template <typename A>
inline exclusive_or<A, chlit<char> >
operator^(parser<A> const& a, char b)
{
    return exclusive_or<A, chlit<char> >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline exclusive_or<chlit<char>, B>
operator^(char a, parser<B> const& b)
{
    return exclusive_or<chlit<char>, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline exclusive_or<A, strlit<cstring<char> > >
operator^(parser<A> const& a, char const* b)
{
    return exclusive_or<A, strlit<cstring<char> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline exclusive_or<strlit<cstring<char> >, B>
operator^(char const* a, parser<B> const& b)
{
    return exclusive_or<strlit<cstring<char> >, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline exclusive_or<A, chlit<wchar_t> >
operator^(parser<A> const& a, wchar_t b)
{
    return exclusive_or<A, chlit<wchar_t> >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline exclusive_or<chlit<wchar_t>, B>
operator^(wchar_t a, parser<B> const& b)
{
    return exclusive_or<chlit<wchar_t>, B>(a, b.derived());
}

//////////////////////////////////
template <typename A>
inline exclusive_or<A, strlit<cstring<wchar_t> > >
operator^(parser<A> const& a, wchar_t const* b)
{
    return exclusive_or<A, strlit<cstring<wchar_t> > >(a.derived(), b);
}

//////////////////////////////////
template <typename B>
inline exclusive_or<strlit<cstring<wchar_t> >, B>
operator^(wchar_t const* a, parser<B> const& b)
{
    return exclusive_or<strlit<cstring<wchar_t> >, B>(a, b.derived());
}

///////////////////////////////////////////////////////////////////////////////
//
//  optional class implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename S>
optional<S>
operator!(parser<S> const& a)
{
    return optional<S>(a.derived());
}

///////////////////////////////////////////////////////////////////////////////
//
//  kleene_star class implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename S>
inline kleene_star<S>
operator*(parser<S> const& a)
{
    return kleene_star<S>(a.derived());
}

///////////////////////////////////////////////////////////////////////////////
//
//  positive class implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename S>
inline positive<S>
operator+(parser<S> const& a)
{
    return positive<S>(a.derived());
}

///////////////////////////////////////////////////////////////////////////////
}   //  namespace Spirit

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -