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

Last change on this file since 5048 was 5048, checked in by cameron, 3 years ago

Clean out vestigial finalLineUnterminated logic in grep_engine

File size: 1.4 KB
Line 
1#ifndef DO_GREP_H
2#define DO_GREP_H
3/*
4 *  Copyright (c) 2016 International Characters.
5 *  This software is licensed to the public under the Open Software License 3.0.
6 *  icgrep is a trademark of International Characters.
7 */
8
9#include <string>
10#include <stdint.h>
11#include <re/re_re.h>
12#include <llvm/ExecutionEngine/ExecutionEngine.h>
13
14
15namespace llvm { class raw_ostream; }
16
17
18
19class GrepEngine {
20    typedef void (*GrepFunctionType)(char * byte_data, size_t filesize, const int fileIdx);
21    typedef uint64_t (*GrepFunctionType_CountOnly)(char * byte_data, size_t filesize, const int fileIdx);
22public:
23
24    GrepEngine() {}
25
26    ~GrepEngine();
27 
28    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, bool isNameExpression = false);
29   
30    void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<uint64_t> &total_CountOnly, bool UTF_16);
31   
32    re::CC *  grepCodepoints();
33   
34private:
35   
36    GrepFunctionType mGrepFunction;
37    GrepFunctionType_CountOnly mGrepFunction_CountOnly;
38
39    bool mIsNameExpression;
40    llvm::ExecutionEngine * mEngine;
41};
42
43void icgrep_Linking(Module * m, ExecutionEngine * e);
44
45
46re::CC * getParsedCodePointSet();
47void setParsedCodePointSet();
48
49void initResult(std::vector<std::string> filenames);
50void PrintResult(bool CountOnly, std::vector<uint64_t> & total_CountOnly);
51
52#endif
Note: See TracBrowser for help on using the repository browser.