source: icGREP/icgrep-devel/icgrep/kernels/grep_kernel.h @ 5548

Last change on this file since 5548 was 5548, checked in by cameron, 23 months ago

Decouple finalizeMatchResults, creating separate MatchedLinesKernel?

File size: 1.7 KB
Line 
1/*
2 *  Copyright (c) 2017 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef GREP_KERNEL_H
6#define GREP_KERNEL_H
7
8#include <pablo/pablo_kernel.h>  // for PabloKernel
9
10namespace IDISA { class IDISA_Builder; }
11namespace re { class RE; }
12namespace kernel {
13
14struct RegularExpressionOptimizer {
15    RegularExpressionOptimizer(re::RE * re_ast);
16protected:
17    re::RE * const  mRE;
18    std::string     mSignature;
19};
20
21class ICGrepKernel : public RegularExpressionOptimizer, public pablo::PabloKernel {
22public:
23    ICGrepKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, re::RE * const re_ast);
24    std::string makeSignature(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
25    bool isCachable() const override { return true; }
26protected:
27    void generatePabloMethod() override;
28};
29
30class MatchedLinesKernel : public pablo::PabloKernel {
31public:
32    MatchedLinesKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
33    bool isCachable() const override { return true; }
34    bool hasSignature() const override { return false; }
35protected:
36    void generatePabloMethod() override;   
37};
38
39class InvertMatchesKernel : public BlockOrientedKernel {
40public:
41    InvertMatchesKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
42private:
43    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
44};
45
46class PopcountKernel : public pablo::PabloKernel {
47public:
48    PopcountKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
49    bool isCachable() const override { return true; }
50    bool hasSignature() const override { return false; }
51protected:
52    void generatePabloMethod() override;   
53};
54   
55}
56#endif
Note: See TracBrowser for help on using the repository browser.