#include <warn.h>
|
enum | type_t {
W,
CONDITION_ORDER,
EMPTY_CHARACTER_CLASS,
MATCH_EMPTY_STRING,
SWAPPED_RANGE,
UNDEFINED_CONTROL_FLOW,
UNREACHABLE_RULES,
USELESS_ESCAPE,
TYPES
} |
|
enum | option_t { W,
WNO,
WERROR,
WNOERROR
} |
|
|
| Warn () |
|
bool | error () const |
|
void | set (type_t t, option_t o) |
|
void | set_all () |
|
void | set_all_error () |
|
void | fail (type_t t, uint32_t line, const char *s) |
|
void | condition_order (uint32_t line) |
|
void | empty_class (uint32_t line) |
|
void | match_empty_string (uint32_t line) |
|
void | swapped_range (uint32_t line, uint32_t l, uint32_t u) |
|
void | undefined_control_flow (uint32_t line, const std::string &cond, std::vector< way_t > &ways, bool overflow) |
|
void | unreachable_rule (const std::string &cond, const rule_info_t &rule, const rules_t &rules) |
|
void | useless_escape (uint32_t line, uint32_t col, char c) |
|
Definition at line 22 of file warn.h.
Enumerator |
---|
W |
|
WNO |
|
WERROR |
|
WNOERROR |
|
Definition at line 32 of file warn.h.
Enumerator |
---|
W |
|
CONDITION_ORDER |
|
EMPTY_CHARACTER_CLASS |
|
MATCH_EMPTY_STRING |
|
SWAPPED_RANGE |
|
UNDEFINED_CONTROL_FLOW |
|
UNREACHABLE_RULES |
|
USELESS_ESCAPE |
|
TYPES |
|
Definition at line 25 of file warn.h.
#define RE2C_WARNING_TYPES
Definition at line 24 of file warn.cc.
26 , error_accuml (
false)
28 for (uint32_t i = 0; i <
TYPES; ++i)
void re2c::Warn::condition_order |
( |
uint32_t |
line | ) |
|
Definition at line 86 of file warn.cc.
93 "looks like you use hardcoded numbers instead of autogenerated condition names: "
94 "better add '/*!types:re2c*/' directive or '-t, --type-header' option "
95 "and don't rely on fixed condition order.");
void warning(const char *type, uint32_t line, bool error, const char *fmt,...)
void re2c::Warn::empty_class |
( |
uint32_t |
line | ) |
|
Definition at line 99 of file warn.cc.
void warning(const char *type, uint32_t line, bool error, const char *fmt,...)
bool re2c::Warn::error |
( |
| ) |
const |
void re2c::Warn::fail |
( |
type_t |
t, |
|
|
uint32_t |
line, |
|
|
const char * |
s |
|
) |
| |
Definition at line 77 of file warn.cc.
79 if (mask[t] & WARNING)
82 warning (names[t], line,
false,
"%s", s);
void warning(const char *type, uint32_t line, bool error, const char *fmt,...)
void re2c::Warn::match_empty_string |
( |
uint32_t |
line | ) |
|
Definition at line 109 of file warn.cc.
void warning(const char *type, uint32_t line, bool error, const char *fmt,...)
Definition at line 39 of file warn.cc.
51 mask[t] |= (WARNING | ERROR);
void re2c::Warn::set_all |
( |
| ) |
|
Definition at line 59 of file warn.cc.
61 for (uint32_t i = 0; i <
TYPES; ++i)
void re2c::Warn::set_all_error |
( |
| ) |
|
Definition at line 69 of file warn.cc.
71 for (uint32_t i = 0; i <
TYPES; ++i)
void re2c::Warn::swapped_range |
( |
uint32_t |
line, |
|
|
uint32_t |
l, |
|
|
uint32_t |
u |
|
) |
| |
Definition at line 119 of file warn.cc.
125 warning (names[
SWAPPED_RANGE], line, e,
"range lower bound (0x%X) is greater than upper bound (0x%X), swapping", l, u);
void warning(const char *type, uint32_t line, bool error, const char *fmt,...)
void re2c::Warn::undefined_control_flow |
( |
uint32_t |
line, |
|
|
const std::string & |
cond, |
|
|
std::vector< way_t > & |
ways, |
|
|
bool |
overflow |
|
) |
| |
Definition at line 129 of file warn.cc.
137 std::sort (ways.begin (), ways.end (),
cmp_ways);
140 fprintf (stderr,
"control flow %sis undefined for strings that match ",
incond (cond).c_str ());
141 const size_t count = ways.size ();
148 for (
size_t i = 0; i < count; ++i)
150 fprintf (stderr,
"\n\t");
153 fprintf (stderr,
"\n");
157 fprintf (stderr,
" ... and a few more");
159 fprintf (stderr,
", use default rule '*'");
void warning_start(uint32_t line, bool error)
void warning_end(const char *type, bool error)
void fprint_way(FILE *f, const way_t &w)
bool cmp_ways(const way_t &w1, const way_t &w2)
std::string incond(const std::string &cond)
void re2c::Warn::unreachable_rule |
( |
const std::string & |
cond, |
|
|
const rule_info_t & |
rule, |
|
|
const rules_t & |
rules |
|
) |
| |
Definition at line 164 of file warn.cc.
171 fprintf (stderr,
"unreachable rule %s",
incond (cond).c_str ());
172 const size_t shadows = rule.shadow.size ();
175 const char * pl = shadows > 1
178 std::set<rule_rank_t>::const_iterator i = rule.shadow.begin ();
179 fprintf (stderr,
"(shadowed by rule%s at line%s %u", pl, pl, rules.find (*i)->second.line);
180 for (++i; i != rule.shadow.end (); ++i)
182 fprintf (stderr,
", %u", rules.find (*i)->second.line);
184 fprintf (stderr,
")");
void warning_start(uint32_t line, bool error)
void warning_end(const char *type, bool error)
std::string incond(const std::string &cond)
void re2c::Warn::useless_escape |
( |
uint32_t |
line, |
|
|
uint32_t |
col, |
|
|
char |
c |
|
) |
| |
Definition at line 190 of file warn.cc.
void warning(const char *type, uint32_t line, bool error, const char *fmt,...)
The documentation for this class was generated from the following files: