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

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

?? exceptions.hpp

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

    Spirit V1.3.1
    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 from the use of this software.

    Permission is granted to anyone to use this software for any purpose,
    including commercial applications, and to alter it and redistribute
    it freely, subject to 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 from 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_EXCEPTIONS_HPP
#define SPIRIT_EXCEPTIONS_HPP

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

#include "boost/spirit/MSVC/parser.hpp"
#include "boost/spirit/MSVC/composite.hpp"

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

///////////////////////////////////////////////////////////////////////////////
//
//  parser_error_base class
//
//      This is the base class of parser_error (see below). This may
//      be used to catch any type of parser error.
//
///////////////////////////////////////////////////////////////////////////////
class parser_error_base {

protected:

    parser_error_base();
    ~parser_error_base();
    parser_error_base(parser_error_base const&);
    parser_error_base& operator=(parser_error_base const&);
};

///////////////////////////////////////////////////////////////////////////////
//
//  parser_error class
//
//      Generic parser exception class. This is the base class for all
//      parser exceptions. The exception holds the iterator position
//      where the error was encountered. This can be queried through
//      the exception's where() member function. In addition to the
//      iterator, parser_error also holds information regarding the
//      error (error descriptor). This can be queried through the
//      exception's what() member function.
//
//      The throw_ function creates and throws a parser_error given
//      an iterator and an error descriptor.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ErrorDescrT, typename IteratorT = char const*>
class parser_error : public parser_error_base {

public:

    parser_error(IteratorT where, ErrorDescrT what);

    IteratorT
    where() const;

    ErrorDescrT
    what() const;

private:

    IteratorT   iter;
    ErrorDescrT info;
};

//////////////////////////////////
template <typename ErrorDescrT, typename IteratorT>
void
throw_(IteratorT where, ErrorDescrT what);

///////////////////////////////////////////////////////////////////////////////
//
//  assertive_parser class
//
//      An assertive_parser class is a parser that throws an exception
//      in response to a parsing failure. The assertive_parser throws a
//      parser_error exception rather than returning an unsuccessful
//      match to signal that the parser failed to match the input.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ErrorDescrT, typename ParserT>
class assertive_parser
:   public unary<ParserT>,
    public parser<assertive_parser<ErrorDescrT, ParserT> > {

public:

    assertive_parser(ParserT const& parser, ErrorDescrT what);

    template <typename IteratorT>
    match
    parse(IteratorT& first, IteratorT const& last) const
    {
       match hit = this->subject().parse(first, last);
       if (!hit)
          throw parser_error<ErrorDescrT, IteratorT>(first, info);
       return hit;
    }


private:

    ErrorDescrT info;
};

///////////////////////////////////////////////////////////////////////////////
//
//  assertion class
//
//      assertive_parsers are never instantiated directly. The assertion
//      class is used to indirectly create an assertive_parser object.
//      Before declaring the grammar, we declare some assertion objects.
//      Examples:
//
//          enum Errors {
//
//              program_expected, begin_expected, end_expected
//          };
//
//          assertion<Errors>   expect_program(program_expected);
//          assertion<Errors>   expect_begin(begin_expected);
//          assertion<Errors>   expect_end(end_expected);
//
//      Now, we can use these assertions as wrappers around parsers:
//
//          expect_end(str_p("end"))
//
//      Take note that although the example uses enums to hold the
//      information regarding the error (error desccriptor), we are free
//      to use other types such as integers and strings. Enums are
//      convenient for error handlers to easily catch since C++ treats
//      enums as unique types.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ErrorDescrT>
class assertion {

public:

    assertion(ErrorDescrT what);

    template <typename ParserT>
    assertive_parser<ErrorDescrT, ParserT>
    operator()(ParserT const& parser) const
    {
        //  Borland 5.5 reports an internal compiler
        //  error if this is not defined here.
        return assertive_parser<ErrorDescrT, ParserT>(parser, info);
    }

private:

    ErrorDescrT info;
};

