Changeset 5728 for icGREP


Ignore:
Timestamp:
Nov 7, 2017, 7:32:13 PM (16 months ago)
Author:
cameron
Message:

The re::Any type now maps to a CC

Location:
icGREP/icgrep-devel/icgrep/re
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_any.h

    r5267 r5728  
    11/*
    2  *  Copyright (c) 2014 International Characters.
     2 *  Copyright (c) 2017 International Characters.
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 *  icgrep is a trademark of International Characters.
     
    99
    1010#include "re_re.h"
     11#include "re_cc.h"
     12#include <UCD/unicode_set.h>
     13#include <llvm/Support/Casting.h>
    1114
    1215namespace re {
     
    1518public:
    1619    static inline bool classof(const RE * re) {
    17         return re->getClassTypeId() == ClassTypeId::Any;
     20        return (re->getClassTypeId() == ClassTypeId::CC) && llvm::cast<CC>(re)->full();
    1821    }
    1922    static inline bool classof(const void *) {
     
    2124    }
    2225protected:
    23     friend Any * makeAny();
    2426    Any() : RE(ClassTypeId::Any) {}
    2527    virtual ~Any() {}
    2628};
    2729
    28 inline Any * makeAny() {
    29     return new Any();
     30inline CC * makeAny() {
     31    return makeCC(0, UCD::UNICODE_MAX);
    3032}
    3133
  • icGREP/icgrep-devel/icgrep/re/re_multiplex.cpp

    r5620 r5728  
    105105            diff->setLH(multiplex(diff->getLH()));
    106106            diff->setRH(multiplex(diff->getRH()));
    107             CC * lh = extractCC(diff->getLH());
    108             CC * rh = extractCC(diff->getRH());
    109             if (lh && rh) {
    110                 return multiplex(makeName("diff", subtractCC(lh, rh)));
    111             }
    112107        } else if (Intersect * ix = dyn_cast<Intersect>(re)) {
    113108            ix->setLH(multiplex(ix->getLH()));
    114109            ix->setRH(multiplex(ix->getRH()));
    115             CC * lh = extractCC(ix->getLH());
    116             CC * rh = extractCC(ix->getRH());
    117             if (lh && rh) {
    118                 return multiplex(makeName("intersect", intersectCC(lh, rh)));
    119             }
    120110        }
    121111        return re;
  • icGREP/icgrep-devel/icgrep/re/re_name_resolve.cpp

    r5646 r5728  
    9191            diff->setLH(resolve(diff->getLH()));
    9292            diff->setRH(resolve(diff->getRH()));
    93             CC * lh = extractCC(diff->getLH());
    94             CC * rh = extractCC(diff->getRH());
    95             if (lh && rh) {
    96                 return resolve(makeName("diff", subtractCC(lh, rh)));
    97             }
    9893        } else if (Intersect * ix = dyn_cast<Intersect>(re)) {
    9994            ix->setLH(resolve(ix->getLH()));
    10095            ix->setRH(resolve(ix->getRH()));
    101             CC * lh = extractCC(ix->getLH());
    102             CC * rh = extractCC(ix->getRH());
    103             if (lh && rh) {
    104                 return resolve(makeName("intersect", intersectCC(lh, rh)));
    105             }
    10696        }
    10797        return re;
Note: See TracChangeset for help on using the changeset viewer.