X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FParse.hh;h=a37ed014b6f231f579e97e2e6a171c30cb25de3e;hb=9cda1b12a3e68538ea8157ca96810f0423123a70;hp=91a1467243f72a4f82708165027b497ec0c6271d;hpb=f47679431aa3461936ee4a85c0c4216e44292b55;p=senf.git diff --git a/Console/Parse.hh b/Console/Parse.hh index 91a1467..a37ed01 100644 --- a/Console/Parse.hh +++ b/Console/Parse.hh @@ -227,11 +227,11 @@ namespace console { friend class detail::ParserAccess; }; - /** \brief Console command + /** \brief Single parsed console command Every command parsed is returned in a ParseCommandInfo instance. This information is purely taken from the parser, no semantic information is attached at this point, the config/console - is not involved in any why. ParseCommandInfo consist of + node tree is not involved in any why. ParseCommandInfo consist of \li the type of command: built-in or normal command represented by a possibly relative path into the command tree. @@ -239,6 +239,14 @@ namespace console { \li the arguments. Every argument consists of a range of ArgumentToken instances. \ingroup console_parser + + \todo Completely change the 'arguments()' member implementation: let the parser just + generate a flat list of tokens and implement an 'argument iterator' with the following + features: 1. return argument ranges, automatically detecting paranthesis 2. trying to + increment the iterator beyond it's range just throws an argument syntax error. For this + to work, the parser needs to not drop the outermost '()' pair 3. detect bad paranthesis + (should not be necessary since the parser already does this). This allows to use this + same iterator to parse nested complex arguments. */ class ParseCommandInfo { @@ -279,9 +287,9 @@ namespace console { constitutes one path element. If the first element is empty, the path is an absolute path, otherwise it is relative. If the last element is an empty string, the - path ends in a '/' char. */ + path ends with a '/' char. */ ArgumentsRange arguments() const; ///< Command arguments - /**< The returned range contains one token range for each + /**< The returned range contains one TokensRange for each argument. */ TokensRange tokens() const; ///< All argument tokens /**< The returned range contains \e all argument tokens in a