///////////////////////////////////////////////////////////////////////////////
//
//  fallback_parser class
//
//      Handles exceptions of type parser_error<ErrorDescrT, IteratorT>
//      thrown somewhere inside its embedded ParserT object. The class
//      sets up a try block before delegating parsing to its subject.
//      When an exception is caught, the catch block then calls the
//      HandlerT object. HandlerT may be a function or a functor (with
//      an operator() member function) compatible with the interface:
//
//          match   f(
//                      IteratorT&  first,
//                      IteratorT   last,
//                      IteratorT   where,
//                      ErrorDescrT what);
//
//      Where first points to the current input, last points to one
//      after the end of the input (same as STL algorithms), where
//      points to the position where the error was found and what
//      describes the nature of the error (error descriptor).
//
//      HandlerT may recover from the error and return a successful
//      match while advancing the iterator in the process. Otherwise,
//      it may return a no-match or re-throw another exception.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ErrorDescrT, typename ParserT, typename HandlerT>
class fallback_parser
:   public unary<ParserT>,
    public parser<fallback_parser<ErrorDescrT, ParserT, HandlerT> > {

public:

    fallback_parser(ParserT const& parser, HandlerT const& handler);

    template <typename IteratorT>
    match
    parse(IteratorT& first, IteratorT const& last) const
    {
      try {
#ifndef __BORLANDC__
         return this->subject().parse(first, last);
#else
         return impl::subject_parse(subject(), first, last);
#endif
      }

       catch (parser_error<ErrorDescrT, IteratorT> error) {
        return handler(first, last, error.where(), error.what());
    }
}


private:

    HandlerT    handler;
};

///////////////////////////////////////////////////////////////////////////////
//
//  guard class
//
//      fallback_parser objects are not instantiated directly. The guard
//      class is used to indirectly create a fallback_parser object.
//      guards are typically predeclared just like assertions (see the
//      assertion class above; the example extends the previous example
//      introduced in the assertion class above):
//
//          guard<Errors>   my_guard;
//
//      Errors, in this example is the error descriptor type we want to
//      detect; This is essentially the ErrorDescrT template parameter
//      of the fallback_parser class.
//
//      my_guard may now be used in a grammar declaration as:
//
//          my_guard(p, h)
//
//      where p is a parser, h is a function or functor compatible with
//      fallback_parser's HandlerT (see above).
//
///////////////////////////////////////////////////////////////////////////////
template <typename ErrorDescrT>
struct guard {

