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

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

?? commandparser.cpp

?? 機器人開源項目orocos的源代碼
?? CPP
字號:
/***************************************************************************  tag: Peter Soetens  Mon May 10 19:10:37 CEST 2004  CommandParser.cxx                        CommandParser.cxx -  description                           -------------------    begin                : Mon May 10 2004    copyright            : (C) 2004 Peter Soetens    email                : peter.soetens@mech.kuleuven.ac.be *************************************************************************** *   This library is free software; you can redistribute it and/or         * *   modify it under the terms of the GNU Lesser General Public            * *   License as published by the Free Software Foundation; either          * *   version 2.1 of the License, or (at your option) any later version.    * *                                                                         * *   This library is distributed in the hope that it will be useful,       * *   but WITHOUT ANY WARRANTY; without even the implied warranty of        * *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     * *   Lesser General Public License for more details.                       * *                                                                         * *   You should have received a copy of the GNU Lesser General Public      * *   License along with this library; if not, write to the Free Software   * *   Foundation, Inc., 59 Temple Place,                                    * *   Suite 330, Boston, MA  02111-1307  USA                                * *                                                                         * ***************************************************************************/#include "parser-debug.hpp"#include "parse_exception.hpp"#ifdef ORO_PRAGMA_INTERFACE#pragma implementation#endif#include "CommandParser.hpp"#include <boost/bind.hpp>#include <boost/lexical_cast.hpp>#include <functional>#include <algorithm>#include "CommandNOP.hpp"#include "CommandDataSource.hpp"#include "ConditionTrue.hpp"#include "ConditionOnce.hpp"#include "AsynchCommandDecorator.hpp"#include "TaskContext.hpp"#include "ArgumentsParser.hpp"#include "ConditionComposite.hpp"#include "DispatchAction.hpp"namespace RTT{    using boost::bind;    using namespace detail;    namespace {        assertion<std::string> expect_methodname("Expected a method call on object.");        assertion<std::string> expect_args( "Expected method call arguments between ()." );    }  CommandParser::CommandParser( TaskContext* c, bool as_action)      : mas_action( as_action ),        dcom(0), retcommand( 0 ),        implicittermcondition( 0 ), peer(0), context( c ),        argsparser( 0 ), expressionparser( c ), peerparser( c )  {    BOOST_SPIRIT_DEBUG_RULE( objectmethod );    BOOST_SPIRIT_DEBUG_RULE( callcommand );    BOOST_SPIRIT_DEBUG_RULE( nopcommand );    BOOST_SPIRIT_DEBUG_RULE( command );    BOOST_SPIRIT_DEBUG_RULE( arguments );    command = nopcommand | callcommand;    nopcommand = str_p( "nothing" )[      bind( &CommandParser::seennopcommand, this ) ];    // a function call: "x.y( arg1, arg2, ..., argN )"    // a command can optionally be declared synchronous by    // putting the word "sync" in front of it..    callcommand =        objectmethod [           bind( &CommandParser::seenstartofcall, this ) ]      >> expect_args( arguments[           bind( &CommandParser::seencallcommand, this ) ]);    // the "x.y" part of a function call..    // when 'x.' is ommitted, 'this.' is assumed.    objectmethod = !peerparser.parser()        >> lexeme_d[ expect_methodname( commonparser.lexeme_identifier[           bind( &CommandParser::seenmethodname, this, _1, _2 ) ])        ];  }  void CommandParser::seennopcommand()  {    retcommand = new CommandNOP;    implicittermcondition = new ConditionOnce( false );  }  void CommandParser::seenstartofcall()  {      mcurobject = peerparser.object();      peer = peerparser.peer();      OperationInterface* obj = peerparser.taskObject();      peerparser.reset();      if ( obj == 0 )          throw parse_exception_no_such_component( peer->getName(), mcurobject+"."+mcurmethod );      else {          if ( obj->methods()->hasMember(mcurmethod) == false && obj->commands()->hasMember(mcurmethod) == false && obj->events()->hasMember(mcurmethod) == false) {              if ( mcurobject == "this" )                   mcurobject = peer->getName();              throw parse_exception_no_such_method_on_component( mcurobject, mcurmethod );          }      }      // ok object and method are found.      argsparser = new ArgumentsParser( expressionparser, peer, obj,                                        mcurobject, mcurmethod );      arguments = argsparser->parser();  }  void CommandParser::seencallcommand()  {      assert( peer );    // not really necessary, since mcurobject and mcurmethod should    // still be valid, but anyway :)    mcurobject = argsparser->objectname();    mcurmethod = argsparser->methodname();    OperationInterface* obj = argsparser->object();    CommandRepository::Factory* cfi = obj->commands();    MethodRepository::Factory* mfi = obj->methods();    EventService::Factory* efi = obj->events();    assert(mfi);    assert(cfi);    assert(efi);    typedef std::pair<CommandInterface*,ConditionInterface*> ComCon;    ComCon comcon;    if ( cfi->hasMember( mcurmethod ) )        try            {                dcom = cfi->produce( mcurmethod, argsparser->result() );                // check if wrapping is required:                if ( mas_action ) {                    // wrap it.                    comcon.first = new DispatchAction(dcom);                } else {                    // plain dispatch                    comcon.first = dcom;                }                comcon.second = dcom->createCondition();            }        catch( const wrong_number_of_args_exception& e )            {                throw parse_exception_wrong_number_of_arguments                    (mcurobject, mcurmethod, e.wanted, e.received );            }        catch( const wrong_types_of_args_exception& e )            {                throw parse_exception_wrong_type_of_argument                    ( mcurobject, mcurmethod, e.whicharg, e.expected_, e.received_ );            }        catch( ... )            {                assert( false );            }    else if ( mfi->hasMember( mcurmethod ) )        try            {                // if the method returns a boolean, construct it as a command                // which accepts/rejects the result.                DataSourceBase* dsb =  mfi->produce( mcurmethod, argsparser->result() );                DataSource<bool>* dsb_res = DataSource<bool>::narrow( dsb );                if ( dsb_res == 0 )                    comcon.first =  new CommandDataSource( dsb );                else                    comcon.first =  new CommandDataSourceBool( dsb_res );                comcon.second = new ConditionTrue();            }        catch( const wrong_number_of_args_exception& e )            {                throw parse_exception_wrong_number_of_arguments                    (mcurobject, mcurmethod, e.wanted, e.received );            }        catch( const wrong_types_of_args_exception& e )            {                throw parse_exception_wrong_type_of_argument                    ( mcurobject, mcurmethod, e.whicharg, e.expected_, e.received_ );            }        catch( ... )            {                assert( false );            }    else if ( efi->hasMember( mcurmethod ) )        try            {                // if the method returns a boolean, construct it as a command                // which accepts/rejects the result.                comcon.first  = efi->produce( mcurmethod, argsparser->result() );                comcon.second = new ConditionTrue();            }        catch( const wrong_number_of_args_exception& e )            {                throw parse_exception_wrong_number_of_arguments                    (mcurobject, mcurmethod, e.wanted, e.received );            }        catch( const wrong_types_of_args_exception& e )            {                throw parse_exception_wrong_type_of_argument                    ( mcurobject, mcurmethod, e.whicharg, e.expected_, e.received_ );            }        catch( ... )            {                assert( false );            }    else {        assert( false );    }    delete argsparser;    argsparser = 0;    // argumentsparser.result() should have been properly filled up,    // and mcurobject.mcurmethod should exist, we checked that in    // seenstartofcall() already, so com should really be valid..    if ( ! comcon.first )      throw parse_exception_fatal_semantic_error(        "Something weird went wrong in calling method \"" + mcurmethod +        "\" on object \"" + mcurobject + "\"." );    if ( ! comcon.second )        comcon.second = new ConditionTrue;    retcommand = comcon.first;    implicittermcondition = comcon.second;    mcurobject.clear();    mcurmethod.clear();  }    CommandParser::~CommandParser()    {        // if argsparser is non-zero, then something went wrong ( someone        // threw an exception, and we didn't reach seencallcommand() ), so        // we need to delete the argsparser..        delete argsparser;        delete retcommand;        delete implicittermcondition;    }    void CommandParser::reset()      {        peer = 0;        dcom = 0;        retcommand = 0;        implicittermcondition = 0;        mcurobject.clear();        mcurmethod.clear();      }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产一区a| 色综合久久天天| 久久久亚洲欧洲日产国码αv| 美女视频网站黄色亚洲| 久久精品一区四区| 高清不卡在线观看| 亚洲美女少妇撒尿| 欧美日韩亚洲综合在线| 裸体一区二区三区| 国产日韩精品一区二区三区| 97久久精品人人爽人人爽蜜臀| 亚洲人一二三区| 欧美日韩欧美一区二区| 久久精品久久综合| 国产精品美日韩| 在线亚洲免费视频| 蜜臀久久99精品久久久久久9 | 欧美色窝79yyyycom| 日韩福利电影在线观看| 久久久精品国产免费观看同学| 成人精品视频一区| 亚洲综合一二区| 精品国产一区a| 一本色道久久综合亚洲aⅴ蜜桃| 日韩精品久久理论片| 久久久精品国产免大香伊| 色综合激情五月| 极品少妇xxxx偷拍精品少妇| 中文字幕一区日韩精品欧美| 欧美精品精品一区| 99久久精品国产毛片| 奇米精品一区二区三区在线观看一| 国产欧美日韩激情| 欧美一区二区在线免费播放 | 奇米影视在线99精品| 久久免费美女视频| 欧美三级中文字幕在线观看| 国产毛片精品视频| 亚州成人在线电影| 国产精品毛片大码女人| 91麻豆精品国产自产在线观看一区 | 久久毛片高清国产| 欧美色图12p| av日韩在线网站| 国内成人精品2018免费看| 亚洲一区国产视频| 国产精品高清亚洲| 国产亲近乱来精品视频| 日韩一级免费一区| 欧美日韩中文国产| 91麻豆国产福利在线观看| 国产美女娇喘av呻吟久久| 日本色综合中文字幕| 亚洲一区二区三区中文字幕| 国产精品福利一区| 久久精品欧美一区二区三区不卡| 欧美一区二区在线视频| 欧美群妇大交群的观看方式| 91久久线看在观草草青青| av在线播放一区二区三区| 国产精一品亚洲二区在线视频| 五月天欧美精品| 一区二区三区欧美亚洲| 亚洲人成人一区二区在线观看| 久久精品视频在线看| 26uuu成人网一区二区三区| 日韩一区和二区| 欧美一区二区三区在线电影| 欧美日韩亚洲综合一区 | 蜜臂av日日欢夜夜爽一区| 亚洲国产日韩精品| 亚洲一二三区在线观看| 亚洲综合久久久| 亚洲韩国一区二区三区| 亚洲成人免费视频| 日本欧美久久久久免费播放网| 日韩中文字幕一区二区三区| 三级久久三级久久久| 日产欧产美韩系列久久99| 日韩av一区二区三区四区| 日韩影院免费视频| 麻豆精品在线播放| 国产精品12区| 99视频精品全部免费在线| 91日韩在线专区| 欧美性猛片aaaaaaa做受| 欧美视频在线观看一区二区| 51精品秘密在线观看| 精品久久久久久久久久久久久久久| 日韩一区二区在线看片| 国产三级精品在线| 亚洲婷婷综合久久一本伊一区 | 亚洲国产成人91porn| 手机精品视频在线观看| 日韩电影在线一区| 国产一区二三区| 97久久人人超碰| 欧美日本精品一区二区三区| 日韩精品中文字幕在线一区| 国产日韩欧美制服另类| 亚洲精品欧美专区| 蜜桃传媒麻豆第一区在线观看| 国产资源精品在线观看| 99re在线精品| 精品视频在线看| 精品国产sm最大网站免费看| 国产精品成人在线观看| 午夜私人影院久久久久| 国产综合一区二区| 色婷婷亚洲精品| 欧美大肚乱孕交hd孕妇| 国产精品不卡在线| 日韩中文字幕亚洲一区二区va在线| 国产精品一二三在| 欧美日韩国产高清一区| 国产人成一区二区三区影院| 亚洲成a人片综合在线| 国产黑丝在线一区二区三区| 色www精品视频在线观看| 精品福利一区二区三区| 亚洲精品中文在线| 91麻豆视频网站| 欧美一卡2卡3卡4卡| 国产精品伦一区| 蜜桃av一区二区三区电影| 91丨九色丨尤物| 久久亚洲春色中文字幕久久久| 亚洲图片自拍偷拍| 成人一区二区三区中文字幕| 91精品国产色综合久久不卡蜜臀| 亚洲同性gay激情无套| 国产一区二区精品久久91| 欧美日韩三级视频| 亚洲三级理论片| 国产999精品久久| 日韩女优电影在线观看| 亚洲一区二区精品久久av| 丰满少妇在线播放bd日韩电影| 91麻豆精品91久久久久久清纯| 亚洲欧美综合色| 国产精品888| 精品日韩一区二区| 免费在线视频一区| 欧美自拍丝袜亚洲| 亚洲精品午夜久久久| 成人免费毛片a| 国产亚洲精品7777| 精品一区二区三区在线播放| 欧美日韩成人一区| 亚洲一区二区在线观看视频 | 香蕉成人伊视频在线观看| 成人高清免费观看| 国产午夜久久久久| 国产一区在线观看麻豆| 日韩精品一区二区三区视频播放 | 中文字幕在线观看不卡| 国产成人av电影在线| 国产亚洲欧洲997久久综合| 精品写真视频在线观看| 日韩精品一区二区三区老鸭窝| 亚洲成人tv网| 欧美欧美欧美欧美首页| 亚洲高清视频的网址| 欧美视频一区二区在线观看| 亚洲一区电影777| 91国产成人在线| 亚洲午夜私人影院| 在线观看国产精品网站| 亚洲黄色尤物视频| 欧美丝袜自拍制服另类| 午夜影院久久久| 91精品国产综合久久婷婷香蕉| 免费人成在线不卡| 久久综合精品国产一区二区三区| 韩国女主播成人在线观看| 久久久一区二区三区捆绑**| 国产福利91精品一区二区三区| 国产欧美日韩久久| 色综合天天综合在线视频| 亚洲欧美成人一区二区三区| 日本道精品一区二区三区 | 国产精品久久久久久妇女6080| 国产精品一区二区三区99| 国产精品美女视频| 91麻豆精品秘密| 亚洲h在线观看| 久久青草国产手机看片福利盒子| 国产成人综合亚洲网站| 亚洲久本草在线中文字幕| 欧美精品乱码久久久久久按摩| 黄页视频在线91| 国产精品国产成人国产三级 | 国产亚洲综合av| av一区二区三区在线| 亚洲国产成人av| 久久综合九色综合97婷婷| 91亚洲国产成人精品一区二区三| 亚洲午夜精品网| 久久嫩草精品久久久久| 91久久香蕉国产日韩欧美9色|