#include "Error.h"


Go to the source code of this file.
Classes | |
| struct | parser_arg |
| Pass parameters by reference to a parser. More... | |
Defines | |
| #define | FALSE 0 |
| #define | ID_MAX 256 |
| #define | TRUE 1 |
| #define | YY_NO_UNPUT 1 |
| #define | YYDEBUG 1 |
Functions | |
| int | check_byte (const char *val) |
| Is the value a valid byte? | |
| int | check_float32 (const char *val) |
| Is the value a valid float? | |
| int | check_float64 (const char *val) |
| int | check_int16 (const char *val) |
| Is the value a valid integer? | |
| int | check_int32 (const char *val) |
| int | check_uint16 (const char *val) |
| int | check_uint32 (const char *val) |
| int | check_url (const char *val) |
| Is the value a valid URL? | |
| bool | is_keyword (string id, const string &keyword) |
| void | save_str (string &dst, const char *src, const int) |
| void | save_str (char *dst, const char *src, const int line_num) |
| Save a string to a temporary variable during the parse. | |
parse_error | |
Generate error messages for the various parsers.
| |
| void | parse_error (const string &msg, const int line_num, const char *context=0) |
| void | parse_error (parser_arg *arg, const char *s, const int line_num=0, const char *context=0) |
| int check_byte | ( | const char * | val | ) |
Check to see if val is a valid byte value. If not, generate an error message using parser_error(). There are two versions of check_byte(), one which calls parser_error() and prints an error message to stderr an one which calls parser_error() and generates and Error object.
Definition at line 157 of file parser-util.cc.
References DBG, DODS_SCHAR_MIN, DODS_UCHAR_MAX, FALSE, and TRUE.
| int check_float32 | ( | const char * | val | ) |
Like check_byte() but for 64-bit float values.
Definition at line 247 of file parser-util.cc.
References DBG, DODS_FLT_MAX, DODS_FLT_MIN, FALSE, and TRUE.
| int check_float64 | ( | const char * | val | ) |
Definition at line 275 of file parser-util.cc.
References DBG, DODS_DBL_MAX, DODS_DBL_MIN, FALSE, and TRUE.
| int check_int16 | ( | const char * | val | ) |
Like check_byte() but for 32-bit integers (check_uint() is for unsigned integers).
Definition at line 183 of file parser-util.cc.
References DODS_SHRT_MAX, DODS_SHRT_MIN, FALSE, and TRUE.
| int check_int32 | ( | const char * | val | ) |
Definition at line 215 of file parser-util.cc.
References DODS_INT_MAX, DODS_INT_MIN, FALSE, and TRUE.
| int check_uint16 | ( | const char * | val | ) |
| int check_uint32 | ( | const char * | val | ) |
| int check_url | ( | const char * | val | ) |
Currently this function always returns true.
Definition at line 332 of file parser-util.cc.
References TRUE.
| bool is_keyword | ( | string | id, | |
| const string & | keyword | |||
| ) |
Definition at line 149 of file parser-util.cc.
References DBG, downcase(), and prune_spaces().

| void parse_error | ( | const string & | msg, | |
| const int | line_num, | |||
| const char * | context = 0 | |||
| ) |
Definition at line 128 of file parser-util.cc.
References parse_error().

| void parse_error | ( | parser_arg * | arg, | |
| const char * | s, | |||
| const int | line_num = 0, |
|||
| const char * | context = 0 | |||
| ) |
Definition at line 68 of file parser-util.cc.
References append_long_to_string(), FALSE, parser_arg::set_error(), parser_arg::set_status(), and unknown_error.
Referenced by parse_error(), and save_str().

| void save_str | ( | string & | dst, | |
| const char * | src, | |||
| const | int | |||
| ) |
Definition at line 144 of file parser-util.cc.
| void save_str | ( | char * | dst, | |
| const char * | src, | |||
| const int | line_num | |||
| ) |
Given a string (const char *src), save it to the temporary variable pointed to by dst. If the string is longer than ID_MAX, generate and error indicating that src was truncated to ID_MAX characters during the copy operation. There are two versions of this function; one calls the version of parser_error() which writes to stderr. The version which accepts the parser_arg *arg argument calls the version of parser_error() which generates and Error object.
Definition at line 133 of file parser-util.cc.
References ID_MAX, long_to_string(), and parse_error().

1.5.4