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

Last change on this file since 4967 was 4967, checked in by lindanl, 3 years ago

Multiple input files can run on separate threads.

File size: 977 bytes
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
15typedef void (*main_fcn_T)(char * byte_data, int filesize, const char* filename, uint64_t finalLineUnterminated);
16
17namespace llvm { class raw_ostream; }
18
19class GrepEngine {
20public:
21
22    GrepEngine() {}
23 
24    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool isNameExpression = false);
25   
26    void doGrep(const std::string & fileName);
27   
28    re::CC *  grepCodepoints();
29
30    ~GrepEngine() {
31      delete mEngine;
32    }
33   
34private:
35   
36    bool finalLineIsUnterminated(char * fileBuffer, int fileSize) const;
37
38    main_fcn_T mMainFcn;
39   
40    bool mIsNameExpression;
41    llvm::ExecutionEngine * mEngine;
42};
43
44
45#endif
Note: See TracBrowser for help on using the repository browser.