Ignore:
Timestamp:
Sep 29, 2014, 2:11:34 PM (5 years ago)
Author:
nmedfort
Message:

More refactoring of the RE system; moved the original re/RE_Compiler to compiler.cpp and the PBIX_Compiler to the re/RE_Compiler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r4194 r4197  
    55 */
    66
    7 #ifndef RE_COMPILER_H
    8 #define RE_COMPILER_H
     7#ifndef RE_TO_PABLO_COMPILER_H
     8#define RE_TO_PABLO_COMPILER_H
    99
     10//Regular Expressions
    1011#include "re_re.h"
    11 #include "../utf_encoding.h"
    12 #include "../llvm_gen.h"
     12//Pablo Statements
     13#include "../ps_pablos.h"
     14//Code Generation
     15#include "symbol_generator.h"
     16
    1317#include <string>
     18#include <list>
     19#include <map>
    1420
    1521namespace re {
     22class RE_Compiler {
     23public:
     24    RE_Compiler(std::map<std::string, std::string> name_map);
     25    CodeGenState compile(RE *re);
     26    CodeGenState compile_subexpressions(const std::map<std::string, RE*>& re_map);
     27private:
     28    void compile(RE * re, CodeGenState & cg_state);
     29    void compile(Alt * alt, CodeGenState & cg_state);
     30    void compile(Seq * seq, CodeGenState & cg_state);
     31    void compile(Rep * rep, CodeGenState & cg_state);
     32    void compileUnboundedRep(RE * repeated, int lb, CodeGenState  & cg_state);
     33    void compileBoundedRep(RE * repeated, int lb, int ub, CodeGenState &cg_state);
     34    void compile(Name * name, CodeGenState & cg_state);
    1635
    17 struct processed_parsetree_results{
    18     RE* re;
    19     std::string remaining;
    20 };
    2136
    22 class RE_Compiler
    23 {
    24 public:
    25     RE_Compiler();
    26     LLVM_Gen_RetVal compile(bool show_compile_time,
    27                             bool ascii_only,
    28                             std::string basis_pattern,
    29                             std::string gensym_pattern,
    30                             UTF_Encoding encoding ,
    31                             std::string input_string);
     37
     38    static bool hasUnicode(const RE *re);
     39
     40    SymbolGenerator symgen;
     41    std::map<std::string, std::string> m_name_map;
    3242};
    3343
    3444}
    3545
    36 #endif // RE_COMPILER_H
     46#endif // COMPILER_H
Note: See TracChangeset for help on using the changeset viewer.