mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2026-01-02 06:34:41 +03:00
unify some accel code/structures between limex and mcclellan
This commit is contained in:
@@ -85,9 +85,9 @@ public:
|
||||
vector<u32> &reports_eod /* out */,
|
||||
u8 *isSingleReport /* out */,
|
||||
ReportID *arbReport /* out */) const override;
|
||||
escape_info find_escape_strings(dstate_id_t this_idx) const override;
|
||||
AccelScheme find_escape_strings(dstate_id_t this_idx) const override;
|
||||
size_t accelSize(void) const override { return sizeof(gough_accel); }
|
||||
void buildAccel(dstate_id_t this_idx, const escape_info &info,
|
||||
void buildAccel(dstate_id_t this_idx, const AccelScheme &info,
|
||||
void *accel_out) override;
|
||||
u32 max_allowed_offset_accel() const override { return 0; }
|
||||
|
||||
@@ -1146,31 +1146,32 @@ aligned_unique_ptr<NFA> goughCompile(raw_som_dfa &raw, u8 somPrecision,
|
||||
return gough_dfa;
|
||||
}
|
||||
|
||||
escape_info gough_build_strat::find_escape_strings(dstate_id_t this_idx) const {
|
||||
escape_info rv;
|
||||
AccelScheme gough_build_strat::find_escape_strings(dstate_id_t this_idx) const {
|
||||
AccelScheme rv;
|
||||
if (!contains(accel_gough_info, this_idx)) {
|
||||
rv.outs = CharReach::dot();
|
||||
rv.outs2_broken = true;
|
||||
rv.cr = CharReach::dot();
|
||||
rv.double_byte.clear();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = mcclellan_build_strat::find_escape_strings(this_idx);
|
||||
|
||||
assert(!rv.offset); /* should have been limited by strat */
|
||||
assert(!rv.offset || rv.cr.all()); /* should have been limited by strat */
|
||||
if (rv.offset) {
|
||||
rv.outs = CharReach::dot();
|
||||
rv.outs2_broken = true;
|
||||
rv.cr = CharReach::dot();
|
||||
rv.double_byte.clear();
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (!accel_gough_info.at(this_idx).two_byte) {
|
||||
rv.outs2_broken = true;
|
||||
if (rv.double_offset
|
||||
|| !accel_gough_info.at(this_idx).two_byte) {
|
||||
rv.double_byte.clear();
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void gough_build_strat::buildAccel(dstate_id_t this_idx, const escape_info &info,
|
||||
void gough_build_strat::buildAccel(dstate_id_t this_idx, const AccelScheme &info,
|
||||
void *accel_out) {
|
||||
assert(mcclellan_build_strat::accelSize() == sizeof(AccelAux));
|
||||
gough_accel *accel = (gough_accel *)accel_out;
|
||||
|
||||
Reference in New Issue
Block a user