source: icGREP/icgrep-devel/icgrep/grep_engine.h @ 5652

Last change on this file since 5652 was 5620, checked in by nmedfort, 23 months ago

Bug fixes for multigrep mode. Optional PabloKernel? branch hit counter added. Minor optimizations.

File size: 1.5 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 *  icgrep is a trademark of International Characters.
5 */
6#ifndef GREP_ENGINE_H
7#define GREP_ENGINE_H
8#include <grep_interface.h>
9#include <grep_type.h>  // for GrepType, GrepType::Normal
10#include <string>       // for string
11#include <vector>
12#include <re/re_parser.h>
13#include <re/re_multiplex.h>
14
15namespace re { class CC; }
16namespace re { class RE; }
17namespace llvm { namespace cl { class OptionCategory; } }
18class Driver;
19
20
21namespace grep {
22
23// Thread function only.
24void *DoGrepThreadFunction(void *args);
25   
26class GrepEngine {
27public:
28
29    GrepEngine();
30
31
32    ~GrepEngine();
33
34    void grepCodeGen(std::vector<re::RE *> REs, GrepModeType grepMode, bool UTF_16, GrepSource grepSource);
35
36    void grepCodeGen_nvptx(std::vector<re::RE *> REs, GrepModeType grepMode, bool UTF_16);
37
38    void doGrep(const std::string & fileName, std::string & PTXFilename) const;
39   
40    uint64_t doGrep(const std::string & fileName, const uint32_t fileIdx) const;
41
42    uint64_t doGrep(const int32_t fileDescriptor, const uint32_t fileIdx) const;
43       
44private:
45   
46    Driver * mGrepDriver;
47};
48
49void initFileResult(std::vector<std::string> filenames);
50   
51void PrintResults();
52   
53
54re::CC * grepCodepoints(re::RE * pattern, char * UnicodeDataBuffer, size_t bufferLength);
55   
56const std::vector<std::string> & grepPropertyValues(const std::string& propertyName, re::RE * propertyValuePattern);
57
58}
59
60#endif
Note: See TracBrowser for help on using the repository browser.