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

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

?? parser.cpp

?? 2009 ROBOCUP 仿真2DSERVER 源碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// -*-c++-*-/***************************************************************************                                parser.cpp                          Parser for config options                             -------------------    begin                : 15-MAY-2003    copyright            : (C) 2003 by The RoboCup Soccer Server                           Maintenance Group.    email                : sserver-admin@lists.sourceforge.net***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU LGPL as published by the Free Software  * *   Foundation; either version 2 of the License, or (at your option) any  * *   later version.                                                        * *                                                                         * ***************************************************************************/#ifdef HAVE_CONFIG_H#include "config.h"#endif#include "parser.hpp"#include "builder.hpp"#ifdef HAVE_SSTREAM#include <sstream>#else#include <strstream>#endif#include <iterator>#include <cerrno>#include <climits>#include <boost/filesystem/operations.hpp>#include <boost/filesystem/fstream.hpp>#include <boost/filesystem/exception.hpp>// #define BOOST_SPIRIT_DEBUG#include <boost/spirit.hpp>#include <boost/function.hpp>#include <boost/bind.hpp>namespace {boolisQuated( const std::string & str ){    return ( str.length() >= 2             && ( ( *str.begin() == '\"' && *str.rbegin() == '\"' )                  || ( *str.begin() == '\'' && *str.rbegin() == '\'' )                  )             );}std::stringcleanString( std::string str ){    if ( str.empty() )    {        return str;    }    if ( *str.begin() == '\'' )    {        if ( *str.rbegin() == '\''  )        {            str = str.substr( 1, str.length() - 2 );        }        else        {            return str;        }        for ( std::string::size_type esc = str.find( "\\'" );              esc != std::string::npos;              esc = str.find( "\\'" ) )        {            str.replace( esc, 2, "'" );        }    }    else if ( *str.begin() == '"' )    {        if ( *str.rbegin() == '"'  )        {            str = str.substr( 1, str.length() - 2 );        }        else        {            return str;        }        for ( std::string::size_type esc = str.find( "\\\"" );              esc != std::string::npos;              esc = str.find( "\\\"" ) )        {            str.replace( esc, 2, "\"" );        }    }    return str;}std::stringcleanString( const char * begin,             const char * end ){    return cleanString( std::string( begin, end ) );}}namespace rcss {namespace conf {const char * Parser::ErrorStrs[] = { "None",                                     "'=' expected",                                     "'::' expected",                                     "value expected",                                     "string expected" };class ParseErrorHandler {public:    static    boost::spirit::error_status<> parseError( const Parser * parser,                                              const boost::spirit::rule<>::scanner_t & scanner,                                              const boost::spirit::parser_error< Parser::Errors > & error )      {          std::string what;          if ( error.where + 10 > scanner.last )          {              what = std::string( error.where, scanner.last );          }          else          {              what = std::string( error.where,                                  error.where + 10 );          }          std::string::iterator newline = std::find( what.begin(),                                                     what.end(),                                                     '\n' );          if ( newline != what.end() )          {              what = std::string( what.begin(), newline );          }          parser->m_builder.parseError( what,                                        Parser::ErrorStrs[ error.descriptor ],                                        parser->m_stack.front().m_name,                                        parser->m_stack.front().m_lineno );          return boost::spirit::error_status<>( boost::spirit::error_status<>::fail );      }};Parser::Parser( Builder & builder )    : m_builder( builder ){    m_builder.addedToParser( *this );}Parser::~Parser(){    m_builder.removedFromParser();}boolParser::parse( int argc,               const char * const * argv ){#ifdef HAVE_SSTREAM    std::stringstream strm;#else    std::strstream strm;#endif    if ( argc > 1 )    {        std::string arg( argv[1] );        if ( arg.find_first_of( " \t" ) != std::string::npos             && ! isQuated( arg ) )        {            strm << "\'" << arg << "\'";        }        else        {            strm << arg;        }    }    for ( int i = 2; i < argc; ++i )    {        std::string arg( argv[i] );        if ( arg.find_first_of( " \t" ) != std::string::npos             && ! isQuated( arg ) )        {            strm << ' ' << '\'' << arg << '\'';        }        else        {            strm << ' ' << arg;        }    }#ifndef HAVE_SSTREAM    strm << std::ends;#else    strm << std::flush;#endif    bool res = rcss::Parser::parse( strm, "cmd line args" );#ifndef HAVE_SSTREAM    strm.freeze( false );#endif    return res;}boolParser::parse( std::istream & strm ){    return rcss::Parser::parse( strm );}boolParser::parse( std::istream & strm,               const std::string & name ){    return rcss::Parser::parse( strm, name );}boolParser::parse( const boost::filesystem::path & file ){    return rcss::Parser::parse( file );}boolParser::parseCreateConf( const boost::filesystem::path & conf_name,                         const std::string & module_name ){    std::string native_path = conf_name.native_file_string();    boost::filesystem::ifstream conf( conf_name );    if ( ! conf.is_open() )    {        m_builder.creatingConfFile( native_path );        boost::filesystem::ofstream new_conf( conf_name );        if ( new_conf.is_open() )        {            m_builder.createConfFile( new_conf, module_name );            new_conf.close();            m_builder.createdConfFile( native_path );            return true;        }        else        {            std::cerr << "is not opened. Parser::parseCreateConf " << native_path << std::endl;            m_builder.confCreationFailed( native_path, errno );            return false;        }    }    else    {        bool rval = parse( conf, native_path );        conf.close();        return rval;    }}boolParser::doParse( std::istream & strm ){    m_builder.reset();    m_stack.push_front( StreamState( strm,  getStreamName(), 1 ) );    bool rval = boostParse();    m_stack.pop_front();    rval = rval && m_builder.success();    return rval;}voidParser::countNewLines( const char * begin,                       const char * end ){    int count = 0;    for ( const char * i = begin; i != end; ++i )    {        if ( '\n' == *i )        {            ++count;        }    }    if ( ! m_stack.empty() )    {        m_stack.front().m_lineno += count;    }}boolParser::include( const char * begin,                 const char * end ){    std::string incname = cleanString( begin, end );    boost::filesystem::path path;    try    {        path = boost::filesystem::path( incname,                                        &boost::filesystem::native );    }    catch(...)    {        try        {            path = boost::filesystem::path( incname );        }        catch ( const std::exception & e )        {            m_builder.includeFailed( incname,                                     e.what(),                                     m_stack.front().m_name,                                     m_stack.front().m_lineno );            return false;        }    }    boost::filesystem::path full_name;    if ( path.has_root_directory() )    {        full_name = path;    }    else    {        const std::string & curr_path = m_stack.front().m_name;        if ( curr_path.empty()             || curr_path == "cmd line args"             || curr_path == "anonymous stream" )        {            full_name = complete( path );        }        else        {            boost::filesystem::path branch( curr_path,                                            boost::filesystem::native );            branch = branch.branch_path();            full_name = branch / path;        }    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美国十次了思思久久精品导航| 亚洲人成在线观看一区二区| 亚洲色欲色欲www| 日韩电影在线观看网站| 国产成人自拍高清视频在线免费播放| 欧美女孩性生活视频| 日本一区二区不卡视频| 日韩精品久久久久久| 不卡的看片网站| 精品动漫一区二区三区在线观看| 一区二区三区四区高清精品免费观看| 精品一区二区久久| 欧美色爱综合网| 国产欧美日韩亚州综合| 亚洲成人一区在线| 91天堂素人约啪| 欧美sm极限捆绑bd| 亚洲国产日韩综合久久精品| 北岛玲一区二区三区四区| 精品国内二区三区| 午夜精彩视频在线观看不卡| 日本国产一区二区| 中文字幕一区二区三区在线播放 | 91国产丝袜在线播放| 久久婷婷综合激情| 日韩有码一区二区三区| 欧美日韩精品三区| 亚洲精品日韩一| heyzo一本久久综合| 日韩色在线观看| 亚洲国产aⅴ成人精品无吗| 99久久精品费精品国产一区二区| 久久久美女艺术照精彩视频福利播放| 亚洲精品成人在线| 93久久精品日日躁夜夜躁欧美| 久久婷婷国产综合国色天香| 男男gaygay亚洲| 91国内精品野花午夜精品| 一区二区三区在线观看视频| www.日韩av| 欧美国产日韩精品免费观看| 蜜桃av一区二区三区电影| 在线综合视频播放| 天天操天天综合网| 欧美猛男男办公室激情| 一二三四区精品视频| 色菇凉天天综合网| 亚洲日本韩国一区| 一本到三区不卡视频| 中文字幕乱码日本亚洲一区二区| 国产剧情一区二区| 日韩视频在线你懂得| 天堂影院一区二区| 日韩一级大片在线观看| 免费观看一级特黄欧美大片| 欧美日韩不卡一区| 天堂蜜桃一区二区三区 | 国产福利91精品| 久久综合久久综合亚洲| 国产精品自拍一区| 久久久综合激的五月天| 国产成人av电影在线观看| 国产午夜精品久久| 成人精品在线视频观看| 成人欧美一区二区三区1314| 91亚洲大成网污www| 亚洲精品第1页| 欧美日韩在线三级| 一区二区三区高清在线| 欧美日本精品一区二区三区| 视频一区在线播放| 欧美α欧美αv大片| 国产成人av福利| 亚洲色图丝袜美腿| 欧美午夜不卡在线观看免费| 性做久久久久久| 精品国产在天天线2019| 国产成人h网站| 国产精品久久久久久久久果冻传媒 | 久久精品人人做| 成人短视频下载 | 一道本成人在线| 亚洲一区二区中文在线| 欧美一区二区女人| 亚欧色一区w666天堂| 久久精品一区八戒影视| 99久久精品免费看| 亚洲午夜久久久久久久久电影院| 欧美视频在线不卡| 极品少妇xxxx精品少妇| 国产精品久久久久影院| 欧美在线一区二区三区| 丝袜亚洲另类丝袜在线| 国产精品午夜在线观看| 日本道色综合久久| 免费看欧美女人艹b| 国产亚洲福利社区一区| 日本不卡不码高清免费观看| 国产欧美日韩精品在线| 欧美日韩在线观看一区二区| 国产精品中文有码| 亚洲第一狼人社区| 欧美国产97人人爽人人喊| 91麻豆精品国产综合久久久久久| 丁香一区二区三区| 蜜臀av一区二区| 亚洲美女淫视频| 久久久久久久综合| 欧美日韩aaaaa| 91亚洲精品乱码久久久久久蜜桃| 蜜桃在线一区二区三区| 一区二区三区在线免费观看| 久久影院视频免费| 欧美精品第1页| 91伊人久久大香线蕉| 韩国精品主播一区二区在线观看 | 91精品国产综合久久蜜臀| www.日本不卡| 国内外成人在线| 日韩av电影一区| 一区二区三区中文字幕| 欧美国产亚洲另类动漫| 精品欧美一区二区三区精品久久| 色8久久精品久久久久久蜜| 国产不卡视频在线观看| 天天色综合成人网| 夜夜亚洲天天久久| 国产精品久久一级| 国产日产精品一区| 精品捆绑美女sm三区| 欧美精品tushy高清| 日本精品视频一区二区| av成人动漫在线观看| 风间由美一区二区av101| 国内精品自线一区二区三区视频| 日韩国产高清在线| 亚洲成人7777| 亚洲综合视频网| 亚洲黄色小视频| 中文字幕中文字幕一区二区| 久久久精品一品道一区| 日韩精品在线一区二区| 7777精品久久久大香线蕉| 欧洲一区二区av| 色综合天天性综合| 99国产精品国产精品久久| 成人精品国产免费网站| 国产91丝袜在线播放九色| 国产一区二区毛片| 国产一区二区在线免费观看| 国内精品伊人久久久久av影院| 免费人成精品欧美精品 | 亚洲国产精品av| 欧美极品aⅴ影院| 亚洲国产精品精华液ab| 国产日韩欧美a| 欧美激情自拍偷拍| 欧美国产禁国产网站cc| 国产精品剧情在线亚洲| 亚洲欧洲日韩综合一区二区| 亚洲欧美激情插 | 中文字幕av一区二区三区| 国产精品日日摸夜夜摸av| 国产精品国产成人国产三级| 国产精品福利一区| 亚洲精品国产a久久久久久 | 国产精品拍天天在线| 国产aⅴ精品一区二区三区色成熟| 久久福利资源站| 国产乱一区二区| 国产电影一区在线| 不卡影院免费观看| 色哟哟精品一区| 欧美日韩一卡二卡三卡| 欧美高清视频不卡网| 日韩欧美另类在线| 久久精品欧美一区二区三区麻豆| 中文字幕av免费专区久久| 亚洲免费在线观看| 亚洲成人一二三| 久久国产精品露脸对白| 国产成人免费视频一区| 91视频xxxx| 欧美久久久久久蜜桃| 欧美v国产在线一区二区三区| 久久久国产精品麻豆| 中文字幕一区二区三区在线观看 | 久久嫩草精品久久久精品一| 欧美国产亚洲另类动漫| 一区二区三区精品在线观看| 欧美96一区二区免费视频| 国产精品一二三区在线| 色综合久久久久网| 91麻豆精品国产91久久久久久| 久久久久久久久久久黄色| 亚洲色图在线播放| 奇米影视一区二区三区| 国产精品白丝av| 欧美综合视频在线观看| 精品黑人一区二区三区久久|