4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief Parse inline non-template implementation */
26 // We do NOT want to include the complete parser definition into every other compilation unit
27 // (disabled) #include "Parse.ih"
30 #include "../Utils/senfassert.hh"
32 #define prefix_ inline
33 ///////////////////////////////cci.p///////////////////////////////////////
35 ///////////////////////////////////////////////////////////////////////////
36 // senf::console::ArgumentToken
38 prefix_ std::string const & senf::console::ArgumentToken::value()
44 prefix_ senf::console::ArgumentToken::ArgumentToken(std::string token)
48 ///////////////////////////////////////////////////////////////////////////
49 // senf::console::ParseCommandInfo
51 prefix_ std::string const & senf::console::ParseCommandInfo::commandPath()
57 prefix_ senf::console::ParseCommandInfo::size_type senf::console::ParseCommandInfo::arguments()
60 return arguments_.size();
63 prefix_ senf::console::ParseCommandInfo::argument_iterator
64 senf::console::ParseCommandInfo::begin_arguments()
67 return arguments_.begin();
70 prefix_ senf::console::ParseCommandInfo::argument_iterator
71 senf::console::ParseCommandInfo::end_arguments()
74 return arguments_.end();
77 prefix_ senf::console::ParseCommandInfo::size_type senf::console::ParseCommandInfo::tokens()
80 return tokens_.size();
83 prefix_ senf::console::ParseCommandInfo::token_iterator
84 senf::console::ParseCommandInfo::begin_tokens()
87 return tokens_.begin();
90 prefix_ senf::console::ParseCommandInfo::token_iterator
91 senf::console::ParseCommandInfo::end_tokens()
97 ////////////////////////////////////////
100 prefix_ void senf::console::ParseCommandInfo::init()
105 tempArguments_.clear();
108 prefix_ void senf::console::ParseCommandInfo::setCommand(std::string const & commandPath)
110 commandPath_ = commandPath;
113 prefix_ void senf::console::ParseCommandInfo::startArgument()
115 tempArguments_.push_back( TempArgumentRange( tokens_.size(), tokens_.size() ) );
118 prefix_ void senf::console::ParseCommandInfo::endArgument()
120 tempArguments_.back().second = tokens_.size();
123 prefix_ void senf::console::ParseCommandInfo::addToken(ArgumentToken const & token)
125 tokens_.push_back(token);
128 ///////////////////////////////////////////////////////////////////////////
129 // senf::console::SingleCommandParser
131 prefix_ senf::console::SingleCommandParser::Impl & senf::console::SingleCommandParser::impl()
137 ///////////////////////////////cci.e///////////////////////////////////////
144 // comment-column: 40
145 // c-file-style: "senf"
146 // indent-tabs-mode: nil
147 // ispell-local-dictionary: "american"
148 // compile-command: "scons -u test"