senf::console::ParseCommandInfo Class Reference
[The parser]

Single parsed console command. More...

#include <senf/Utils/Console/Parse.hh>

List of all members.


Detailed Description

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 node tree is not involved in any way. ParseCommandInfo consist of

  • the type of command: built-in or normal command represented by a possibly relative path into the command tree.
  • the command
  • the arguments. Every argument consists of a range of Token instances.

Definition at line 349 of file Parse.hh.


Classes

class   ArgumentIterator
  Iterator parsing argument groups. More...

Public Types

enum   BuiltinCommand {
  NoBuiltin, BuiltinCD, BuiltinLS, BuiltinLL,
  BuiltinLR, BuiltinPUSHD, BuiltinPOPD, BuiltinEXIT,
  BuiltinHELP
}
typedef CommandPath::const_iterator  path_iterator
typedef Tokens::const_iterator  token_iterator
typedef ArgumentIterator  argument_iterator
typedef Tokens::size_type  size_type
typedef boost::iterator_range
< path_iterator
CommandPathRange
typedef boost::iterator_range
< argument_iterator
ArgumentsRange
typedef boost::iterator_range
< token_iterator
TokensRange

Public Member Functions

  ParseCommandInfo ()
BuiltinCommand  builtin () const
  Command type.
TokensRange  commandPath () const
  Command path.
ArgumentsRange  arguments () const
  Command arguments.
TokensRange  tokens () const
  All argument tokens.
void  clear ()
  Clear all data members.
bool  empty ()
  true, if the data is empty
void  builtin (BuiltinCommand builtin)
  Assign builtin command.
void  command (std::vector< Token > &commandPath)
  Assign non-builtin command.
void  addToken (Token const &token)
  Add argument token.

Member Typedef Documentation

typedef ArgumentIterator senf::console::ParseCommandInfo::
argument_iterator

Definition at line 359 of file Parse.hh.

typedef boost::iterator_range<argument_iterator> senf::console::ParseCommandInfo::
ArgumentsRange

Definition at line 363 of file Parse.hh.

typedef boost::iterator_range<path_iterator> senf::console::ParseCommandInfo::
CommandPathRange

Definition at line 362 of file Parse.hh.

typedef CommandPath::const_iterator senf::console::ParseCommandInfo::
path_iterator

Definition at line 355 of file Parse.hh.

typedef Tokens::size_type senf::console::ParseCommandInfo::
size_type

Definition at line 360 of file Parse.hh.

typedef Tokens::const_iterator senf::console::ParseCommandInfo::
token_iterator

Definition at line 358 of file Parse.hh.

typedef boost::iterator_range<token_iterator> senf::console::ParseCommandInfo::
TokensRange

Definition at line 364 of file Parse.hh.


Member Enumeration Documentation

enum senf::console::ParseCommandInfo::
BuiltinCommand
Enumerator:
NoBuiltin 
BuiltinCD 
BuiltinLS 
BuiltinLL 
BuiltinLR 
BuiltinPUSHD 
BuiltinPOPD 
BuiltinEXIT 
BuiltinHELP 

Definition at line 366 of file Parse.hh.


Constructor & Destructor Documentation

senf::console::ParseCommandInfo::
ParseCommandInfo ()

Definition at line 152 of file Parse.cci.


Member Function Documentation

void senf::console::ParseCommandInfo::
addToken ( Token const &  token )

Add argument token.

You must ensure, that the resulting argument tokens are properly nested regarding '()' groups, otherwise interpreting arguments using the arguments() call will crash the program.

Definition at line 208 of file Parse.cci.

senf::console::ParseCommandInfo::ArgumentsRange senf::console::ParseCommandInfo::
arguments ()

Command arguments.

The returned range contains one TokensRange for each argument.

Definition at line 171 of file Parse.cci.

void senf::console::ParseCommandInfo::
builtin ( BuiltinCommand  builtin )

Assign builtin command.

Definition at line 196 of file Parse.cci.

senf::console::ParseCommandInfo::BuiltinCommand senf::console::ParseCommandInfo::
builtin ()

Command type.

Returns:
NoBuiltin, if the command is an ordinary command, otherwise the id of the built-in command

Definition at line 157 of file Parse.cci.

void senf::console::ParseCommandInfo::
clear ()

Clear all data members.

Definition at line 184 of file Parse.cci.

void senf::console::ParseCommandInfo::
command ( std::vector< Token > &  commandPath )

Assign non-builtin command.

Definition at line 202 of file Parse.cci.

senf::console::ParseCommandInfo::TokensRange senf::console::ParseCommandInfo::
commandPath ()

Command path.

This is the path to the command if it is not a built-in command. Every element of the returned range 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 with a '/' char.

Definition at line 164 of file Parse.cci.

bool senf::console::ParseCommandInfo::
empty ()

true, if the data is empty

Definition at line 191 of file Parse.cci.

senf::console::ParseCommandInfo::TokensRange senf::console::ParseCommandInfo::
tokens ()

All argument tokens.

The returned range contains all argument tokens in a single range not divided into separate arguments.

Definition at line 178 of file Parse.cci.


The documentation for this class was generated from the following files: