Ignore:
Timestamp:
Oct 2, 2014, 4:14:21 PM (5 years ago)
Author:
nmedfort
Message:

Minor clean-up

Location:
icGREP/icgrep-devel/icgrep
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/llvm_gen.h

    r4199 r4206  
    7474
    7575using namespace llvm;
     76using namespace pablo;
    7677
    7778struct LLVM_Gen_RetVal
     
    8788
    8889class LLVM_Generator {
    89     typedef pablo::PabloE       PabloE;
    9090    typedef std::list<PabloE *> List;
    9191public:
  • icGREP/icgrep-devel/icgrep/pablo/pe_scanthru.h

    r4200 r4206  
    88#define PS_SCANTHRU_H
    99
    10 #include "ps_pablos.h"
     10#include <pablo/pe_pabloe.h>
    1111
    1212namespace pablo {
  • icGREP/icgrep-devel/icgrep/pablo/ps_if.h

    r4200 r4206  
    88#define PS_IF_H
    99
    10 #include "ps_pablos.h"
     10#include <pablo/pe_pabloe.h>
    1111#include <list>
    1212
  • icGREP/icgrep-devel/icgrep/pablo/ps_pablos.h

    r4199 r4206  
    1010#include <list>
    1111#include <string>
    12 #include "pe_pabloe.h"
     12
     13namespace pablo {
     14
     15class PabloE;
    1316
    1417struct CodeGenState{
    15     std::list<pablo::PabloE *>  stmtsl;
    16     std::string                 newsym;
     18    std::list<PabloE *>  stmtsl;
     19    std::string          newsym;
    1720};
    1821
     22}
     23
    1924#endif // PS_PABLOS_H
  • icGREP/icgrep-devel/icgrep/pablo/ps_while.h

    r4200 r4206  
    88#define PS_WHILE_H
    99
    10 #include "ps_pablos.h"
     10#include <pablo/pe_pabloe.h>
    1111#include <list>
    1212
  • icGREP/icgrep-devel/icgrep/printer_pablos.cpp

    r4200 r4206  
    66
    77#include "printer_pablos.h"
     8
    89
    910//Regular Expressions
     
    1718//Pablo Expressions
    1819#include <pablo/pe_pabloe.h>
     20#include <pablo/ps_pablos.h>
    1921#include <pablo/pe_advance.h>
    2022#include <pablo/pe_all.h>
  • icGREP/icgrep-devel/icgrep/printer_pablos.h

    r4199 r4206  
    1212#include <list>
    1313
     14namespace pablo {
     15    class PabloE;
     16    class CodeGenState;
     17}
     18
    1419class StatementPrinter {
    15     typedef pablo::PabloE       PabloE;
    16     typedef std::list<PabloE *> List;
     20    typedef std::list<pablo::PabloE *> List;
    1721public:
    18     static std::string PrintStmts(const CodeGenState  &cg_state);
     22    static std::string PrintStmts(const pablo::CodeGenState & cg_state);
    1923    static std::string Print_CC_PabloStmts(const List & stmts);
    2024    static std::string Print_PB_PabloStmts(const List & stmts, std::string strOut);
    21     static std::string ShowPabloE(const PabloE * expr);
    22     static std::string ShowPabloS(const PabloE *stmt);
     25    static std::string ShowPabloE(const pablo::PabloE * expr);
     26    static std::string ShowPabloS(const pablo::PabloE *stmt);
    2327};
    2428
  • icGREP/icgrep-devel/icgrep/re/re_alt.h

    r4203 r4206  
    2121    static inline bool classof(const void *) {
    2222        return false;
    23     }
    24     virtual RE * clone() const {
    25         return new Alt(*this);
    2623    }
    2724protected:
  • icGREP/icgrep-devel/icgrep/re/re_cc.h

    r4194 r4206  
    3434    static inline bool classof(const void *) {
    3535        return false;
    36     }
    37     virtual RE * clone() const {
    38         return new CC(*this);
    3936    }
    4037
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r4198 r4206  
    2020public:
    2121    RE_Compiler(std::map<std::string, std::string> name_map);
    22     CodeGenState compile(RE *re);
    23     CodeGenState compile_subexpressions(const std::map<std::string, RE*>& re_map);
     22    pablo::CodeGenState compile(RE *re);
     23    pablo::CodeGenState compile_subexpressions(const std::map<std::string, RE*>& re_map);
    2424private:
    25     void compile(RE * re, CodeGenState & cg_state);
    26     void compile(Alt * alt, CodeGenState & cg_state);
    27     void compile(Seq * seq, CodeGenState & cg_state);
    28     void compile(Rep * rep, CodeGenState & cg_state);
    29     void compileUnboundedRep(RE * repeated, int lb, CodeGenState  & cg_state);
    30     void compileBoundedRep(RE * repeated, int lb, int ub, CodeGenState &cg_state);
    31     void compile(Name * name, CodeGenState & cg_state);
    32 
    33 
     25    void compile(RE * re, pablo::CodeGenState & cg_state);
     26    void compile(Alt * alt, pablo::CodeGenState & cg_state);
     27    void compile(Seq * seq, pablo::CodeGenState & cg_state);
     28    void compile(Rep * rep, pablo::CodeGenState & cg_state);
     29    void compileUnboundedRep(RE * repeated, int lb, pablo::CodeGenState  & cg_state);
     30    void compileBoundedRep(RE * repeated, int lb, int ub, pablo::CodeGenState &cg_state);
     31    void compile(Name * name, pablo::CodeGenState & cg_state);
    3432
    3533    static bool hasUnicode(const RE *re);
  • icGREP/icgrep-devel/icgrep/re/re_end.h

    r4194 r4206  
    2020        return false;
    2121    }
    22     virtual RE * clone() const {
    23         return new End();
    24     }
    2522    virtual ~End() {}
    2623protected:
  • icGREP/icgrep-devel/icgrep/re/re_name.h

    r4194 r4206  
    1414    static inline bool classof(const void *) {
    1515        return false;
    16     }
    17     virtual RE * clone() const {
    18         return new Name(*this);
    1916    }
    2017    enum class Type {
     
    3532    friend Name * makeName(std::string, const bool, const Type);
    3633    Name();
    37     Name(const Name & name);
    3834    Name(std::string name, const bool negated, const Type type);
    3935private:
     
    5652, mNegated(negated)
    5753, mType(type) {
    58 
    59 }
    60 
    61 inline Name::Name(const Name &name)
    62 : RE(ClassTypeId::Name)
    63 , mName(name.getName())
    64 , mNegated(name.isNegated())
    65 , mType(name.getType()) {
    6654
    6755}
  • icGREP/icgrep-devel/icgrep/re/re_re.h

    r4203 r4206  
    5252    }
    5353    typedef std::initializer_list<RE *> InitializerList;
    54     virtual RE * clone() const = 0;
    5554    virtual ~RE() = 0;
    5655protected:
     
    6160    const ClassTypeId mClassTypeId;
    6261};
    63 
    64 //template <typename To, typename From>
    65 //inline static bool isa(const From * object) {
    66 //    return To::classof(object);
    67 //}
    68 
    69 //template <typename To, typename From>
    70 //inline static To * dyn_cast(From * object) {
    71 //    if (isa<To, From>(object)) {
    72 //        return reinterpret_cast<To *>(object);
    73 //    }
    74 //    return nullptr;
    75 //}
    7662
    7763class Vector : public RE, public std::vector<RE*> {
     
    9379    , std::vector<RE*>(begin, end) {
    9480
    95     }
    96     inline Vector(const ClassTypeId id, const const_iterator begin, const const_iterator end, const bool deep_copy)
    97     : RE(id) {
    98         assert (deep_copy && "Not intended as a shallow copy constructor.");
    99         this->resize(std::distance(begin, end));
    100         for (auto i = begin; i != end; ++i) {
    101             this->assign(std::distance(begin, i), (*i)->clone());
    102         }
    10381    }
    10482};
  • icGREP/icgrep-devel/icgrep/re/re_rep.h

    r4203 r4206  
    2020        return false;
    2121    }
    22     virtual RE * clone() const {
    23         return new Rep(*this);
    24     }
    2522    enum { UNBOUNDED_REP = -1 };
    2623    RE * getRE() const;
     
    3431    friend RE * makeRep(RE *, const int, const int);
    3532    Rep(RE * re, const int lb, const int ub);
    36     Rep(const Rep & rep);
    3733private:
    3834    RE* mRE;
     
    4642, mLB(lb)
    4743, mUB(ub)
    48 {
    49 
    50 }
    51 
    52 inline Rep::Rep(const Rep & rep)
    53 : RE(ClassTypeId::Rep)
    54 , mRE(rep.getRE()->clone())
    55 , mLB(rep.getLB())
    56 , mUB(rep.getUB())
    5744{
    5845
  • icGREP/icgrep-devel/icgrep/re/re_seq.h

    r4203 r4206  
    2222        return false;
    2323    }
    24     virtual RE * clone() const {
    25         return new Seq(*this);
    26     }
    2724    enum class Type {
    2825        Normal
     
    4340    : Vector(ClassTypeId::Seq)
    4441    , mType(type) {
    45 
    46     }
    47     Seq(const Seq & seq)
    48     : Vector(ClassTypeId::Seq, seq.cbegin(), seq.cend(), true)
    49     , mType(seq.mType) {
    5042
    5143    }
  • icGREP/icgrep-devel/icgrep/re/re_start.h

    r4194 r4206  
    2222        return false;
    2323    }
    24     virtual RE * clone() const {
    25         return new Start();
    26     }
    2724protected:
    2825    friend Start * makeStart();
Note: See TracChangeset for help on using the changeset viewer.