coan
6.0.1
A C/C++ Configuration Analyzer
|
struct formal_parameter_list
encapsulates a list of formal macro parameters.
More...
#include <formal_parameter_list.h>
Public Types | |
using | base = innards::parameter_list_base |
Base class. | |
Public Member Functions | |
formal_parameter_list (parameter_list_base const &parms) | |
Explicitly construct from a parameter_list_base | |
formal_parameter_list (size_t n=0) | |
Construct for n arguments. More... | |
template<class CharSeq > | |
formal_parameter_list (chewer< CharSeq > &chew) | |
Explicitly construct given a chewer<CharSeq> More... | |
template<class CharSeq > | |
void | read (chewer< CharSeq > &chew) |
Read the formal_parameter_list from a chewer<CharSeq> More... | |
![]() | |
parameter_list_base (size_t n=0) | |
Constructor for n parameters. More... | |
template<class CharSeq > | |
parameter_list_base (chewer< CharSeq > &chew) | |
Explicitly construct a given a chewer<CharSeq> . More... | |
parameter_list_base (parameter_list_base const &other) | |
Copy constructor. | |
void | swap (parameter_list_base &other) |
Swap with another parameter_list_base | |
parameter_list_base & | operator= (parameter_list_base other) |
Assignment. | |
bool | operator== (parameter_list_base const &other) const |
Equality. | |
bool | operator!= (parameter_list_base const &other) const |
Inequality. | |
bool | well_formed () const |
Say whether the parameter_list_base is well-formed. | |
bool | variadic () const |
Say whether the parameter_list_base is variadic. | |
size_t | size () const |
Get the number of parameters in the parameter_list_base More... | |
bool | null () const |
Say whether the parameter_list_base is null, i.e. is not even "()". | |
operator bool () const | |
Cast to boolean = !null() | |
std::string | str () const |
Cast the parameter list to its canonical string representation. | |
size_t | which (std::string const &str) const |
Get the index of the parameter that matches a string, if any, else -1. | |
template<class CharSeq > | |
void | read (chewer< CharSeq > &chew) |
Read the parameter_list_base from chewer<CharSeq> More... | |
std::vector< std::string > ::iterator | begin () |
Get a [const] iterator to the start of the parameter list. More... | |
std::vector< std::string > ::const_iterator | begin () const |
std::vector< std::string > ::iterator | end () |
Get a [const] iterator to the end of the parameter list. More... | |
std::vector< std::string > ::const_iterator | end () const |
std::string const & | at (size_t n) const |
Get a range-checked [const] reference to the nth parameter. More... | |
std::string & | at (size_t n) |
std::string const & | operator[] (size_t n) const |
Get an un-range-checked [const] reference to the nth parameter. More... | |
std::string & | operator[] (size_t n) |
Additional Inherited Members | |
![]() | |
template<typename BiIter > | |
static std::string | make (BiIter first, BiIter last) |
Make a parameter list from a range of objects that are convertible to std::string . More... | |
![]() | |
enum | defect { none, empty_param, unclosed, non_param } |
Enumeration of possible defects in a parameter_list_base More... | |
![]() | |
std::shared_ptr< std::vector < std::string > > | _params |
The list of parameters. | |
defect | _defect |
Is the parameter_list_base well-formed? | |
bool | _variadic |
Is the parameter_list_base variadic? | |
struct formal_parameter_list
encapsulates a list of formal macro parameters.
Definition at line 46 of file formal_parameter_list.h.
|
inlineexplicit |
Construct for n
arguments.
n | The number of arguments. |
If n
> 0, the list of placeholder arguments $1,...,$n
is constructed.
Definition at line 62 of file formal_parameter_list.h.
|
inlineexplicit |
Explicitly construct given a chewer<CharSeq>
chew | On entry, a chewer<CharSeq> positioned at the offset in the associated CharSeq from which to scan. On returnchew is positioned to the first offset not consumed. |
A | character-sequence type |
Definition at line 73 of file formal_parameter_list.h.
template void formal_parameter_list::read | ( | chewer< CharSeq > & | chew | ) |
Read the formal_parameter_list
from a chewer<CharSeq>
CharSeq | A character-sequence type |
chew | On entry, a chewer<CharSeq> positioned at the offset in the associated CharSeq from which to scan. On returnchew is positioned to the first offset not consumed. |
The formal_parameter_list
is emptied and replaced by parsing the text from chew
Definition at line 45 of file formal_parameter_list.cpp.