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/pbix_compiler.h

    r4194 r4197  
    55 */
    66
    7 #ifndef COMPILER_H
    8 #define COMPILER_H
    9 
    10 //Regular Expressions
    11 #include "re/re_re.h"
    12 //Pablo Statements
    13 #include "ps_pablos.h"
    14 //Code Generation
    15 #include "symbol_generator.h"
    16 
    17 #include <string>
    18 #include <list>
    19 #include <map>
    20 
    21 
    22 struct CodeGenState{
    23     std::list<PabloS*> stmtsl;
    24     std::string newsym;
    25 };
    26 
    27 class Pbix_Compiler
    28 {
    29     typedef re::RE                  RE;
    30     typedef re::Vector              Vector;
    31     typedef Vector::const_iterator  const_iterator;
    32 
    33 public:
    34     Pbix_Compiler(std::map<std::string, std::string> name_map);
    35     CodeGenState compile(RE *re);
    36     CodeGenState compile_subexpressions(const std::map<std::string, RE*>& re_map);
    37 private:
    38     CodeGenState re2pablo_helper(RE *re, CodeGenState cg_state);
    39     CodeGenState Seq_helper(Vector * lst, const_iterator it, CodeGenState cg_state);
    40     CodeGenState Alt_helper(Vector * lst, const_iterator it, CodeGenState cg_state);
    41     CodeGenState UnboundedRep_helper(RE* repeated, int lb, CodeGenState cg_state);
    42     CodeGenState BoundedRep_helper(RE* repeated, int lb, int ub, CodeGenState cg_state);
    43 
    44     static bool hasUnicode(const RE *re);
    45 
    46     SymbolGenerator symgen;
    47     std::map<std::string, std::string> m_name_map;
    48 };
    49 
    50 #endif // COMPILER_H
Note: See TracChangeset for help on using the changeset viewer.