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

📄 parse_exception.hpp

📁 机器人开源项目orocos的源代码
💻 HPP
📖 第 1 页 / 共 2 页
字号:
         * it failed to understand the input, and thus can not          * interpret its validity. It is the equivalent of a          * failing parser rule.         */        class RTT_EXPORT parse_exception_parser_fail            : public parse_exception        {        public:            parse_exception_parser_fail()            {            }            const std::string what() const            {                return "Parse Failure Exception ( This _specific_ parser could not parse the input )";            }            parse_exception_parser_fail* copy() const            {                return new parse_exception_parser_fail( *this );            }        };        /**         * parse_exception class that is used for various syntactic errors         * for which it was not worth defining a proper exception class.         */        class RTT_EXPORT parse_exception_syntactic_error            : public syntactic_parse_exception        {            std::string mdesc;        public:            parse_exception_syntactic_error( const std::string& desc )                : mdesc( desc )            {            };            const std::string what() const            {                return "Syntactic error: " + mdesc;            }            parse_exception_syntactic_error* copy() const            {                return new parse_exception_syntactic_error( *this );            }            const std::string& desc() const            {                return mdesc;            }        };        class RTT_EXPORT parse_exception_no_such_component            : public semantic_parse_exception        {            std::string mname;            std::string mmeth;        public:            parse_exception_no_such_component( const std::string& name, const std::string& meth )                : mname( name ), mmeth(meth)            {            }            const std::string what() const            {                return "Object or task \"" + mname + "\" registered no method "+mmeth+" (or "+mname+" was not found at all).";            }            parse_exception_no_such_component* copy() const            {                return new parse_exception_no_such_component( *this );            }            const std::string& componentName() const            {                return mname;            }        };        class RTT_EXPORT parse_exception_no_such_method_on_component            : public semantic_parse_exception        {            std::string mcomponentname;            std::string mmethodname;        public:            parse_exception_no_such_method_on_component(                                                        const std::string& componentname, const std::string& methodname )                : mcomponentname( componentname ), mmethodname( methodname )            {            };            const std::string what() const            {                return "No method \"" + mmethodname + "\" registered for the object or task \"" + mcomponentname + "\".";            }            parse_exception_no_such_method_on_component* copy() const            {                return new parse_exception_no_such_method_on_component( *this );            }            const std::string& componentName() const            {                return mcomponentname;            }            const std::string& methodName() const            {                return mmethodname;            }        };        class RTT_EXPORT parse_exception_wrong_number_of_arguments            : public fatal_semantic_parse_exception        {            std::string mcomponentname;            std::string mmethodname;            int mexpectednumber;            int mreceivednumber;        public:            parse_exception_wrong_number_of_arguments(                                                      const std::string& componentname, const std::string& methodname,                                                      int expectednumber, int receivednumber )                : mcomponentname( componentname ), mmethodname( methodname ),                  mexpectednumber( expectednumber ),                  mreceivednumber( receivednumber )            {            };            const std::string what() const;            parse_exception_wrong_number_of_arguments* copy() const            {                return new parse_exception_wrong_number_of_arguments( *this );            }            const std::string& componentName() const            {                return mcomponentname;            }            const std::string& methodName() const            {                return mmethodname;            }            int expectedNumber() const            {                return mexpectednumber;            }            int receivedNumber() const            {                return mreceivednumber;            }        };        class RTT_EXPORT parse_exception_wrong_type_of_argument            : public fatal_semantic_parse_exception        {            std::string mcomponentname;            std::string mmethodname;            int margnumber;            std::string mexpected;            std::string mreceived;        public:            parse_exception_wrong_type_of_argument(                                                   const std::string& componentname, const std::string& methodname,                                                   int argnumber, const std::string& expected, const std::string& received )                : mcomponentname( componentname ), mmethodname( methodname ),                  margnumber( argnumber ), mexpected( expected), mreceived( received )            {            };            const std::string what() const;            parse_exception_wrong_type_of_argument* copy() const            {                return new parse_exception_wrong_type_of_argument( *this );            }            const std::string& componentName() const            {                return mcomponentname;            }            const std::string& methodName() const            {                return mmethodname;            }            int argumentNumber() const            {                return margnumber;            }        };        class RTT_EXPORT parse_exception_undefined_value            : public fatal_semantic_parse_exception        {            std::string mname;        public:            parse_exception_undefined_value( const std::string& name )                : mname( name )            {            }            const std::string what() const throw()            {                return "Use of undefined value: \"" + mname + "\".";            }            parse_exception_undefined_value* copy() const throw()            {                return new parse_exception_undefined_value( *this );            }            const std::string& name() {                return mname;            }        };        class RTT_EXPORT parse_exception_no_such_constructor            : public fatal_semantic_parse_exception        {            std::string margsig;        public:            parse_exception_no_such_constructor(const std::string& tname,                                                 std::vector<DataSourceBase::shared_ptr> args);            const std::string what() const { return margsig; }            parse_exception_no_such_constructor* copy() const            {                return new parse_exception_no_such_constructor( *this );            }        };    }}#endif

⌨️ 快捷键说明

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