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

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

Bug fixed.

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