X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FConsole%2FParse.ih;h=baedd181448ad155798c903ff3ddb9c2869bd195;hb=57daeae6f2e924ce3f16f9677c3474f531cba9e5;hp=1fd7d2dbc9eec399c11522494070a1c96723fd03;hpb=463db052ea9d1c292bfd40301d0dc4963411485e;p=senf.git diff --git a/senf/Utils/Console/Parse.ih b/senf/Utils/Console/Parse.ih index 1fd7d2d..baedd18 100644 --- a/senf/Utils/Console/Parse.ih +++ b/senf/Utils/Console/Parse.ih @@ -44,7 +44,7 @@ #include -///////////////////////////////ih.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { namespace console { @@ -82,18 +82,18 @@ namespace detail { ::phoenix::function const positionOf; - /////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////////// // Grammar template struct CommandGrammar : boost_spirit::grammar > { - /////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////// // Start rules enum { CommandParser, SkipParser, ArgumentsParser, PathParser }; - /////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////// // The parse context (variables needed while parsing) typedef Token::TokenType TokenType; @@ -108,17 +108,17 @@ namespace detail { Context & context; - /////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////// // Configuration bool incremental; - /////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////// // Dispatching semantic actions ParseDispatcher & dispatcher; - ////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////// // charachter sets static boost_spirit::chset<> special_p; @@ -128,7 +128,7 @@ namespace detail { static boost_spirit::chset<> word_p; static boost_spirit::distinct_parser<> keyword_p; - /////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////// // Errors enum Errors { @@ -138,7 +138,7 @@ namespace detail { QuoteExpected }; - /////////////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////////////// CommandGrammar(ParseDispatcher & d, Context & c) : context(c), incremental(false), dispatcher(d) {} @@ -150,10 +150,10 @@ namespace detail { boost_spirit::rule, boost_spirit::rule > { - boost_spirit::rule command, path, argument, word, string, hexstring, token, - punctuation, hexbyte, balanced_tokens, simple_argument, complex_argument, builtin, - skip, statement, relpath, abspath, arguments, group_start, group_close, - statement_end, opt_path; + boost_spirit::rule command, path, argument, word, string, hexstring, + word_or_string, token, punctuation, hexbyte, balanced_tokens, simple_argument, + complex_argument, builtin, skip, statement, relpath, abspath, arguments, + group_start, group_close, statement_end, opt_path; definition(CommandGrammar const & self) { @@ -174,7 +174,7 @@ namespace detail { assertion closing_paren_expected (ClosingParenExpected); assertion quote_expected (QuoteExpected); - /////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////// // Spirit grammar // // Syntax summary: @@ -307,7 +307,7 @@ namespace detail { ; relpath - = ( word [ push_back(path_, token_) ] + = ( word_or_string [ push_back(path_, token_) ] % +ch_p('/') ) >> ( ! (+ch_p('/') ) [ push_back(path_, construct_()) ] ) ; @@ -375,6 +375,11 @@ namespace detail { pos_) ] ; + word_or_string + = word + | string + ; + hexbyte = uint_parser() [ push_back(str_, arg1) ] @@ -394,7 +399,7 @@ namespace detail { = self.space_p | comment_p('#') ; - /////////////////////////////////////////////////////////////////// + //-///////////////////////////////////////////////////////////////////////////////// start_parsers( command, // CommandParser @@ -442,7 +447,7 @@ namespace detail { }}} -///////////////////////////////ih.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #endif