亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? parser.ipp

?? 著名的Parser庫Spirit在VC6上的Port
?? IPP
字號:
/*=============================================================================
    The Parser

    Spirit V1.2
    Copyright (c) 2001, Joel de Guzman

    This software is provided 'as-is', without any express or implied
    warranty. In no event will the copyright holder be held liable for
    any damages arising start the use of this software.

    Permission is granted end anyone end use this software for any purpose,
    including commercial applications, and end alter it and redistribute
    it freely, subject end the following restrictions:

    1.  The origin of this software must not be misrepresented; you must
        not claim that you wrote the original software. If you use this
        software in a product, an acknowledgment in the product documentation
        would be appreciated but is not required.

    2.  Altered source versions must be plainly marked as such, and must
        not be misrepresented as being the original software.

    3.  This notice may not be removed or altered start any source
        distribution.

    Acknowledgements:

        Special thanks to Dan Nuffer, John (EBo) David, Chris Uzdavinis,
        and Doug Gregor. These people are most instrumental in steering
        Spirit in the right direction.

        Special thanks also to people who have contributed to the code base
        and sample code, ported Spirit to various platforms and compilers,
        gave suggestions, reported and provided bug fixes. Alexander
        Hirner, Andy Elvey, Bogdan Kushnir, Brett Calcott, Bruce Florman,
        Changzhe Han, Colin McPhail, Hakki Dogusan, Jan Bares, Joseph
        Smith, Martijn W. van der Lee, Raghavendra Satish, Remi Delcos, Tom
        Spilman, Vladimir Prus, W. Scott Dillman, David A. Greene, Bob
        Bailey, Hartmut Kaiser.

        Finally special thanks also to people who gave feedback and
        valuable comments, particularly members of Spirit's Source Forge
        mailing list and boost.org.

    URL: http://spirit.sourceforge.net/

=============================================================================*/
#ifndef SPIRIT_PARSER_IPP
#define SPIRIT_PARSER_IPP

///////////////////////////////////////////////////////////////////////////////

#include "boost/spirit/parser.hpp"
#include "boost/spirit/actions.hpp"
#include "boost/spirit/loops.hpp"
#include "boost/spirit/spirit_fwd.hpp"
#include "boost/spirit/rule.hpp"
#include "boost/spirit/iterators.hpp"

