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

Multithreaded simple RE mode initial check-in

Location:
icGREP/icgrep-devel/icgrep/re
Files:
2 added
2 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
  • icGREP/icgrep-devel/icgrep/re/collect_ccs.h

    r5933 r5934  
    1 #ifndef RE_COLLECT_UNICODESETS_H
    2 #define RE_COLLECT_UNICODESETS_H
     1#ifndef COLLECT_CCS_H
     2#define COLLECT_CCS_H
    33
    44#include <vector>
    55#include <set>
    66
     7namespace cc {class Alphabet;}
    78namespace re {
    89
     
    1112    class Name;
    1213
    13     std::vector<const CC *> collectUnicodeSets(RE * const re, std::set<Name *> external = {});
     14    std::vector<CC *> collectCCs(RE * const re, const cc::Alphabet * a, std::set<Name *> external = {});
    1415
    1516}
Note: See TracChangeset for help on using the changeset viewer.