    template <typename ParserT, typename HandlerT>
    fallback_parser<ErrorDescrT, ParserT, HandlerT>
    operator()(ParserT const& parser, HandlerT const& handler)
    {
        //  Borland 5.5 reports an internal compiler
        //  error if this is not defined here.
        return fallback_parser<ErrorDescrT, ParserT, HandlerT>(parser, handler);
    }
};

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

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
艳妇臀荡乳欲伦亚洲一区| 国产综合久久久久影院| 美女一区二区三区在线观看| 国产精品一区专区| 欧美色精品在线视频| 久久久久久久久久看片| 亚洲国产精品嫩草影院| 成人av电影免费观看| 欧美成人女星排行榜| 亚洲一区二区三区四区在线| 国产精品一级黄| 日韩美女一区二区三区四区| 一区二区日韩电影| 97精品国产露脸对白| 久久久久久久网| 久久99久国产精品黄毛片色诱| 国产成人精品免费网站| 婷婷综合在线观看| 激情综合五月天| 午夜亚洲国产au精品一区二区| 日韩欧美久久久| 欧美日韩电影在线播放| 国产精品一二三| 国产欧美日韩视频一区二区| 91电影在线观看| 91久久免费观看| 国产精品视频第一区| 久久久久国产精品麻豆ai换脸| 日韩电影免费一区| 欧洲亚洲精品在线| 亚洲最大成人综合| 在线观看日产精品| 尤物av一区二区| 色综合中文字幕| 日本成人超碰在线观看| 欧美日韩免费在线视频| 亚洲亚洲精品在线观看| 欧美三日本三级三级在线播放| 一区二区三区免费观看| 欧美色精品在线视频| 午夜精品一区二区三区三上悠亚 | 337p亚洲精品色噜噜| 婷婷综合久久一区二区三区| 欧美嫩在线观看| 日韩精品每日更新| 欧美精品一区视频| 国产成人a级片| 亚洲欧洲中文日韩久久av乱码| 日本高清不卡一区| 舔着乳尖日韩一区| 精品国产麻豆免费人成网站| 国产精品久久久久久久久搜平片 | 97se亚洲国产综合自在线观| jizz一区二区| 色婷婷亚洲一区二区三区| xf在线a精品一区二区视频网站| 日韩精品午夜视频| 日韩午夜激情免费电影| 九九九精品视频| 中文字幕中文字幕一区二区| 色噜噜狠狠成人网p站| 精品国产精品一区二区夜夜嗨| 精品国产欧美一区二区| 亚洲一区二区在线免费看| 视频在线观看国产精品| 国产福利精品导航| 久久综合给合久久狠狠狠97色69| 91亚洲精华国产精华精华液| 欧美少妇性性性| 中文乱码免费一区二区| 蜜臀av一区二区| 欧美成人综合网站| 欧美mv日韩mv国产网站app| 亚洲在线视频免费观看| 欧美一区二区黄| eeuss鲁一区二区三区| 日韩精品电影在线| 国产精品久久久久久久久图文区| 色欧美片视频在线观看在线视频| 丝袜美腿亚洲色图| 1024精品合集| 久久一留热品黄| 欧美日韩三级在线| 99国产麻豆精品| 国内精品久久久久影院薰衣草| 亚洲欧美日韩久久| 久久久久国产一区二区三区四区| 欧洲色大大久久| 成人精品高清在线| 久久国产精品无码网站| 夜夜精品视频一区二区| 欧美国产精品一区| 欧美成人乱码一区二区三区| 在线观看免费成人| 成人av电影观看| 国产成人精品免费一区二区| 日本美女一区二区| 亚欧色一区w666天堂| 亚洲欧洲另类国产综合| 国产欧美一区二区精品婷婷| 欧美一区二区播放| 欧美丰满高潮xxxx喷水动漫 | 国产午夜亚洲精品羞羞网站| 337p亚洲精品色噜噜噜| 欧美体内she精视频| 一本一本大道香蕉久在线精品| 国产不卡在线播放| 国产精品白丝av| 国产福利一区二区三区| 精品一区二区在线视频| 久久成人羞羞网站| 久久99久久精品| 久久精品国产精品亚洲精品| 青青草97国产精品免费观看 | 国产精品不卡视频| 久久日一线二线三线suv| 日韩欧美电影在线| 日韩亚洲欧美高清| 日韩精品一区二区三区老鸭窝 | 成人的网站免费观看| 国产 日韩 欧美大片| 国产suv一区二区三区88区| 国产福利不卡视频| av一区二区不卡| 色婷婷综合久久久久中文一区二区| 99精品欧美一区二区蜜桃免费 | 欧美伊人久久大香线蕉综合69| 91福利小视频| 欧美这里有精品| 欧美系列一区二区| 日韩一区二区视频在线观看| 日韩精品一区二区三区视频播放| www欧美成人18+| 中文字幕精品三区| 亚洲综合视频在线观看| 日韩成人午夜精品| 国内精品久久久久影院薰衣草| 国产精品18久久久久久vr| 成人福利在线看| 欧美在线免费播放| 精品久久久久久久久久久久包黑料| 久久婷婷一区二区三区| 综合电影一区二区三区| 手机精品视频在线观看| 国内精品国产成人| 99久久精品免费看国产免费软件| 欧美中文字幕不卡| 日韩欧美电影一区| 中文字幕在线一区| 日韩av网站免费在线| 国产一区二区三区精品视频| 99久久综合国产精品| 欧美日韩国产经典色站一区二区三区 | 欧洲生活片亚洲生活在线观看| 91精品啪在线观看国产60岁| 国产人成亚洲第一网站在线播放| 一区二区免费在线播放| 狠狠v欧美v日韩v亚洲ⅴ| 一本色道久久加勒比精品| 日韩午夜激情免费电影| 亚洲视频小说图片| 国产一区二区电影| 精品视频资源站| 国产精品视频九色porn| 日韩av电影天堂| 91在线观看免费视频| 精品久久久网站| 亚洲综合一区二区三区| 国产成人在线视频免费播放| 91麻豆精品国产91久久久久| 中文字幕欧美日韩一区| 蜜桃av一区二区| 在线中文字幕一区| 欧美国产亚洲另类动漫| 麻豆91在线播放免费| 色婷婷亚洲一区二区三区| 国产午夜三级一区二区三| 日韩影院精彩在线| 欧洲精品一区二区三区在线观看| 久久久久久久久97黄色工厂| 日本大胆欧美人术艺术动态| 一本一道久久a久久精品| 国产精品毛片大码女人| 国产一区二区三区黄视频| 91精品综合久久久久久| 一区二区三区高清在线| av亚洲精华国产精华| 欧美国产成人在线| 国产精品一区二区三区网站| 欧美一级黄色片| 日韩二区三区四区| 欧美精品xxxxbbbb| 亚洲大片在线观看| 日本高清无吗v一区| 亚洲狼人国产精品| 日本道色综合久久| 亚洲一区在线观看免费观看电影高清 | 久久精品国产99久久6| 欧美一级一区二区| 免费成人在线网站|