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

Last change on this file since 5458 was 5458, checked in by lindanl, 2 years ago

Add NVPTX driver.

File size: 1.5 KB
Line 
1/*
2 *  Copyright (c) 2016 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 DO_GREP_H
7#define DO_GREP_H
8#include <grep_type.h>  // for GrepType, GrepType::Normal
9#include <string>       // for string
10#include <vector>
11namespace llvm { class ExecutionEngine; }
12namespace llvm { class Module; }
13namespace re { class CC; }
14namespace re { class RE; }
15
16class GrepEngine {
17public:
18
19    GrepEngine();
20
21    void grepCodeGen(const std::string & moduleName, std::vector<re::RE *> REs, bool CountOnly, bool UTF_16, GrepSource grepSource, GrepType grepType = GrepType::Normal);
22
23    void grepCodeGen_nvptx(const std::string & moduleName, std::vector<re::RE *> REs, bool CountOnly, bool UTF_16);
24
25    void doGrep(const std::string & fileName) const;
26
27        uint64_t doGrep(const std::string & fileName, const uint32_t fileIdx) const;
28
29    uint64_t doGrep(const int32_t fileDescriptor, const uint32_t fileIdx) const;
30   
31    void doGrep(const char * buffer, const uint64_t length, const uint32_t fileIdx) const;
32
33    re::CC * grepCodepoints();
34
35    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
36   
37private:
38   
39    void * mGrepFunction;
40};
41
42
43re::CC * getParsedCodePointSet();
44void setParsedCodePointSet();
45
46void setParsedPropertyValues();
47
48void initFileResult(std::vector<std::string> filenames);
49void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
50
51#endif
Note: See TracBrowser for help on using the repository browser.