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

Last change on this file since 5597 was 5574, checked in by cameron, 2 years ago

Refactor to make a common grep pipeline

File size: 1.5 KB
RevLine 
[4324]1/*
[5476]2 *  Copyright (c) 2017 International Characters.
[4324]3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
[5476]6#ifndef GREP_ENGINE_H
7#define GREP_ENGINE_H
8#include <grep_interface.h>
[5267]9#include <grep_type.h>  // for GrepType, GrepType::Normal
10#include <string>       // for string
11#include <vector>
[5476]12#include <re/re_parser.h> 
[5464]13
[5267]14namespace re { class CC; }
15namespace re { class RE; }
[5473]16namespace llvm { namespace cl { class OptionCategory; } }
[5474]17class Driver;
[4324]18
[5474]19
[5473]20namespace grep {
21
[5484]22// Thread function only.
23void *DoGrepThreadFunction(void *args);
24   
[5406]25class GrepEngine {
[4659]26public:
[4324]27
[5240]28    GrepEngine();
[5401]29
[5474]30
31    ~GrepEngine();
32
[5481]33    void grepCodeGen(std::vector<re::RE *> REs, GrepModeType grepMode, bool UTF_16, GrepSource grepSource);
[5398]34
[5473]35    void grepCodeGen_nvptx(std::vector<re::RE *> REs, GrepModeType grepMode, bool UTF_16);
[5377]36
[5550]37    void doGrep(const std::string & fileName, std::string & PTXFilename) const;
[5548]38   
[5484]39    uint64_t doGrep(const std::string & fileName, const uint32_t fileIdx) const;
[5458]40
[5419]41    uint64_t doGrep(const int32_t fileDescriptor, const uint32_t fileIdx) const;
[5481]42       
[4324]43private:
[4939]44   
[5474]45    Driver * mGrepDriver;
[4324]46};
47
[5481]48void initFileResult(std::vector<std::string> filenames);
49   
[5484]50void PrintResults();
[5481]51   
[4324]52
[5481]53re::CC * grepCodepoints(re::RE * pattern, char * UnicodeDataBuffer, size_t bufferLength);
54   
55const std::vector<std::string> & grepPropertyValues(const std::string& propertyName, re::RE * propertyValuePattern);
[5033]56
[5473]57}
[5033]58
[4324]59#endif
Note: See TracBrowser for help on using the repository browser.