Ignore:
Timestamp:
Oct 16, 2014, 3:47:48 PM (5 years ago)
Author:
lindanl
Message:

Change PabloE to PabloAST.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/printer_pablos.cpp

    r4220 r4244  
    1717
    1818//Pablo Expressions
    19 #include <pablo/pe_pabloe.h>
     19#include <pablo/pabloAST.h>
    2020#include <pablo/pe_advance.h>
    2121#include <pablo/pe_all.h>
     
    6868}
    6969
    70 std::string StatementPrinter::ShowPabloS(const PabloE * stmt)
     70std::string StatementPrinter::ShowPabloS(const PabloAST * stmt)
    7171{
    7272    std::string retVal = "";
     
    7474    if (const Assign * an = dyn_cast<const Assign>(stmt))
    7575    {
    76         retVal = "Assign('" + an->getName() + "', " + ShowPabloE(an->getExpr()) + "),";
     76        retVal = "Assign('" + an->getName() + "', " + ShowPabloAST(an->getExpr()) + "),";
    7777    }
    7878    else if (const If * ifstmt = dyn_cast<const If>(stmt))
    7979    {
    80         retVal = "If(" + ShowPabloE(ifstmt->getCondition()) + ", " + Print_PB_PabloStmts(ifstmt->getBody(), retVal) + ")";
     80        retVal = "If(" + ShowPabloAST(ifstmt->getCondition()) + ", " + Print_PB_PabloStmts(ifstmt->getBody(), retVal) + ")";
    8181    }
    8282    else if (const While * whl = dyn_cast<const While>(stmt))
    8383    {
    84         retVal = "While(" + ShowPabloE(whl->getCondition()) + ", " + Print_PB_PabloStmts(whl->getBody(), retVal) + ")";
     84        retVal = "While(" + ShowPabloAST(whl->getCondition()) + ", " + Print_PB_PabloStmts(whl->getBody(), retVal) + ")";
    8585    }
    8686    else retVal = "UNKNOWN_STATEMENT_TYPE!!!";
     
    8888}
    8989
    90 std::string StatementPrinter::ShowPabloE(const PabloE *expr)
     90std::string StatementPrinter::ShowPabloAST(const PabloAST *expr)
    9191{
    9292    std::string retVal = "";
     
    106106    else if (const And * pablo_and = dyn_cast<const And>(expr))
    107107    {
    108         retVal = "And(" + ShowPabloE(pablo_and->getExpr1()) +", " + ShowPabloE(pablo_and->getExpr2()) + ")";
     108        retVal = "And(" + ShowPabloAST(pablo_and->getExpr1()) +", " + ShowPabloAST(pablo_and->getExpr2()) + ")";
    109109    }
    110110    else if (const Or * pablo_or = dyn_cast<const Or>(expr))
    111111    {
    112         retVal = "Or(" + ShowPabloE(pablo_or->getExpr1()) + ", " + ShowPabloE(pablo_or->getExpr2()) + ")";
     112        retVal = "Or(" + ShowPabloAST(pablo_or->getExpr1()) + ", " + ShowPabloAST(pablo_or->getExpr2()) + ")";
    113113    }
    114114    else if (const Sel * pablo_sel = dyn_cast<const Sel>(expr))
    115115    {
    116         retVal = "((" + ShowPabloE(pablo_sel->getCondition()) + "And " + ShowPabloE(pablo_sel->getTrueExpr()) +
    117                 ")|(Not(" + ShowPabloE(pablo_sel->getCondition()) + ") And " + ShowPabloE(pablo_sel->getFalseExpr()) + ")";
     116        retVal = "((" + ShowPabloAST(pablo_sel->getCondition()) + "And " + ShowPabloAST(pablo_sel->getTrueExpr()) +
     117                ")|(Not(" + ShowPabloAST(pablo_sel->getCondition()) + ") And " + ShowPabloAST(pablo_sel->getFalseExpr()) + ")";
    118118    }
    119119    else if (const Not * pablo_not = dyn_cast<const Not>(expr))
    120120    {
    121         retVal = "Not (" + ShowPabloE(pablo_not->getExpr()) + ")";
     121        retVal = "Not (" + ShowPabloAST(pablo_not->getExpr()) + ")";
    122122    }
    123123    else if (const CharClass * cc = dyn_cast<const CharClass>(expr))
     
    127127    else if (const Advance * adv = dyn_cast<const Advance>(expr))
    128128    {
    129         retVal = "Advance(" + ShowPabloE(adv->getExpr()) + ")";
     129        retVal = "Advance(" + ShowPabloAST(adv->getExpr()) + ")";
    130130    }
    131131    else if (const MatchStar * mstar = dyn_cast<const MatchStar>(expr))
    132132    {
    133         retVal = "MatchStar (" + ShowPabloE(mstar->getExpr1()) + ", " + ShowPabloE(mstar->getExpr2()) + ")";
     133        retVal = "MatchStar (" + ShowPabloAST(mstar->getExpr1()) + ", " + ShowPabloAST(mstar->getExpr2()) + ")";
    134134    }
    135135    else if (const ScanThru * sthru = dyn_cast<const ScanThru>(expr))
    136136    {
    137         retVal = "ScanThru (" + ShowPabloE(sthru->getScanFrom()) + ", " + ShowPabloE(sthru->getScanThru()) + ")";
     137        retVal = "ScanThru (" + ShowPabloAST(sthru->getScanFrom()) + ", " + ShowPabloAST(sthru->getScanThru()) + ")";
    138138    }
    139139    else retVal = "UNKNOWN_Pablo_EXPRESSION_TYPE!!!";
Note: See TracChangeset for help on using the changeset viewer.