Changeset 4198


Ignore:
Timestamp:
Sep 29, 2014, 10:55:01 PM (5 years ago)
Author:
nmedfort
Message:

More refactoring. Moved CC and Pablo functions into their own folders. Rerun cmake to compile.

Location:
icGREP/icgrep-devel/icgrep
Files:
2 added
7 edited
40 moved

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r4197 r4198  
    5353include(FindBoost)
    5454
    55 add_library(PabloADT pe_advance.cpp  pe_all.cpp  pe_and.cpp pe_call.cpp pe_charclass.cpp  pe_matchstar.cpp pe_scanthru.cpp pe_not.cpp  pe_or.cpp  pe_pabloe.cpp  pe_sel.cpp  pe_var.cpp  pe_xor.cpp ps_assign.cpp  ps_if.cpp  ps_pablos.cpp  ps_while.cpp printer_pablos.cpp)
     55add_library(PabloADT pablo/pablo_routines.cpp pablo/pe_advance.cpp pablo/pe_all.cpp pablo/pe_and.cpp pablo/pe_call.cpp pablo/pe_charclass.cpp  pablo/pe_matchstar.cpp pablo/pe_scanthru.cpp pablo/pe_not.cpp  pablo/pe_or.cpp  pablo/pe_pabloe.cpp  pablo/pe_sel.cpp  pablo/pe_var.cpp  pablo/pe_xor.cpp pablo/ps_assign.cpp  pablo/ps_if.cpp  pablo/ps_pablos.cpp  pablo/ps_while.cpp printer_pablos.cpp)
    5656
    5757add_library(RegExpADT re/re_alt.cpp re/re_cc.cpp re/re_end.cpp re/re_name.cpp re/re_parser.cpp re/re_re.cpp re/re_rep.cpp re/re_seq.cpp re/re_start.cpp re/parsefailure.cpp re/re_reducer.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_compiler.cpp re/symbol_generator.cpp printer_re.cpp)
     58
     59add_library(CCADT cc/cc_compiler.cpp)
    5860
    5961include_directories("${PROJECT_SOURCE_DIR}")
    6062include_directories("${PROJECT_SOURCE_DIR}/re")
     63include_directories("${PROJECT_SOURCE_DIR}/cc")
     64include_directories("${PROJECT_SOURCE_DIR}/pablo")
    6165include_directories("${PROJECT_SOURCE_DIR}/include")
    6266include_directories("${PROJECT_SOURCE_DIR}/include/simd-lib")
     
    6872
    6973# add the executable
    70 add_executable(icgrep icgrep.cpp llvm_gen.cpp llvm_gen_helper.cpp utf_encoding.cpp cc_compiler.cpp  cc_compiler_helper.cpp compiler.cpp utf8_encoder.cpp unicode_categories.h unicode_categories-flat.h unicode_categories-simple.h)
    71 
    72 target_link_libraries (icgrep PabloADT RegExpADT ${REQ_LLVM_LIBRARIES})
     74add_executable(icgrep icgrep.cpp llvm_gen.cpp llvm_gen_helper.cpp compiler.cpp utf_encoding.cpp utf8_encoder.cpp unicode_categories.h unicode_categories-flat.h unicode_categories-simple.h)
     75
     76target_link_libraries (CCADT PabloADT)
     77target_link_libraries (icgrep PabloADT RegExpADT CCADT ${REQ_LLVM_LIBRARIES})
    7378if (Boost_FOUND)
    7479    target_link_libraries (icgrep ${Boost_LIBRARIES})
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r4196 r4198  
    88#include "ps_pablos.h"
    99#include "utf_encoding.h"
    10 #include "cc_compiler_helper.h"
     10#include <pablo/pablo_routines.h>
    1111
    1212//Pablo Expressions
     
    4747
    4848using namespace re;
     49using namespace pablo;
     50
     51namespace cc {
    4952
    5053CC_Compiler::CC_Compiler(const UTF_Encoding encoding, const std::string basis_pattern, const std::string gensym_pattern)
     
    155158            if ((pattern & test_bit) == 0)
    156159            {
    157                 bit_terms.push_back(CC_Compiler_Helper::make_not(make_bitv(bit_no)));
     160                bit_terms.push_back(make_not(make_bitv(bit_no)));
    158161            }
    159162            else
     
    176179        for (unsigned long i = 0; i < (bit_terms.size()/2); i++)
    177180        {
    178             new_terms.push_back(CC_Compiler_Helper::make_and(bit_terms[(2 * i) + 1], bit_terms[2 * i]));
     181            new_terms.push_back(make_and(bit_terms[(2 * i) + 1], bit_terms[2 * i]));
    179182        }
    180183        if (bit_terms.size() % 2 == 1)
     
    215218    PabloE* hi_test = LE_Range(diff_count - 1, n2 & mask1);
    216219
    217     return CC_Compiler_Helper::make_and(common, CC_Compiler_Helper::make_sel(make_bitv(diff_count - 1), hi_test, lo_test));
     220    return make_and(common, make_sel(make_bitv(diff_count - 1), hi_test, lo_test));
    218221}
    219222
     
    226229    else if (((N % 2) == 0) && ((n >> (N - 2)) == 0))
    227230    {
    228         return CC_Compiler_Helper::make_or(CC_Compiler_Helper::make_or(make_bitv(N-1), make_bitv(N-2)), GE_Range(N-2, n));
     231        return make_or(make_or(make_bitv(N-1), make_bitv(N-2)), GE_Range(N-2, n));
    229232    }
    230233    else if (((N % 2) == 0) && ((n >> (N - 2)) == 3))
    231234    {
    232         return CC_Compiler_Helper::make_and(CC_Compiler_Helper::make_and(make_bitv(N-1), make_bitv(N-2)), GE_Range(N-2, n-(3<<(N-2))));
     235        return make_and(make_and(make_bitv(N-1), make_bitv(N-2)), GE_Range(N-2, n-(3<<(N-2))));
    233236    }
    234237    else if(N >= 1)
     
    244247              the value of GE_range(N-1), lo_range) is required.
    245248            */
    246             return CC_Compiler_Helper::make_or(make_bitv(N-1), lo_range);
     249            return make_or(make_bitv(N-1), lo_range);
    247250        }
    248251        else
     
    252255              in the target for >= and GE_range(N-1, lo_bits) must also be true.
    253256            */
    254             return CC_Compiler_Helper::make_and(make_bitv(N-1), lo_range);
     257            return make_and(make_bitv(N-1), lo_range);
    255258        }
    256259    }
     
    271274    }
    272275    else {
    273         return CC_Compiler_Helper::make_not(GE_Range(N, n + 1));
     276        return make_not(GE_Range(N, n + 1));
    274277    }
    275278}
     
    306309                PabloE * bit0 = make_bitv(0);
    307310                if ((lo & 1) == 0) {
    308                     bit0 = CC_Compiler_Helper::make_not(bit0);
     311                    bit0 = make_not(bit0);
    309312                }
    310                 return CC_Compiler_Helper::make_and(expr, bit0);
     313                return make_and(expr, bit0);
    311314            }
    312315        }
     
    315318    for (const CharSetItem & item : *cc) {
    316319        PabloE * temp = char_or_range_expr(item.lo_codepoint, item.hi_codepoint);
    317         expr = (expr == nullptr) ? temp : CC_Compiler_Helper::make_or(expr, temp);
     320        expr = (expr == nullptr) ? temp : make_or(expr, temp);
    318321    }
    319322    return expr;
     
    428431    return new Var(bit_var((mEncoding.getBits() - 1) - n));
    429432}
     433
     434} // end of namespace cc
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.h

    r4197 r4198  
    1212#include <map>
    1313#include "utf_encoding.h"
    14 #include "ps_pablos.h"
    15 #include "pe_pabloe.h"
    16 #include "re/re_cc.h"
     14#include <pablo/ps_pablos.h>
     15#include <pablo/pe_pabloe.h>
     16#include <re/re_cc.h>
     17
     18namespace cc {
    1719
    1820struct Expression{
     
    5860};
    5961
     62}
     63
    6064#endif // CC_COMPILER_H
    6165
  • icGREP/icgrep-devel/icgrep/compiler.cpp

    r4197 r4198  
    2020#include "hrtime.h"
    2121#include "utf8_encoder.h"
    22 #include "cc_compiler.h"
     22#include "cc/cc_compiler.h"
    2323
    2424//FOR TESTING AND AND ANALYSIS
     
    3636
    3737using namespace re;
     38using namespace cc;
    3839
    3940namespace icgrep {
  • icGREP/icgrep-devel/icgrep/icgrep-devel.files

    r4197 r4198  
    136136re/symbol_generator.cpp
    137137re/symbol_generator.h
     138cc/cc_compiler.cpp
     139cc/cc_compiler.h
     140cc/cc_compiler_helper.cpp
     141cc/cc_compiler_helper.h
     142pablo/pbix_compiler.cpp
     143pablo/pbix_compiler.h
     144pablo/pe_advance.cpp
     145pablo/pe_advance.h
     146pablo/pe_all.cpp
     147pablo/pe_all.h
     148pablo/pe_and.cpp
     149pablo/pe_and.h
     150pablo/pe_call.cpp
     151pablo/pe_call.h
     152pablo/pe_charclass.cpp
     153pablo/pe_charclass.h
     154pablo/pe_matchstar.cpp
     155pablo/pe_matchstar.h
     156pablo/pe_not.cpp
     157pablo/pe_not.h
     158pablo/pe_or.cpp
     159pablo/pe_or.h
     160pablo/pe_pabloe.cpp
     161pablo/pe_pabloe.h
     162pablo/pe_scanthru.cpp
     163pablo/pe_scanthru.h
     164pablo/pe_sel.cpp
     165pablo/pe_sel.h
     166pablo/pe_var.cpp
     167pablo/pe_var.h
     168pablo/pe_xor.cpp
     169pablo/pe_xor.h
     170pablo/ps_assign.cpp
     171pablo/ps_assign.h
     172pablo/ps_if.cpp
     173pablo/ps_if.h
     174pablo/ps_pablos.cpp
     175pablo/ps_pablos.h
     176pablo/ps_while.cpp
     177pablo/ps_while.h
     178pablo/pablo_routines.cpp
     179pablo/pablo_routines.h
  • icGREP/icgrep-devel/icgrep/icgrep-devel.includes

    r4194 r4198  
    11.
    22re
     3cc
     4pablo
  • icGREP/icgrep-devel/icgrep/llvm_gen.cpp

    r4194 r4198  
    2727#include "ps_while.h"
    2828
    29 Ps* ps = NULL; Nl* nl = NULL; No* no = NULL; Lo* lo = NULL; Ll* ll = NULL; Lm* lm = NULL; Nd* nd = NULL;
    30 Pc* pc = NULL; Lt* lt = NULL; Lu* lu = NULL; Pf* pf = NULL; Pd* pd = NULL; Pe* pe = NULL; Pi* pi = NULL;
    31 Po* po = NULL; Me* me = NULL; Mc* mc = NULL; Mn* mn = NULL; Sk* sk = NULL; So* so = NULL; Sm* sm = NULL;
    32 Sc* sc = NULL; Zl* zl = NULL; Co* co = NULL; Cn* cn = NULL; Cc* cc = NULL; Cf* cf = NULL; Cs* cs = NULL;
    33 Zp* zp = NULL; Zs* zs = NULL;
     29Ps* fPs = NULL; Nl* fNl = NULL; No* fNo = NULL; Lo* fLo = NULL; Ll* fLl = NULL; Lm* fLm = NULL; Nd* fNd = NULL;
     30Pc* fPc = NULL; Lt* fLt = NULL; Lu* fLu = NULL; Pf* fPf = NULL; Pd* fPd = NULL; Pe* fPe = NULL; Pi* fPi = NULL;
     31Po* fPo = NULL; Me* fMe = NULL; Mc* fMc = NULL; Mn* fMn = NULL; Sk* fSk = NULL; So* fSo = NULL; Sm* fSm = NULL;
     32Sc* fSc = NULL; Zl* fZl = NULL; Co* fCo = NULL; Cn* fCn = NULL; Cc* fCc = NULL; Cf* fCf = NULL; Cs* fCs = NULL;
     33Zp* fZp = NULL; Zs* fZs = NULL;
    3434
    3535extern "C" {
     
    4141extern "C" {
    4242    BitBlock wrapped_get_category_Ps(Basis_bits &basis_bits){
    43         if (ps == NULL) ps = new Ps();
     43        if (fPs == nullptr) fPs = new Ps();
    4444        Struct_Ps ps_output;
    45         ps->do_block(basis_bits, ps_output);
     45        fPs->do_block(basis_bits, ps_output);
    4646
    4747        return ps_output.cc;
     
    5151extern "C" {
    5252    BitBlock wrapped_get_category_Nl(Basis_bits &basis_bits){
    53         if (nl == NULL) nl = new Nl();
     53        if (fNl == nullptr) fNl = new Nl();
    5454        Struct_Nl nl_output;
    55         nl->do_block(basis_bits, nl_output);
     55        fNl->do_block(basis_bits, nl_output);
    5656
    5757        return nl_output.cc;
     
    6161extern "C" {
    6262    BitBlock wrapped_get_category_No(Basis_bits &basis_bits){
    63         if (no == NULL) no = new No();
     63        if (fNo == nullptr) fNo = new No();
    6464        Struct_No no_output;
    65         no->do_block(basis_bits, no_output);
     65        fNo->do_block(basis_bits, no_output);
    6666
    6767        return no_output.cc;
     
    7171extern "C" {
    7272    BitBlock wrapped_get_category_Lo(Basis_bits &basis_bits){
    73         if (lo == NULL) lo = new Lo();
     73        if (fLo == nullptr) fLo = new Lo();
    7474        Struct_Lo lo_output;
    75         lo->do_block(basis_bits, lo_output);
     75        fLo->do_block(basis_bits, lo_output);
    7676
    7777        return lo_output.cc;
     
    8181extern "C" {
    8282    BitBlock wrapped_get_category_Ll(Basis_bits &basis_bits){
    83         if (ll == NULL) ll = new Ll();
     83        if (fLl == nullptr) fLl = new Ll();
    8484        Struct_Ll ll_output;
    85         ll->do_block(basis_bits, ll_output);
     85        fLl->do_block(basis_bits, ll_output);
    8686
    8787        return ll_output.cc;
     
    9191extern "C" {
    9292    BitBlock wrapped_get_category_Lm(Basis_bits &basis_bits){
    93         if (lm == NULL) lm = new Lm();
     93        if (fLm == nullptr) fLm = new Lm();
    9494        Struct_Lm lm_output;
    95         lm->do_block(basis_bits, lm_output);
     95        fLm->do_block(basis_bits, lm_output);
    9696
    9797        return lm_output.cc;
     
    101101extern "C" {
    102102    BitBlock wrapped_get_category_Nd(Basis_bits &basis_bits){
    103         if (nd == NULL) nd = new Nd();
     103        if (fNd == nullptr) fNd = new Nd();
    104104        Struct_Nd nd_output;
    105         nd->do_block(basis_bits, nd_output);
     105        fNd->do_block(basis_bits, nd_output);
    106106
    107107        return nd_output.cc;
     
    111111extern "C" {
    112112    BitBlock wrapped_get_category_Pc(Basis_bits &basis_bits){
    113         if (pc == NULL) pc = new Pc();
     113        if (fPc == nullptr) fPc = new Pc();
    114114        Struct_Pc pc_output;
    115         pc->do_block(basis_bits, pc_output);
     115        fPc->do_block(basis_bits, pc_output);
    116116
    117117        return pc_output.cc;
     
    121121extern "C" {
    122122    BitBlock wrapped_get_category_Lt(Basis_bits &basis_bits){
    123         if (lt == NULL) lt = new Lt();
     123        if (fLt == nullptr) fLt = new Lt();
    124124        Struct_Lt lt_output;
    125         lt->do_block(basis_bits, lt_output);
     125        fLt->do_block(basis_bits, lt_output);
    126126
    127127        return lt_output.cc;
     
    131131extern "C" {
    132132    BitBlock wrapped_get_category_Lu(Basis_bits &basis_bits){
    133         if (lu == NULL) lu = new Lu();
     133        if (fLu == nullptr) fLu = new Lu();
    134134        Struct_Lu lu_output;
    135         lu->do_block(basis_bits, lu_output);
     135        fLu->do_block(basis_bits, lu_output);
    136136
    137137        return lu_output.cc;
     
    141141extern "C" {
    142142    BitBlock wrapped_get_category_Pf(Basis_bits &basis_bits){
    143         if (pf == NULL) pf = new Pf();
     143        if (fPf == nullptr) fPf = new Pf();
    144144        Struct_Pf pf_output;
    145         pf->do_block(basis_bits, pf_output);
     145        fPf->do_block(basis_bits, pf_output);
    146146
    147147        return pf_output.cc;
     
    151151extern "C" {
    152152    BitBlock wrapped_get_category_Pd(Basis_bits &basis_bits){
    153         if (pd == NULL) pd = new Pd();
     153        if (fPd == nullptr) fPd = new Pd();
    154154        Struct_Pd pd_output;
    155         pd->do_block(basis_bits, pd_output);
     155        fPd->do_block(basis_bits, pd_output);
    156156
    157157        return pd_output.cc;
     
    161161extern "C" {
    162162    BitBlock wrapped_get_category_Pe(Basis_bits &basis_bits){
    163         if (pe == NULL) pe = new Pe();
     163        if (fPe == nullptr) fPe = new Pe();
    164164        Struct_Pe pe_output;
    165         pe->do_block(basis_bits, pe_output);
     165        fPe->do_block(basis_bits, pe_output);
    166166
    167167        return pe_output.cc;
     
    171171extern "C" {
    172172    BitBlock wrapped_get_category_Pi(Basis_bits &basis_bits){
    173         if (pi == NULL) pi = new Pi();
     173        if (fPi == nullptr) fPi = new Pi();
    174174        Struct_Pi pi_output;
    175         pi->do_block(basis_bits, pi_output);
     175        fPi->do_block(basis_bits, pi_output);
    176176
    177177        return pi_output.cc;
     
    181181extern "C" {
    182182    BitBlock wrapped_get_category_Po(Basis_bits &basis_bits){
    183         if (po == NULL) po = new Po();
     183        if (fPo == nullptr) fPo = new Po();
    184184        Struct_Po po_output;
    185         po->do_block(basis_bits, po_output);
     185        fPo->do_block(basis_bits, po_output);
    186186
    187187        return po_output.cc;
     
    191191extern "C" {
    192192    BitBlock wrapped_get_category_Me(Basis_bits &basis_bits){
    193         if (me == NULL) me = new Me();
     193        if (fMe == nullptr) fMe = new Me();
    194194        Struct_Me me_output;
    195         me->do_block(basis_bits, me_output);
     195        fMe->do_block(basis_bits, me_output);
    196196
    197197        return me_output.cc;
     
    201201extern "C" {
    202202    BitBlock wrapped_get_category_Mc(Basis_bits &basis_bits){
    203         if (mc == NULL) mc = new Mc();
     203        if (fMc == nullptr) fMc = new Mc();
    204204        Struct_Mc mc_output;
    205         mc->do_block(basis_bits, mc_output);
     205        fMc->do_block(basis_bits, mc_output);
    206206
    207207        return mc_output.cc;
     
    211211extern "C" {
    212212    BitBlock wrapped_get_category_Mn(Basis_bits &basis_bits){
    213         if (mn == NULL) mn = new Mn();
     213        if (fMn == nullptr) fMn = new Mn();
    214214        Struct_Mn mn_output;
    215         mn->do_block(basis_bits, mn_output);
     215        fMn->do_block(basis_bits, mn_output);
    216216
    217217        return mn_output.cc;
     
    221221extern "C" {
    222222    BitBlock wrapped_get_category_Sk(Basis_bits &basis_bits){
    223         if (sk == NULL) sk = new Sk();
     223        if (fSk == nullptr) fSk = new Sk();
    224224        Struct_Sk sk_output;
    225         sk->do_block(basis_bits, sk_output);
     225        fSk->do_block(basis_bits, sk_output);
    226226
    227227        return sk_output.cc;
     
    231231extern "C" {
    232232    BitBlock wrapped_get_category_So(Basis_bits &basis_bits){
    233         if (so == NULL) so = new So();
     233        if (fSo == nullptr) fSo = new So();
    234234        Struct_So so_output;
    235         so->do_block(basis_bits, so_output);
     235        fSo->do_block(basis_bits, so_output);
    236236
    237237        return so_output.cc;
     
    241241extern "C" {
    242242    BitBlock wrapped_get_category_Sm(Basis_bits &basis_bits){
    243         if (sm == NULL) sm = new Sm();
     243        if (fSm == nullptr) fSm = new Sm();
    244244        Struct_Sm sm_output;
    245         sm->do_block(basis_bits, sm_output);
     245        fSm->do_block(basis_bits, sm_output);
    246246
    247247        return sm_output.cc;
     
    251251extern "C" {
    252252    BitBlock wrapped_get_category_Sc(Basis_bits &basis_bits){
    253         if (sc == NULL) sc = new Sc();
     253        if (fSc == nullptr) fSc = new Sc();
    254254        Struct_Sc sc_output;
    255         sc->do_block(basis_bits, sc_output);
     255        fSc->do_block(basis_bits, sc_output);
    256256
    257257        return sc_output.cc;
     
    261261extern "C" {
    262262    BitBlock wrapped_get_category_Zl(Basis_bits &basis_bits){
    263         if (zl == NULL) zl = new Zl();
     263        if (fZl == nullptr) fZl = new Zl();
    264264        Struct_Zl zl_output;
    265         zl->do_block(basis_bits, zl_output);
     265        fZl->do_block(basis_bits, zl_output);
    266266
    267267        return zl_output.cc;
     
    271271extern "C" {
    272272    BitBlock wrapped_get_category_Co(Basis_bits &basis_bits){
    273         if (co == NULL) co = new Co();
     273        if (fCo == nullptr) fCo = new Co();
    274274        Struct_Co co_output;
    275         co->do_block(basis_bits, co_output);
     275        fCo->do_block(basis_bits, co_output);
    276276
    277277        return co_output.cc;
     
    281281extern "C" {
    282282    BitBlock wrapped_get_category_Cn(Basis_bits &basis_bits){
    283         if (cn == NULL) cn = new Cn();
     283        if (fCn == nullptr) fCn = new Cn();
    284284        Struct_Cn cn_output;
    285         cn->do_block(basis_bits, cn_output);
     285        fCn->do_block(basis_bits, cn_output);
    286286
    287287        return cn_output.cc;
     
    291291extern "C" {
    292292    BitBlock wrapped_get_category_Cc(Basis_bits &basis_bits){
    293         if (cc == NULL) cc = new Cc();
     293        if (fCc == nullptr) fCc = new Cc();
    294294        Struct_Cc cc_output;
    295         cc->do_block(basis_bits, cc_output);
     295        fCc->do_block(basis_bits, cc_output);
    296296
    297297        return cc_output.cc;
     
    301301extern "C" {
    302302    BitBlock wrapped_get_category_Cf(Basis_bits &basis_bits){
    303         if (cf == NULL) cf = new Cf();
     303        if (fCf == nullptr) fCf = new Cf();
    304304        Struct_Cf cf_output;
    305         cf->do_block(basis_bits, cf_output);
     305        fCf->do_block(basis_bits, cf_output);
    306306
    307307        return cf_output.cc;
     
    311311extern "C" {
    312312    BitBlock wrapped_get_category_Cs(Basis_bits &basis_bits){
    313         if (cs == NULL) cs = new Cs();
     313        if (fCs == nullptr) fCs = new Cs();
    314314        Struct_Cs cs_output;
    315         cs->do_block(basis_bits, cs_output);
     315        fCs->do_block(basis_bits, cs_output);
    316316
    317317        return cs_output.cc;
     
    321321extern "C" {
    322322    BitBlock wrapped_get_category_Zp(Basis_bits &basis_bits){
    323         if (zp == NULL) zp = new Zp();
     323        if (fZp == nullptr) fZp = new Zp();
    324324        Struct_Zp zp_output;
    325         zp->do_block(basis_bits, zp_output);
     325        fZp->do_block(basis_bits, zp_output);
    326326
    327327        return zp_output.cc;
     
    331331extern "C" {
    332332    BitBlock wrapped_get_category_Zs(Basis_bits &basis_bits){
    333         if (zs == NULL) zs = new Zs();
     333        if (fZs == nullptr) fZs = new Zs();
    334334        Struct_Zs zs_output;
    335         zs->do_block(basis_bits, zs_output);
     335        fZs->do_block(basis_bits, zs_output);
    336336
    337337        return zs_output.cc;
     
    350350    delete mMod;
    351351
    352     if (ps != NULL) delete ps;
    353     if (nl != NULL) delete nl;
    354     if (no != NULL) delete no;
    355     if (lo != NULL) delete lo;
    356     if (ll != NULL) delete ll;
    357     if (lm != NULL) delete lm;
    358     if (nd != NULL) delete nd;
    359     if (pc != NULL) delete pc;
    360     if (lt != NULL) delete lt;
    361     if (lu != NULL) delete lu;
    362     if (pf != NULL) delete pf;
    363     if (pd != NULL) delete pd;
    364     if (pe != NULL) delete pe;
    365     if (pi != NULL) delete pi;
    366     if (po != NULL) delete po;
    367     if (me != NULL) delete me;
    368     if (mc != NULL) delete mc;
    369     if (mn != NULL) delete mn;
    370     if (sk != NULL) delete sk;
    371     if (so != NULL) delete so;
    372     if (sm != NULL) delete sm;
    373     if (sc != NULL) delete sc;
    374     if (zl != NULL) delete zl;
    375     if (co != NULL) delete co;
    376     if (cn != NULL) delete cn;
    377     if (cc != NULL) delete cc;
    378     if (cf != NULL) delete cf;
    379     if (cs != NULL) delete cs;
    380     if (zp != NULL) delete zp;
    381     if (zs != NULL) delete zs;
     352    delete fPs;
     353    delete fNl;
     354    delete fNo;
     355    delete fLo;
     356    delete fLl;
     357    delete fLm;
     358    delete fNd;
     359    delete fPc;
     360    delete fLt;
     361    delete fLu;
     362    delete fPf;
     363    delete fPd;
     364    delete fPe;
     365    delete fPi;
     366    delete fPo;
     367    delete fMe;
     368    delete fMc;
     369    delete fMn;
     370    delete fSk;
     371    delete fSo;
     372    delete fSm;
     373    delete fSc;
     374    delete fZl;
     375    delete fCo;
     376    delete fCn;
     377    delete fCc;
     378    delete fCf;
     379    delete fCs;
     380    delete fZp;
     381    delete fZs;
    382382
    383383}
  • icGREP/icgrep-devel/icgrep/pablo/pablo_routines.cpp

    r4197 r4198  
    55 */
    66
    7 #include "cc_compiler_helper.h"
     7#include "pablo_routines.h"
    88//Pablo Expressions
    99#include "pe_advance.h"
     
    2020#include "pe_var.h"
    2121#include "pe_xor.h"
    22 // #include "pe_pabloe.h"
    23 // #include "cc_compiler.h"
    24 
    25 CC_Compiler_Helper::CC_Compiler_Helper(){}
     22
     23namespace pablo {
    2624
    2725/*
     
    3634*/
    3735
    38 PabloE * CC_Compiler_Helper::make_not(PabloE* expr)
    39 {
    40     if (All* all = dynamic_cast<All*>(expr)) {
    41         if (all->getNum() == 1) //If true literal.
    42         {
     36PabloE * make_not(PabloE * expr)
     37{
     38    if (All * all = dynamic_cast<All*>(expr)) {
     39        if (all->getNum() == 1) { //If true literal.
    4340            return new All(0); //Set to false literal.
    4441        }
    45         else //if (all->getNum() == 0) //If false literal.
    46         {
     42        else { //if (all->getNum() == 0) //If false literal.
    4743            return new All(1); //Set to true literal.
    4844        }
     
    5955}
    6056
    61 PabloE * CC_Compiler_Helper::make_and(PabloE * expr1, PabloE *expr2)
     57PabloE * make_and(PabloE * expr1, PabloE *expr2)
    6258{
    6359    if (All* all = dynamic_cast<All*>(expr1)) {
     
    116112}
    117113
    118 PabloE * CC_Compiler_Helper::make_or(PabloE * expr1, PabloE * expr2)
     114PabloE * make_or(PabloE * expr1, PabloE * expr2)
    119115{
    120116    if (All * all = dynamic_cast<All*>(expr1)) {
     
    156152    }
    157153
    158     if (And* and_expr1 = dynamic_cast<And*>(expr1))
    159     {
    160         if (And* and_expr2 = dynamic_cast<And*>(expr2))
     154    if (And * and_expr1 = dynamic_cast<And*>(expr1))
     155    {
     156        if (And * and_expr2 = dynamic_cast<And*>(expr2))
    161157        {
    162158            PabloE * expr1a = and_expr1->getExpr1();
     
    189185}
    190186
    191 PabloE* CC_Compiler_Helper::make_sel(PabloE *if_expr, PabloE *t_expr, PabloE *f_expr)
     187PabloE* make_sel(PabloE *if_expr, PabloE *t_expr, PabloE *f_expr)
    192188{
    193189    if (All* all_if_expr = dynamic_cast<All*>(if_expr))
     
    234230}
    235231
    236 PabloE* CC_Compiler_Helper::make_xor(PabloE *expr1, PabloE *expr2)
     232PabloE* make_xor(PabloE *expr1, PabloE *expr2)
    237233{
    238234    if (All* all_expr1 = dynamic_cast<All*>(expr1))
     
    278274*/
    279275
    280 bool CC_Compiler_Helper::equals(const PabloE * expr1, const PabloE * expr2)
     276bool equals(const PabloE * expr1, const PabloE * expr2)
    281277{
    282278    if (const All * all1 = dynamic_cast<const All*>(expr1)) {
     
    337333    return false;
    338334}
     335
     336} // end of namespace cc
  • icGREP/icgrep-devel/icgrep/pablo/pablo_routines.h

    r4197 r4198  
    1010class PabloE;
    1111
    12 class CC_Compiler_Helper
    13 {
    14 public:
    15     static PabloE* make_not(PabloE* expr);
    16     static PabloE* make_and(PabloE* expr1, PabloE* expr2);
    17     static PabloE* make_or(PabloE* expr1, PabloE* expr2);
    18     static PabloE* make_sel(PabloE* if_expr, PabloE* t_expr, PabloE* f_expr);
    19     static PabloE* make_xor(PabloE* expr1, PabloE* expr2);
    20     static bool equals(const PabloE *expr1, const PabloE *expr2);
    21 private:
    22     CC_Compiler_Helper();
    23 };
     12namespace pablo {
     13
     14PabloE * make_not(PabloE * expr);
     15PabloE * make_and(PabloE * expr1, PabloE * expr2);
     16PabloE * make_or(PabloE * expr1, PabloE * expr2);
     17PabloE * make_sel(PabloE * if_expr, PabloE * t_expr, PabloE * f_expr);
     18PabloE * make_xor(PabloE * expr1, PabloE * expr2);
     19bool equals(const PabloE * expr1, const PabloE *expr2);
     20
     21}
    2422
    2523#endif // COMPILER_HELPER_H
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r4197 r4198  
    1515
    1616//Pablo Expressions
    17 #include "../pe_pabloe.h"
    18 #include "../pe_sel.h"
    19 #include "../pe_advance.h"
    20 #include "../pe_all.h"
    21 #include "../pe_and.h"
    22 #include "../pe_charclass.h"
    23 #include "../pe_call.h"
    24 #include "../pe_matchstar.h"
    25 #include "../pe_scanthru.h"
    26 #include "../pe_not.h"
    27 #include "../pe_or.h"
    28 #include "../pe_var.h"
    29 #include "../pe_xor.h"
     17#include "pablo/pe_pabloe.h"
     18#include "pablo/pe_sel.h"
     19#include "pablo/pe_advance.h"
     20#include "pablo/pe_all.h"
     21#include "pablo/pe_and.h"
     22#include "pablo/pe_charclass.h"
     23#include "pablo/pe_call.h"
     24#include "pablo/pe_matchstar.h"
     25#include "pablo/pe_scanthru.h"
     26#include "pablo/pe_not.h"
     27#include "pablo/pe_or.h"
     28#include "pablo/pe_var.h"
     29#include "pablo/pe_xor.h"
    3030
    3131//Pablo Statements
    32 #include "../ps_pablos.h"
    33 #include "../ps_assign.h"
    34 #include "../ps_if.h"
    35 #include "../ps_while.h"
     32#include "pablo/ps_pablos.h"
     33#include "pablo/ps_assign.h"
     34#include "pablo/ps_if.h"
     35#include "pablo/ps_while.h"
    3636
    3737#include <assert.h>
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r4197 r4198  
    88#define RE_TO_PABLO_COMPILER_H
    99
    10 //Regular Expressions
    11 #include "re_re.h"
    12 //Pablo Statements
    13 #include "../ps_pablos.h"
    14 //Code Generation
    15 #include "symbol_generator.h"
     10#include <pablo/ps_pablos.h>
     11#include <re/re_re.h>
     12#include <re/symbol_generator.h>
    1613
    1714#include <string>
Note: See TracChangeset for help on using the changeset viewer.