mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
remove ng_rose
This commit is contained in:
parent
2a1202e1e6
commit
c32d7d51d9
@ -820,8 +820,6 @@ SET (hs_SRCS
|
|||||||
src/nfagraph/ng_restructuring.h
|
src/nfagraph/ng_restructuring.h
|
||||||
src/nfagraph/ng_revacc.cpp
|
src/nfagraph/ng_revacc.cpp
|
||||||
src/nfagraph/ng_revacc.h
|
src/nfagraph/ng_revacc.h
|
||||||
src/nfagraph/ng_rose.cpp
|
|
||||||
src/nfagraph/ng_rose.h
|
|
||||||
src/nfagraph/ng_sep.cpp
|
src/nfagraph/ng_sep.cpp
|
||||||
src/nfagraph/ng_sep.h
|
src/nfagraph/ng_sep.h
|
||||||
src/nfagraph/ng_small_literal_set.cpp
|
src/nfagraph/ng_small_literal_set.cpp
|
||||||
|
@ -54,7 +54,6 @@ Grey::Grey(void) :
|
|||||||
allowMcSheng(true),
|
allowMcSheng(true),
|
||||||
allowPuff(true),
|
allowPuff(true),
|
||||||
allowLiteral(true),
|
allowLiteral(true),
|
||||||
allowRose(true),
|
|
||||||
allowViolet(true),
|
allowViolet(true),
|
||||||
allowExtendedNFA(true), /* bounded repeats of course */
|
allowExtendedNFA(true), /* bounded repeats of course */
|
||||||
allowLimExNFA(true),
|
allowLimExNFA(true),
|
||||||
@ -114,7 +113,6 @@ Grey::Grey(void) :
|
|||||||
roseMcClellanSuffix(1),
|
roseMcClellanSuffix(1),
|
||||||
roseMcClellanOutfix(2),
|
roseMcClellanOutfix(2),
|
||||||
roseTransformDelay(true),
|
roseTransformDelay(true),
|
||||||
roseDesiredSplit(4),
|
|
||||||
earlyMcClellanPrefix(true),
|
earlyMcClellanPrefix(true),
|
||||||
earlyMcClellanInfix(true),
|
earlyMcClellanInfix(true),
|
||||||
earlyMcClellanSuffix(true),
|
earlyMcClellanSuffix(true),
|
||||||
@ -219,7 +217,6 @@ void applyGreyOverrides(Grey *g, const string &s) {
|
|||||||
G_UPDATE(allowMcSheng);
|
G_UPDATE(allowMcSheng);
|
||||||
G_UPDATE(allowPuff);
|
G_UPDATE(allowPuff);
|
||||||
G_UPDATE(allowLiteral);
|
G_UPDATE(allowLiteral);
|
||||||
G_UPDATE(allowRose);
|
|
||||||
G_UPDATE(allowViolet);
|
G_UPDATE(allowViolet);
|
||||||
G_UPDATE(allowExtendedNFA);
|
G_UPDATE(allowExtendedNFA);
|
||||||
G_UPDATE(allowLimExNFA);
|
G_UPDATE(allowLimExNFA);
|
||||||
@ -279,7 +276,6 @@ void applyGreyOverrides(Grey *g, const string &s) {
|
|||||||
G_UPDATE(roseMcClellanSuffix);
|
G_UPDATE(roseMcClellanSuffix);
|
||||||
G_UPDATE(roseMcClellanOutfix);
|
G_UPDATE(roseMcClellanOutfix);
|
||||||
G_UPDATE(roseTransformDelay);
|
G_UPDATE(roseTransformDelay);
|
||||||
G_UPDATE(roseDesiredSplit);
|
|
||||||
G_UPDATE(earlyMcClellanPrefix);
|
G_UPDATE(earlyMcClellanPrefix);
|
||||||
G_UPDATE(earlyMcClellanInfix);
|
G_UPDATE(earlyMcClellanInfix);
|
||||||
G_UPDATE(earlyMcClellanSuffix);
|
G_UPDATE(earlyMcClellanSuffix);
|
||||||
@ -336,7 +332,6 @@ void applyGreyOverrides(Grey *g, const string &s) {
|
|||||||
g->allowMcClellan = false;
|
g->allowMcClellan = false;
|
||||||
g->allowPuff = false;
|
g->allowPuff = false;
|
||||||
g->allowLiteral = false;
|
g->allowLiteral = false;
|
||||||
g->allowRose = false;
|
|
||||||
g->allowViolet = false;
|
g->allowViolet = false;
|
||||||
g->allowSmallLiteralSet = false;
|
g->allowSmallLiteralSet = false;
|
||||||
g->roseMasks = false;
|
g->roseMasks = false;
|
||||||
@ -354,7 +349,6 @@ void applyGreyOverrides(Grey *g, const string &s) {
|
|||||||
g->allowMcClellan = true;
|
g->allowMcClellan = true;
|
||||||
g->allowPuff = false;
|
g->allowPuff = false;
|
||||||
g->allowLiteral = false;
|
g->allowLiteral = false;
|
||||||
g->allowRose = false;
|
|
||||||
g->allowViolet = false;
|
g->allowViolet = false;
|
||||||
g->allowSmallLiteralSet = false;
|
g->allowSmallLiteralSet = false;
|
||||||
g->roseMasks = false;
|
g->roseMasks = false;
|
||||||
@ -372,7 +366,6 @@ void applyGreyOverrides(Grey *g, const string &s) {
|
|||||||
g->allowMcClellan = true;
|
g->allowMcClellan = true;
|
||||||
g->allowPuff = false;
|
g->allowPuff = false;
|
||||||
g->allowLiteral = false;
|
g->allowLiteral = false;
|
||||||
g->allowRose = false;
|
|
||||||
g->allowViolet = false;
|
g->allowViolet = false;
|
||||||
g->allowSmallLiteralSet = false;
|
g->allowSmallLiteralSet = false;
|
||||||
g->roseMasks = false;
|
g->roseMasks = false;
|
||||||
|
@ -54,7 +54,6 @@ struct Grey {
|
|||||||
bool allowMcSheng;
|
bool allowMcSheng;
|
||||||
bool allowPuff;
|
bool allowPuff;
|
||||||
bool allowLiteral;
|
bool allowLiteral;
|
||||||
bool allowRose;
|
|
||||||
bool allowViolet;
|
bool allowViolet;
|
||||||
bool allowExtendedNFA;
|
bool allowExtendedNFA;
|
||||||
bool allowLimExNFA;
|
bool allowLimExNFA;
|
||||||
@ -128,7 +127,6 @@ struct Grey {
|
|||||||
* always */
|
* always */
|
||||||
u32 roseMcClellanOutfix; /* 0 = off, 1 = sometimes, 2 = almost always */
|
u32 roseMcClellanOutfix; /* 0 = off, 1 = sometimes, 2 = almost always */
|
||||||
bool roseTransformDelay;
|
bool roseTransformDelay;
|
||||||
u32 roseDesiredSplit;
|
|
||||||
|
|
||||||
bool earlyMcClellanPrefix;
|
bool earlyMcClellanPrefix;
|
||||||
bool earlyMcClellanInfix;
|
bool earlyMcClellanInfix;
|
||||||
|
@ -52,7 +52,6 @@
|
|||||||
#include "ng_region.h"
|
#include "ng_region.h"
|
||||||
#include "ng_region_redundancy.h"
|
#include "ng_region_redundancy.h"
|
||||||
#include "ng_reports.h"
|
#include "ng_reports.h"
|
||||||
#include "ng_rose.h"
|
|
||||||
#include "ng_sep.h"
|
#include "ng_sep.h"
|
||||||
#include "ng_small_literal_set.h"
|
#include "ng_small_literal_set.h"
|
||||||
#include "ng_som.h"
|
#include "ng_som.h"
|
||||||
@ -255,10 +254,6 @@ bool addComponent(NG &ng, NGHolder &g, const NGWrapper &w, const som_type som,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (splitOffRose(*ng.rose, g, w.prefilter, ng.rm, cc)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (splitOffPuffs(*ng.rose, ng.rm, g, w.prefilter, cc)) {
|
if (splitOffPuffs(*ng.rose, ng.rm, g, w.prefilter, cc)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -276,25 +271,6 @@ bool addComponent(NG &ng, NGHolder &g, const NGWrapper &w, const som_type som,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (splitOffRose(*ng.rose, g, w.prefilter, ng.rm, cc)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// A final pass at cyclic redundancy and Rose
|
|
||||||
// TODO: investigate - coverage results suggest that this never succeeds?
|
|
||||||
if (cc.grey.performGraphSimplification) {
|
|
||||||
if (removeCyclicPathRedundancy(g) ||
|
|
||||||
removeCyclicDominated(g, som)) {
|
|
||||||
if (handleFixedWidth(*ng.rose, g, cc.grey)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (finalChanceRose(*ng.rose, g, w.prefilter, ng.rm, cc)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEBUG_PRINTF("testing for outfix\n");
|
DEBUG_PRINTF("testing for outfix\n");
|
||||||
assert(allMatchStatesHaveReports(g));
|
assert(allMatchStatesHaveReports(g));
|
||||||
if (ng.rose->addOutfix(g)) {
|
if (ng.rose->addOutfix(g)) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2015-2017, Intel Corporation
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* * Neither the name of Intel Corporation nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** \file
|
|
||||||
* \brief Rose construction from NGHolder.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef NG_ROSE_H
|
|
||||||
#define NG_ROSE_H
|
|
||||||
|
|
||||||
#include "ng_holder.h"
|
|
||||||
#include "ue2common.h"
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace ue2 {
|
|
||||||
|
|
||||||
class NGHolder;
|
|
||||||
class ReportManager;
|
|
||||||
class RoseBuild;
|
|
||||||
|
|
||||||
struct CompileContext;
|
|
||||||
struct ue2_literal;
|
|
||||||
|
|
||||||
/** \brief Attempt to consume the entire pattern in graph \a h with Rose.
|
|
||||||
* Returns true if successful. */
|
|
||||||
bool splitOffRose(RoseBuild &rose, const NGHolder &h, bool prefilter,
|
|
||||||
const ReportManager &rm, const CompileContext &cc);
|
|
||||||
|
|
||||||
/** \brief Attempt to consume the entire pattern in graph \a h with Rose.
|
|
||||||
* This is the last attempt to handle a pattern before we resort to an outfix.
|
|
||||||
* Returns true if successful. */
|
|
||||||
bool finalChanceRose(RoseBuild &rose, const NGHolder &h, bool prefilter,
|
|
||||||
const ReportManager &rm, const CompileContext &cc);
|
|
||||||
|
|
||||||
/** \brief True if the pattern in \a h is consumable by Rose. This function
|
|
||||||
* may be conservative (return false even if supported) for efficiency. */
|
|
||||||
bool checkRose(const ReportManager &rm, const NGHolder &h, bool prefilter,
|
|
||||||
const CompileContext &cc);
|
|
||||||
|
|
||||||
} // namespace ue2
|
|
||||||
|
|
||||||
#endif // NG_ROSE_H
|
|
@ -45,7 +45,6 @@
|
|||||||
#include "ng_redundancy.h"
|
#include "ng_redundancy.h"
|
||||||
#include "ng_region.h"
|
#include "ng_region.h"
|
||||||
#include "ng_reports.h"
|
#include "ng_reports.h"
|
||||||
#include "ng_rose.h"
|
|
||||||
#include "ng_split.h"
|
#include "ng_split.h"
|
||||||
#include "ng_util.h"
|
#include "ng_util.h"
|
||||||
#include "ng_width.h"
|
#include "ng_width.h"
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
#include "nfagraph/ng_region.h"
|
#include "nfagraph/ng_region.h"
|
||||||
#include "nfagraph/ng_repeat.h"
|
#include "nfagraph/ng_repeat.h"
|
||||||
#include "nfagraph/ng_reports.h"
|
#include "nfagraph/ng_reports.h"
|
||||||
#include "nfagraph/ng_rose.h"
|
|
||||||
#include "nfagraph/ng_util.h"
|
#include "nfagraph/ng_util.h"
|
||||||
#include "nfagraph/ng_width.h"
|
#include "nfagraph/ng_width.h"
|
||||||
#include "util/charreach.h"
|
#include "util/charreach.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user