Ignore:
Timestamp:
Sep 27, 2014, 11:12:13 PM (5 years ago)
Author:
nmedfort
Message:

Modified RE module to use a LLVM-like dyn_cast system; added 'make' functions to hide RE constructors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/printer_re.cpp

    r4187 r4194  
    1717#include "re/re_start.h"
    1818
     19using namespace re;
    1920
    2021const std::string Printer_RE::PrintRE(const RE * re)
     
    2526        retVal = "--> RE NullPtr! <--";
    2627    }
    27     else if (const Alt* re_alt = dynamic_cast<const Alt*>(re))
     28    else if (const Alt* re_alt = dyn_cast<const Alt>(re))
    2829    {
    2930        retVal += "(Alt[";
     
    3839        retVal += "])";
    3940    }
    40     else if (const CC* re_cc = dynamic_cast<const CC*>(re))
     41    else if (const CC* re_cc = dyn_cast<const CC>(re))
    4142    {
    4243        retVal = "CC \"";
     
    5253        }
    5354    }
    54     else if (const Name* re_name = dynamic_cast<const Name*>(re))
     55    else if (const Name* re_name = dyn_cast<const Name>(re))
    5556    {
    5657        retVal = "Name \"";
     
    5859        retVal += "\" ";
    5960    }
    60     else if (dynamic_cast<const End*>(re))
     61    else if (isa<const End>(re))
    6162    {
    6263        retVal = "End";
    6364    }
    64     else if (const Rep* re_rep = dynamic_cast<const Rep*>(re))
     65    else if (const Rep* re_rep = dyn_cast<const Rep>(re))
    6566    {
    6667        retVal = "Rep(";
     
    7778        retVal.append(")");
    7879    }
    79     else if (const Seq* re_seq = dynamic_cast<const Seq*>(re))
     80    else if (const Seq* re_seq = dyn_cast<const Seq>(re))
    8081    {
    8182        retVal = "(Seq[";
     
    9091        retVal.append("])");
    9192    }
    92     else if (dynamic_cast<const Start*>(re))
     93    else if (isa<const Start>(re))
    9394    {
    9495        retVal = "Start";
Note: See TracChangeset for help on using the changeset viewer.