cgv
|
Public Member Functions | |
command_token () | |
constructs an undefined command token | |
command_token (const token &t) | |
constructs a command token of type text | |
bool | split_off_from (token &t) |
splits a command token from the front of a given token | |
unsigned | get_skip_length () const |
get the number of characters to be skipped before expressions start | |
unsigned | get_nr_expressions () const |
return the number of expressions that the command takes as argument | |
unsigned | get_min_nr_expressions () const |
return the minimum number of expressions that the command takes as argument | |
bool | is_nr_expressions_fix () const |
return whether the number of expressions that the command takes as argument is fix | |
const char * | get_keyword () const |
return the keyword describing the command | |
bool | is_empty () const |
check whether the token only contains white spaces | |
bool | block_follows () const |
return whether the command token must be followed by a block | |
bool | remove_preceeding_empty_text_token () const |
return whether empty text tokens before this command token should be deleted | |
char | get_open_parenthesis () const |
return the open parenthesis enclosing the expressions | |
char | get_close_parenthesis () const |
return the close parenthesis enclosing the expressions | |
![]() | |
token () | |
construct with both pointers set to 0 | |
token (const char *_str) | |
construct from c-string | |
token (const char *_b, const char *_e) | |
construct from character range | |
token (const std::string &s) | |
construct from string | |
size_t | get_length () const |
return the length of the token in number of characters | |
size_t | size () const |
return the length of the token in number of characters | |
bool | empty () const |
return whether the token is empty | |
void | skip (const std::string &skip_chars) |
set begin by skipping all instances of the given character set | |
void | reverse_skip (const std::string &skip_chars) |
set end by skipping all instances of the given character set | |
char | operator[] (unsigned int i) const |
return the i-th character of the token | |
bool | operator== (const char *s) const |
compare to const char* | |
bool | operator== (const std::string &s) const |
compare to string | |
bool | operator!= (const char *s) const |
compare to const char* | |
bool | operator!= (const std::string &s) const |
compare to string | |
Static Public Member Functions | |
static const std::string & | get_last_error () |
static const token & | get_last_error_token () |
Public Attributes | |
CommandType | ct |
store command type | |
unsigned int | parenthesis_index |
store index of parenthesis that enclosed the expressions | |
unsigned int | block_end |
store the index of the command token that terminates the block following this command | |
std::vector< expression_processor > | expressions |
vector of parsed expressions | |
![]() | |
const char * | begin |
pointers that define the range of characters | |
const char * | end |
Static Protected Attributes | |
static std::string | last_error |
static token | last_error_token |
Definition at line 33 of file command_token.h.
cgv::ppp::command_token::command_token | ( | ) |
constructs an undefined command token
Definition at line 95 of file command_token.cxx.
cgv::ppp::command_token::command_token | ( | const token & | t | ) |
constructs a command token of type text
Definition at line 100 of file command_token.cxx.
bool cgv::ppp::command_token::block_follows | ( | ) | const |
return whether the command token must be followed by a block
Definition at line 158 of file command_token.cxx.
References ct.
char cgv::ppp::command_token::get_close_parenthesis | ( | ) | const |
return the close parenthesis enclosing the expressions
Definition at line 181 of file command_token.cxx.
References ct, and parenthesis_index.
const char * cgv::ppp::command_token::get_keyword | ( | ) | const |
return the keyword describing the command
Definition at line 131 of file command_token.cxx.
References ct.
Referenced by split_off_from().
|
static |
Definition at line 265 of file command_token.cxx.
|
static |
Definition at line 269 of file command_token.cxx.
unsigned cgv::ppp::command_token::get_min_nr_expressions | ( | ) | const |
return the minimum number of expressions that the command takes as argument
Definition at line 118 of file command_token.cxx.
References ct.
Referenced by is_nr_expressions_fix(), and split_off_from().
unsigned cgv::ppp::command_token::get_nr_expressions | ( | ) | const |
return the number of expressions that the command takes as argument
Definition at line 112 of file command_token.cxx.
References ct.
Referenced by is_nr_expressions_fix(), and split_off_from().
char cgv::ppp::command_token::get_open_parenthesis | ( | ) | const |
return the open parenthesis enclosing the expressions
Definition at line 175 of file command_token.cxx.
References ct, and parenthesis_index.
unsigned cgv::ppp::command_token::get_skip_length | ( | ) | const |
get the number of characters to be skipped before expressions start
Definition at line 106 of file command_token.cxx.
References ct.
Referenced by split_off_from().
bool cgv::ppp::command_token::is_empty | ( | ) | const |
check whether the token only contains white spaces
Definition at line 137 of file command_token.cxx.
References cgv::utils::token::begin, ct, cgv::utils::token::empty(), and cgv::utils::skip_spaces().
bool cgv::ppp::command_token::is_nr_expressions_fix | ( | ) | const |
return whether the number of expressions that the command takes as argument is fix
Definition at line 124 of file command_token.cxx.
References get_min_nr_expressions(), and get_nr_expressions().
bool cgv::ppp::command_token::remove_preceeding_empty_text_token | ( | ) | const |
return whether empty text tokens before this command token should be deleted
Definition at line 166 of file command_token.cxx.
References ct.
bool cgv::ppp::command_token::split_off_from | ( | token & | t | ) |
splits a command token from the front of a given token
Definition at line 187 of file command_token.cxx.
References cgv::utils::token::begin, cgv::utils::bite_all(), ct, cgv::utils::token::empty(), expressions, get_keyword(), get_min_nr_expressions(), get_nr_expressions(), get_skip_length(), cgv::utils::is_element(), parenthesis_index, cgv::utils::to_string(), and cgv::ppp::expression_processor::validate().
unsigned int cgv::ppp::command_token::block_end |
store the index of the command token that terminates the block following this command
Definition at line 46 of file command_token.h.
CommandType cgv::ppp::command_token::ct |
store command type
Definition at line 42 of file command_token.h.
Referenced by block_follows(), get_close_parenthesis(), get_keyword(), get_min_nr_expressions(), get_nr_expressions(), get_open_parenthesis(), get_skip_length(), is_empty(), remove_preceeding_empty_text_token(), and split_off_from().
std::vector<expression_processor> cgv::ppp::command_token::expressions |
vector of parsed expressions
Definition at line 48 of file command_token.h.
Referenced by split_off_from().
|
staticprotected |
Definition at line 36 of file command_token.h.
|
staticprotected |
Definition at line 37 of file command_token.h.
unsigned int cgv::ppp::command_token::parenthesis_index |
store index of parenthesis that enclosed the expressions
Definition at line 44 of file command_token.h.
Referenced by get_close_parenthesis(), get_open_parenthesis(), and split_off_from().