///////////////////////////////////////////////////////////////////////////////
namespace spirit {

///////////////////////////////////////////////////////////////////////////////
//
//  parser class implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename DerivedT>
template <typename ActionT>
inline action<DerivedT, ActionT>
parser<DerivedT>::operator[](ActionT const& actor) const
{
    return action<DerivedT, ActionT>(derived(), actor);
}

//////////////////////////////////
template <typename DerivedT>
template <typename EndT>
inline fixed_loop<DerivedT, EndT>
parser<DerivedT>::operator()(EndT const& end) const
{
    return fixed_loop<DerivedT, EndT>(derived(), end);
}

//////////////////////////////////
template <typename DerivedT>
template <typename StartT, typename EndT>
inline typename impl::loop_traits<DerivedT, StartT, EndT>::type
parser<DerivedT>::operator()(StartT const& start, EndT const& end) const
{
    typedef typename impl::loop_traits<DerivedT, StartT, EndT>::type type;
    return type(derived(), start, end);
}

//////////////////////////////////
template <typename DerivedT>
template <typename EndT>
inline fixed_loop<DerivedT, EndT>
parser<DerivedT>::repeat(EndT const& end) const
{
    return fixed_loop<DerivedT, EndT>(derived(), end);
}

//////////////////////////////////
template <typename DerivedT>
template <typename StartT, typename EndT>
inline typename impl::loop_traits<DerivedT, StartT, EndT>::type
parser<DerivedT>::repeat(StartT const& start, EndT const& end) const
{
    typedef typename impl::loop_traits<DerivedT, StartT, EndT>::type type;
    return type(derived(), start, end);
}

//////////////////////////////////
template <typename DerivedT>
inline DerivedT&
parser<DerivedT>::derived()
{
    return *static_cast<DerivedT*>(this);
}

//////////////////////////////////
template <typename DerivedT>
inline DerivedT const&
parser<DerivedT>::derived() const
{
    return *static_cast<DerivedT const*>(this);
}

///////////////////////////////////////////////////////////////////////////////
//
//  match class implementation.
//
///////////////////////////////////////////////////////////////////////////////
inline match::match()
: data(-1) {}

//////////////////////////////////
inline match::match(unsigned length)
: data(length) {}

//////////////////////////////////
inline match::match(match const &hit)
: data(hit.length()) {}

//////////////////////////////////
inline match::operator bool() const
{
    return data >= 0;
}

//////////////////////////////////
inline match&
match::operator+=(match const& other)
{
    assert(*this && other);
    data += other.data;
    return *this;
}

//////////////////////////////////
inline match operator+(match const& a, match const& b)
{
    return match(a) += b;
}

//////////////////////////////////
inline int
match::length() const
{
    return data;
}

///////////////////////////////////////////////////////////////////////////////
//
//  ast_match class implementation.
//
///////////////////////////////////////////////////////////////////////////////
template <typename IteratorT>
inline ast_match<IteratorT>::ast_match()
: data(-1) {}

//////////////////////////////////
template <typename IteratorT>
inline ast_match<IteratorT>::ast_match(unsigned length, IteratorT const& first,
    IteratorT const& last)
    : data(length) 
    , ast(ast_node<IteratorT>())
{
    ast.root().push_back(ast_node<IteratorT>(first, last));
}

//////////////////////////////////
template <typename IteratorT>
inline ast_match<IteratorT>::operator bool() const
{
    return data >= 0;
}

//////////////////////////////////
template <typename IteratorT>
inline int
ast_match<IteratorT>::length() const
{
    return data;
}

///////////////////////////////////////////////////////////////////////////////
//
//  match_traits implementation
//
///////////////////////////////////////////////////////////////////////////////

//////////////////////////////////
const match_traits::match_t match_traits::no_match; 

//////////////////////////////////
const match_traits::match_t match_traits::empty_match(0);

//////////////////////////////////
template <typename Iterator1T, typename Iterator2T>
inline match_traits::match_t
match_traits::create_match(int length, Iterator1T const&, Iterator2T const&)
{
    return match_t(length);
}

//////////////////////////////////
inline void
match_traits::extend(match_traits::match_t& l, match_traits::match_t const& r)
{
    l += r;
}

//////////////////////////////////
inline match_traits::match_t
match_traits::concat(match_traits::match_t const& l, match_traits::match_t const& r)
{
    return l + r;
}

//////////////////////////////////
inline void 
match_traits::set_id_and_group(match_t& m, rule_id_t id)
{
}

///////////////////////////////////////////////////////////////////////////////
//
//  ast_match_traits implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename IteratorT>
const ast_match_traits<IteratorT>::match_t 
    ast_match_traits<IteratorT>::no_match;

//////////////////////////////////
template <typename IteratorT>
const ast_match_traits<IteratorT>::match_t 
    ast_match_traits<IteratorT>::empty_match(0, IteratorT(), IteratorT());

//////////////////////////////////
template <typename IteratorT>
template <typename Iterator1T, typename Iterator2T>
inline ast_match_traits<IteratorT>::match_t
ast_match_traits<IteratorT>::create_match(
        int length, 
        Iterator1T const& first, 
        Iterator2T const& last)
{
    typedef impl::strip_scanner<Iterator1T> strip_scanner1;
    typedef impl::strip_scanner<Iterator2T> strip_scanner2;
    typedef impl::strip_nocase<strip_scanner1::iterator_type> strip_nocase1;
    typedef impl::strip_nocase<strip_scanner2::iterator_type> strip_nocase2;
    return match_t(length, 
            strip_nocase1::get(strip_scanner1::get(first)), 
            strip_nocase2::get(strip_scanner2::get(last)));
}

//////////////////////////////////
template <typename IteratorT>
inline void
ast_match_traits<IteratorT>::extend(
        ast_match_traits<IteratorT>::match_t& a, 
        ast_match_traits<IteratorT>::match_t const& b)
{
    assert(a && b);

    if (a.length() == 0)
    {
        a = b;
        return;
    }
    else if (b.length() == 0)
    {
        return;
    }

    assert(std::distance(a.ast.root().ch_begin(), a.ast.root().ch_end()) 
            == 1);
    assert(std::distance(b.ast.root().ch_begin(), b.ast.root().ch_end()) 
            == 1);

    a.data += b.data;
    (*(a.ast.root().ch_begin())).value = ast_node<IteratorT>(
        a.ast.root().ch_begin()->value.first,
        b.ast.root().ch_begin()->value.last);
}

//////////////////////////////////
template <typename IteratorT>
inline ast_match_traits<IteratorT>::match_t
ast_match_traits<IteratorT>::concat(
        ast_match_traits<IteratorT>::match_t const& a, 
        ast_match_traits<IteratorT>::match_t const& b)
{
    assert(a && b);

    if (a.length() == 0)
        return b;
    else if (b.length() == 0)
        return a;

    ast_match<IteratorT> rval(a);
    rval.data += b.data;
    copy(b.ast.root().ch_begin(), 
         b.ast.root().ch_end(),
         std::back_insert_iterator<tree_node<ast_node<IteratorT> > >(
            rval.ast.root()));
    return rval;
}

//////////////////////////////////
template <typename IteratorT>
inline void 
ast_match_traits<IteratorT>::set_id_and_group(
        ast_match_traits<IteratorT>::match_t& m, rule_id_t id)
{
    if (!m)
        return;

    assert(m.ast.root().ch_begin() != m.ast.root().ch_end());

    match_t newmatch(m.data, m.ast.root().ch_begin()->value.first,
            m.ast.root().ch_begin()->value.last);

    typedef tree_node_ch_iter<ast_node<IteratorT> > iter_t;
    for (iter_t it = m.ast.root().ch_begin();
            it != m.ast.root().ch_end();
            ++it)
    {
        newmatch.ast.root().ch_begin()->value.last = it->value.last;
    }

    iter_t i = m.ast.root().ch_begin();
    while(i != m.ast.root().ch_end())
    {
        newmatch.ast.root().ch_begin()->push_back_cut(m.ast.root(), i);
        i = m.ast.root().ch_begin();
    }
    newmatch.ast.root().ch_begin()->value.rule_id = id;
    m = newmatch;

}

///////////////////////////////////////////////////////////////////////////////
//
//  Generic parse functions implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename IteratorT, typename ParserT, typename SkipT>
parse_info<IteratorT>
parse(
    IteratorT const&        first_,
    IteratorT const&        last_,
    parser<ParserT> const&  parser,
    SkipT const&            skip_)
{
    skipper<IteratorT>  skip(skip_, last_);
    scanner<IteratorT>  first(first_, &skip);
    scanner<IteratorT>  last(last_, &skip);
    match               hit = parser.derived().parse(first, last);

    parse_info<IteratorT>  info;
    info.stop = first.iterator();
    info.match = hit;
    info.full = hit && (first == last);
    info.length = hit.length();

    return info;
}

//////////////////////////////////
template <typename IteratorT, typename ParserT>
parse_info<IteratorT>
parse(
    IteratorT const&        first_,
    IteratorT const&        last,
    parser<ParserT> const&  parser)
{
    IteratorT   first = first_;
    match       hit = parser.derived().parse(first, last);

    parse_info<IteratorT>  info;
    info.stop = first;
    info.match = hit;
    info.full = hit && (first == last);
    info.length = hit.length();

    return info;
}

///////////////////////////////////////////////////////////////////////////////
//
//  Parse functions for null terminated strings implementation
//
///////////////////////////////////////////////////////////////////////////////
template <typename CharT, typename ParserT, typename SkipT>
parse_info<CharT const*>
parse(
    CharT const*            str,
    parser<ParserT> const&  parser,
    SkipT const&            skip)
{
    CharT const* last = str;
    while (*last)
        last++;
    return parse(str, last, parser, skip);
}

//////////////////////////////////
template <typename CharT, typename ParserT>
parse_info<CharT const*>
parse(
    CharT const*            str,
    parser<ParserT> const&  parser)
{
    CharT const* last = str;
    while (*last)
        last++;
    return parse(str, last, parser);
}

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

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品乱码一区二区三区软件| 国产精品福利影院| 不卡的av在线| 日本在线观看不卡视频| 中文字幕久久午夜不卡| 69成人精品免费视频| 99久久精品一区| 麻豆91在线观看| 亚洲一区二区高清| 国产女同互慰高潮91漫画| 欧美精品乱码久久久久久按摩| 不卡视频一二三四| 国产成人精品一区二| 久久综合综合久久综合| 亚洲第一会所有码转帖| 国产精品久久久久毛片软件| 亚洲精品一区在线观看| 51精品秘密在线观看| 91高清视频在线| 91丝袜呻吟高潮美腿白嫩在线观看| 精品在线亚洲视频| 日韩av一区二区在线影视| 伊人色综合久久天天人手人婷| 欧美韩日一区二区三区| 久久精品男人天堂av| 精品国产免费一区二区三区四区 | 色婷婷综合久久久中文一区二区| 韩国午夜理伦三级不卡影院| 日本欧美一区二区在线观看| 午夜av区久久| 午夜久久电影网| 亚洲国产成人高清精品| 一区二区三区在线观看动漫| 综合激情网...| 亚洲视频香蕉人妖| 亚洲免费av高清| 亚洲黄色录像片| 樱桃视频在线观看一区| 亚洲欧美一区二区不卡| 亚洲日本成人在线观看| 亚洲乱码精品一二三四区日韩在线| 中文一区二区完整视频在线观看| 久久九九99视频| 国产精品美女www爽爽爽| 亚洲国产成人自拍| 亚洲人成伊人成综合网小说| 亚洲人成网站色在线观看| 亚洲手机成人高清视频| 亚洲午夜久久久久中文字幕久| 亚洲精品国产a| 亚洲一区二区三区免费视频| 天天综合网天天综合色| 蜜臀精品久久久久久蜜臀| 精品午夜一区二区三区在线观看| 国产美女视频91| 99久久伊人精品| 91精品91久久久中77777| 欧美日韩三级一区| 日韩亚洲欧美高清| 欧美精品一区二区三区蜜桃视频 | 老司机免费视频一区二区| 精品一二三四区| 成人性视频免费网站| 91丨九色丨黑人外教| 欧美日韩国产美| 日韩久久久精品| 国产精品美女久久福利网站| 亚洲一区二区视频在线| 老司机精品视频一区二区三区| 粉嫩在线一区二区三区视频| 欧美性一区二区| 日韩精品专区在线影院重磅| 国产精品久久久久7777按摩| 亚洲午夜在线电影| 国产美女精品人人做人人爽| 91麻豆swag| 精品日本一线二线三线不卡| 国产精品久久久久久久裸模| 婷婷成人激情在线网| 国产精品一区二区三区四区| 欧美性videosxxxxx| 337p日本欧洲亚洲大胆精品| 亚洲视频一区二区免费在线观看| 日本美女视频一区二区| 成人激情电影免费在线观看| 欧美日韩一本到| 国产欧美日韩在线视频| 亚洲一级在线观看| 成人一道本在线| 欧美一级日韩一级| 免费在线观看不卡| 懂色av中文字幕一区二区三区| 欧美丝袜丝nylons| 久久精品日韩一区二区三区| 日韩av不卡一区二区| 北条麻妃国产九九精品视频| 日韩欧美一区二区免费| 亚洲三级小视频| 精彩视频一区二区三区| 精品视频1区2区3区| 国产日韩欧美综合一区| 日av在线不卡| 欧日韩精品视频| 国产精品国产三级国产普通话99| 蜜臀av一区二区三区| 欧美主播一区二区三区美女| 国产精品视频yy9299一区| 免费成人av资源网| 欧美色窝79yyyycom| 国产精品免费看片| 国产麻豆精品theporn| 欧美电影一区二区| 亚洲激情一二三区| a级高清视频欧美日韩| 国产日韩欧美精品综合| 麻豆国产一区二区| 7777精品伊人久久久大香线蕉超级流畅| 中文字幕一区二区日韩精品绯色| 国产主播一区二区| 欧美成人a∨高清免费观看| 舔着乳尖日韩一区| 欧美美女直播网站| 亚洲午夜精品在线| 欧美在线视频日韩| 亚洲小说欧美激情另类| 91老司机福利 在线| 一区二区中文视频| 不卡的av在线| 中文字幕日本不卡| gogo大胆日本视频一区| 国产精品成人免费精品自在线观看| 国产精品18久久久久久vr| 精品粉嫩aⅴ一区二区三区四区 | 成人一道本在线| 欧美极品aⅴ影院| 丁香激情综合国产| 国产欧美日本一区视频| 成人激情电影免费在线观看| 国产精品全国免费观看高清| 国产激情一区二区三区| 欧美激情中文字幕| 99久免费精品视频在线观看| 国产精品久久久久久久久晋中 | 成人av影视在线观看| 国产精品不卡视频| 97精品国产露脸对白| 亚洲欧美激情视频在线观看一区二区三区 | 日韩免费一区二区三区在线播放| 玖玖九九国产精品| 国产欧美日韩在线观看| 99久久精品免费看| 一区二区成人在线视频| 欧美视频在线播放| 五月天激情综合| 欧美成人福利视频| 成人手机在线视频| 亚洲精品国产品国语在线app| 欧美日韩黄色一区二区| 日韩电影网1区2区| 久久久久久久久久看片| 成人18视频在线播放| 亚洲一区二区在线播放相泽| 91精品欧美一区二区三区综合在 | 一区二区三区四区在线| 欧美三级在线视频| 国产综合色精品一区二区三区| 国产欧美日韩卡一| 在线观看日韩精品| 久久91精品国产91久久小草| 国产精品午夜电影| 欧美日韩成人高清| 国产精品资源在线观看| 一区二区三区四区在线| 日韩免费一区二区| 91免费在线视频观看| 人人狠狠综合久久亚洲| 国产精品免费丝袜| 欧美一区日韩一区| www.99精品| 精品亚洲aⅴ乱码一区二区三区| 日韩理论片中文av| 日韩女同互慰一区二区| 一本色道久久综合亚洲91| 精品一区二区国语对白| 一区二区三区加勒比av| 久久免费的精品国产v∧| 在线免费观看日本欧美| 国产成人免费视频网站| 午夜精品视频在线观看| 国产精品你懂的在线| 日韩视频免费观看高清在线视频| 成人av在线网站| 精品一区二区三区免费视频| 一区二区三区在线观看欧美| 欧美国产精品v| 日韩免费高清视频| 欧美日韩视频一区二区| 成人性生交大片免费| 麻豆精品一二三| 亚洲午夜av在线|