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

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

Decoupling case-insensitive transform from parser

File size: 2.4 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
14   
15class RequiredStreams_UTF8 : public pablo::PabloKernel {
16public:
17    RequiredStreams_UTF8(const std::unique_ptr<kernel::KernelBuilder> & kb);
18    bool isCachable() const override { return true; }
19    bool hasSignature() const override { return false; }
20protected:
21    void generatePabloMethod() override;
22};
23
24class RequiredStreams_UTF16 : public pablo::PabloKernel {
25public:
26    RequiredStreams_UTF16(const std::unique_ptr<kernel::KernelBuilder> & kb);
27    bool isCachable() const override { return true; }
28    bool hasSignature() const override { return false; }
29protected:
30    void generatePabloMethod() override;
31};
32
33
34struct ICGrepSignature {
35    ICGrepSignature(re::RE * re_ast);
36protected:
37    re::RE * const  mRE;
38    std::string     mSignature;
39};
40
41   
42class ICGrepKernel : public ICGrepSignature, public pablo::PabloKernel {
43public:
44    ICGrepKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, re::RE * const re_ast, const unsigned numOfCharacterClasses = 8);
45    std::string makeSignature(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
46    bool isCachable() const override { return true; }
47protected:
48    void generatePabloMethod() override;
49};
50
51class MatchedLinesKernel : public pablo::PabloKernel {
52public:
53    MatchedLinesKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
54    bool isCachable() const override { return true; }
55    bool hasSignature() const override { return false; }
56protected:
57    void generatePabloMethod() override;   
58};
59
60class InvertMatchesKernel : public BlockOrientedKernel {
61public:
62    InvertMatchesKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
63private:
64    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
65};
66
67class PopcountKernel : public pablo::PabloKernel {
68public:
69    PopcountKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
70    bool isCachable() const override { return true; }
71    bool hasSignature() const override { return false; }
72protected:
73    void generatePabloMethod() override;   
74};
75   
76}
77#endif
Note: See TracBrowser for help on using the repository browser.