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

Last change on this file since 4960 was 4959, checked in by nmedfort, 4 years ago

Initial modifications to Pablo Compiler and Kernel Builder to support circular buffers for Lookahead.

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