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

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

Restructuring step

File size: 1014 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    bool openMMap(const std::string & fileName);
27
28    void doGrep();
29   
30    re::CC *  grepCodepoints();
31
32    ~GrepEngine() {
33      delete mEngine;
34    }
35   
36private:
37   
38    bool finalLineIsUnterminated() const;
39
40    main_fcn_T mMainFcn;
41   
42    std::string mFileName;
43    size_t mFileSize;
44    char * mFileBuffer;
45    llvm::ExecutionEngine * mEngine;
46};
47
48
49#endif
Note: See TracBrowser for help on using the repository browser.