cgv
Loading...
Searching...
No Matches
cgv::ppp::command_token Struct Reference
Inheritance diagram for cgv::ppp::command_token:
cgv::utils::token

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
 
- Public Member Functions inherited from cgv::utils::token
 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 tokenget_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_processorexpressions
 vector of parsed expressions
 
- Public Attributes inherited from cgv::utils::token
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
 

Detailed Description

Definition at line 33 of file command_token.h.

Constructor & Destructor Documentation

◆ command_token() [1/2]

cgv::ppp::command_token::command_token ( )

constructs an undefined command token

Definition at line 95 of file command_token.cxx.

◆ command_token() [2/2]

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.

Member Function Documentation

◆ block_follows()

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.

◆ get_close_parenthesis()

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.

◆ get_keyword()

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().

◆ get_last_error()

const std::string & cgv::ppp::command_token::get_last_error ( )
static

Definition at line 265 of file command_token.cxx.

◆ get_last_error_token()

const token & cgv::ppp::command_token::get_last_error_token ( )
static

Definition at line 269 of file command_token.cxx.

◆ get_min_nr_expressions()

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().

◆ get_nr_expressions()

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().

◆ get_open_parenthesis()

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.

◆ get_skip_length()

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().

◆ is_empty()

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().

◆ is_nr_expressions_fix()

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().

◆ remove_preceeding_empty_text_token()

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.

◆ split_off_from()

Member Data Documentation

◆ block_end

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.

◆ ct

◆ expressions

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().

◆ last_error

std::string cgv::ppp::command_token::last_error
staticprotected

Definition at line 36 of file command_token.h.

◆ last_error_token

token cgv::ppp::command_token::last_error_token
staticprotected

Definition at line 37 of file command_token.h.

◆ parenthesis_index

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().


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