source: icGREP/icgrep-devel/icgrep/re/re_compiler.h @ 4210

Last change on this file since 4210 was 4210, checked in by nmedfort, 5 years ago

First stage of code generator revamp

File size: 1.2 KB
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef RE_TO_PABLO_COMPILER_H
8#define RE_TO_PABLO_COMPILER_H
9
10#include <pablo/codegenstate.h>
11#include <re/re_re.h>
12
13#include <string>
14#include <list>
15#include <map>
16
17namespace re {
18class RE_Compiler {
19public:
20
21    RE_Compiler(pablo::CodeGenState & baseCG, std::map<std::string, std::string> name_map);
22
23    void compile(RE * re);
24
25private:
26    void process(RE * re, pablo::CodeGenState & cg_state);
27    void process(Alt * alt, pablo::CodeGenState & cg_state);
28    void process(Seq * seq, pablo::CodeGenState & cg_state);
29    void process(Rep * rep, pablo::CodeGenState & cg_state);
30    void processUnboundedRep(RE * repeated, int lb, pablo::CodeGenState & cg_state);
31    void processBoundedRep(RE * repeated, int lb, int ub, pablo::CodeGenState & cg_state);
32    void process(Name * name, pablo::CodeGenState & cg_state);
33
34    static bool hasUnicode(const RE *re);
35
36    pablo::CodeGenState &               mBaseCG;
37    std::map<std::string, std::string>  m_name_map;
38};
39
40}
41
42#endif // COMPILER_H
Note: See TracBrowser for help on using the repository browser.