nis-util
1.0.D108
|
#include <colon.h>
Public Member Functions | |
virtual | ~colon () |
colon (const rcstring &filename) | |
void | discard_blank_lines (void) |
void | discard_comments (void) |
void | explain_sequence_errors (void) |
Protected Types | |
typedef std::vector< rcstring > | line_t |
Protected Member Functions | |
void | close (void) |
bool | read_one_line (line_t &result) |
bool | read_one_line (source_location &result_locn, line_t &result) |
void | error (const source_location &locn, const char *fmt,...) ATTRIBUTE_PRINTF(3 |
void void | pedantic_error (const source_location &locn, const char *fmt,...) ATTRIBUTE_PRINTF(3 |
void void void | warning (const source_location &locn, const char *fmt,...) ATTRIBUTE_PRINTF(3 |
Private Types | |
enum | token_ty { token_eof, token_eoln, token_colon, token_string } |
Private Member Functions | |
void | open (void) |
void | lex (void) |
source_location | get_source_location (void) const |
void | verror (const source_location &locn, const char *fmt, va_list ap) ATTRIBUTE_PRINTF(3 |
void void | vwarning (const source_location &locn, const char *fmt, va_list ap) ATTRIBUTE_PRINTF(3 |
void void void | vpedantic_error (const source_location &locn, const char *fmt, va_list ap) ATTRIBUTE_PRINTF(3 |
colon () | |
colon (const colon &) | |
colon & | operator= (const colon &) |
Private Attributes | |
rcstring | filename |
input::pointer | ip |
bool | non_printing_whine |
token_ty | token |
rcstring | token_value |
int | error_count |
bool | discard_comments_flag |
bool | discard_blank_lines_flag |
source_location | token_locn |
bool | explained_sequence_errors |
The colon class is used to represent the parse state when reading colon separated files (/etc/passwd and the like).
typedef std::vector<rcstring> colon::line_t [protected] |
enum colon::token_ty [private] |
colon::~colon | ( | ) | [virtual] |
colon::colon | ( | const rcstring & | filename | ) |
colon::colon | ( | ) | [private] |
The default constructor. Do not use.
colon::colon | ( | const colon & | ) | [private] |
The copy constructor. Do not use.
void colon::close | ( | void | ) | [protected] |
void colon::discard_blank_lines | ( | void | ) |
void colon::discard_comments | ( | void | ) |
void colon::error | ( | const source_location & | locn, |
const char * | fmt, | ||
... | |||
) | [protected] |
The error method is used to report fatal errors. The message is printed on the standard error, along with the file name and line number, and the error count incremented.
locn | The location of the error. |
fmt | The format of the message, including the number and types of the arguments. |
void colon::explain_sequence_errors | ( | void | ) |
source_location colon::get_source_location | ( | void | ) | const [private] |
void colon::lex | ( | void | ) | [private] |
Fetch the next input token. Sets the `token' instance variable, and also the token_value instance variable for strings.
void colon::open | ( | void | ) | [private] |
void colon::pedantic_error | ( | const source_location & | locn, |
const char * | fmt, | ||
... | |||
) | [protected] |
The pedantic_error method is used to report fatal errors if pedantic errors are enabled, otherwise these are warnings. The message is printed on the standard error, along with the file name and line number.
locn | The location of the error. |
fmt | The format of the message, including the number and types of the arguments. |
bool colon::read_one_line | ( | line_t & | result | ) | [protected] |
The get_one_line method is used to read one line from the file, splitting it into colon-separated fields.
result | The text of the line is placed here. |
bool colon::read_one_line | ( | source_location & | result_locn, |
line_t & | result | ||
) | [protected] |
The get_one_line method is used to read one line from the file, splitting it into colon-separated fields.
result_locn | The source location of the beginning of the line is placed here. |
result | The text of the line is placed here. |
void colon::verror | ( | const source_location & | locn, |
const char * | fmt, | ||
va_list | ap | ||
) | [private] |
The verror method is used to report fatal errors. The message is printed on the standard error, along with the file name and line number, and the error count incremented.
locn | The location of the error. |
fmt | The format of the message, including the number and types of the arguments. |
ap | The arguments. |
void colon::vpedantic_error | ( | const source_location & | locn, |
const char * | fmt, | ||
va_list | ap | ||
) | [private] |
The vpedantic_error method is used to report fatal errors if pedantic errors are enabled, otherwise these are warnings. The message is printed on the standard error, along with the file name and line number.
locn | The location of the error. |
fmt | The format of the message, including the number and types of the arguments. |
ap | The arguments. |
void colon::vwarning | ( | const source_location & | locn, |
const char * | fmt, | ||
va_list | ap | ||
) | [private] |
The waring method is used to report non-fatal errors. The message is printed on the standard error, along with the file name and line number. The error count is NOT incremented.
locn | The location of the error. |
fmt | the format of the message, it also defines the number and types of the remaining arguments. |
ap | The arguments. |
void colon::warning | ( | const source_location & | locn, |
const char * | fmt, | ||
... | |||
) | [protected] |
The waring method is used to report non-fatal errors. The message is printed on the standard error, along with the file name and line number. The error count is NOT incremented.
locn | The location of the error. |
fmt | the format of the message, it also defines the number and types of the remaining arguments. |
bool colon::discard_blank_lines_flag [private] |
bool colon::discard_comments_flag [private] |
int colon::error_count [private] |
bool colon::explained_sequence_errors [private] |
rcstring colon::filename [private] |
input::pointer colon::ip [private] |
bool colon::non_printing_whine [private] |
token_ty colon::token [private] |
source_location colon::token_locn [private] |
rcstring colon::token_value [private] |