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

Last change on this file since 5267 was 5267, checked in by nmedfort, 2 years ago

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

File size: 1.7 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 {
17    typedef void (*GrepFunctionType)(char * byte_data, size_t filesize, const int fileIdx);
18    typedef uint64_t (*GrepFunctionType_CountOnly)(char * byte_data, size_t filesize, const int fileIdx);
19    typedef void (*GrepFunctionType_CPU)(char * rslt, char * byte_data, size_t filesize, const int fileIdx);
20public:
21
22    GrepEngine();
23    ~GrepEngine();
24 
25    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal);
26   
27    void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<size_t> & total_CountOnly, bool UTF_16);
28   
29    re::CC *  grepCodepoints();
30
31    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
32   
33private:
34   
35    GrepFunctionType mGrepFunction;
36    GrepFunctionType_CountOnly mGrepFunction_CountOnly;
37    GrepFunctionType_CPU mGrepFunction_CPU;
38
39    GrepType mGrepType;
40    llvm::ExecutionEngine * mEngine;
41};
42
43void icgrep_Linking(llvm::Module * m, llvm::ExecutionEngine * e);
44
45
46re::CC * getParsedCodePointSet();
47void setParsedCodePointSet();
48
49void setParsedPropertyValues();
50
51
52void initResult(std::vector<std::string> filenames);
53void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
54
55#endif
Note: See TracBrowser for help on using the repository browser.