Commit dd9af65b authored by Florent Jacquemard's avatar Florent Jacquemard
Browse files

debug unfail mode (FAIL Runs)

parent 62cf467f
......@@ -80,7 +80,6 @@ public:
// @@todo TBR. for backward compatibility.
// Run(size_t a, label_t lab, const Weight& w);
/// fail run, representing parse error.
/// @param k target state. must not be NULL.
Run(const K* k);
......@@ -231,6 +230,7 @@ protected:
const Transition& _origin;
// gives _label, _initweight -> protected functions
/// make a copy and in copy, reset the weight to w and reset the filter.
Run(const Run<K>& r, Weight w);
......
......@@ -43,7 +43,13 @@ _origin(tr)
template<class K>
Run<K>::Run(const K* k):
Run(DUMMYT, SymbLabel::make_fail(k->size()), DUMMYT.weight())
_label(SymbLabel::make_fail(k->size())),
_children(),
_weight(DUMMYT.weight()),
_filter(_label, DUMMYT.size()),
_initweight(DUMMYT.weight()),
_subruns(),
_origin(DUMMYT)
{
assert(k);
}
......
......@@ -401,39 +401,28 @@ bool SymbLabel::fork(label_t a)
// static function
bool SymbLabel::space(label_t a)
{
if (kind(a) != DUMMY)
return false;
assert(arity(a) == 0);
assert(specific2(a) == 0);
return (specific(a) == 1);
assert((kind(a) != DUMMY) || (arity(a) == 0));
return ((kind(a) == DUMMY) && (specific(a) == 1) && (specific2(a) == 0));
}
// static function
bool SymbLabel::fail(label_t a)
{
if (kind(a) != DUMMY)
return false;
assert(arity(a) == 0);
return (specific(a) == 2);
assert((kind(a) != DUMMY) || (arity(a) == 0));
return ((kind(a) == DUMMY) && (specific(a) == 2));
}
// static function
bool SymbLabel::dummy(label_t a)
{
if (kind(a) != DUMMY)
return false;
assert(arity(a) == 0);
assert(specific2(a) == 0);
return (specific(a) == 0);
assert((kind(a) != DUMMY) || (arity(a) == 0));
return ((kind(a) == DUMMY) && (specific(a) == 0) && (specific2(a) == 0));
}
// static function
label_t SymbLabel::setNb(label_t a, unsigned short int info)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment