Ignore:
Timestamp:
Mar 29, 2018, 11:24:15 AM (13 months ago)
Author:
cameron
Message:

Multithreaded simple RE mode initial check-in

File:
1 moved

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/collect_ccs.cpp

    r5933 r5934  
    1 #include "re_collect_unicodesets.h"
     1#include "collect_ccs.h"
     2#include <cc/alphabet.h>
    23#include <re/re_name.h>
    34#include <re/re_any.h>
     
    2122    void collect(RE * const re);
    2223public:
    23     std::vector<const CC *> UnicodeSets;
     24    const cc::Alphabet * alphabet;
     25    std::vector<CC *> theSets;
    2426    boost::container::flat_set<const RE *>  Visited;
    2527    std::set<Name *> ignoredExternals;
     
    3032    if (Visited.insert(re).second) {
    3133        if (CC * cc = dyn_cast<CC>(re)) {
    32             if (cc->getAlphabet() == &cc::Unicode) {
    33                 const auto index = find(UnicodeSets.begin(), UnicodeSets.end(), cc) - UnicodeSets.begin();
    34                 if (index == UnicodeSets.size()) UnicodeSets.push_back(cc);
     34            if (cc->getAlphabet() == alphabet) {
     35                const auto index = find(theSets.begin(), theSets.end(), cc) - theSets.begin();
     36                if (index == theSets.size()) theSets.push_back(cc);
    3537            }
    3638        } else if (isa<Name>(re)) {
     
    6163}
    6264
    63 std::vector<const CC *> collectUnicodeSets(RE * const re, std::set<Name *> external) {
     65std::vector<CC *> collectCCs(RE * const re, const cc::Alphabet * a, std::set<Name *> external) {
    6466    SetCollector collector;
     67    collector.alphabet = a;
    6568    collector.ignoredExternals = external;
    6669    collector.collect(re);
    67     return collector.UnicodeSets;
     70    return collector.theSets;
    6871}
    6972
Note: See TracChangeset for help on using the changeset viewer.