Ignore:
Timestamp:
Jul 31, 2014, 11:07:49 AM (5 years ago)
Author:
daled
Message:

The parser is now able to parse unicode categories.

File:
1 edited

Legend:

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

    r3917 r3935  
    2020    else if (Seq* re_seq = dynamic_cast<Seq*>(re))
    2121    {
    22         std::list<RE*> re_list;
    23         std::list<RE*>::iterator it;
     22/*
     23        if (re_seq->getType() == Seq::Byte)
     24        {
     25            //If this is a sequence of byte classes then this is a multibyte sequence for a Unicode character class.
     26            std::string seqname = re_seq->getName();
     27            re_map.insert(make_pair(seqname, re_seq));
     28            retVal = new Name(seqname);
     29        }
     30        else
     31        {
     32*/
     33            std::list<RE*> re_list;
     34            std::list<RE*>::iterator it;
    2435
    25         for (it = re_seq->GetREList()->begin(); it != re_seq->GetREList()->end(); ++it)
    26         {
    27             re_list.push_front(reduce(*it, re_map));
    28         }
     36            for (it = re_seq->GetREList()->begin(); it != re_seq->GetREList()->end(); ++it)
     37            {
     38                re_list.push_front(reduce(*it, re_map));
     39            }
    2940
    30         retVal = new Seq(&re_list);
     41            retVal = new Seq(&re_list);
     42//        }
    3143    }
    3244    else if (Rep* re_rep = dynamic_cast<Rep*>(re))
     
    4254        retVal = new Name(ccname);
    4355    }
     56    else if (Name* re_name = dynamic_cast<Name*>(re))
     57    {
     58        retVal = new Name(re_name->getName());
     59    }
    4460    else if (Start* re_start = dynamic_cast<Start*>(re))
    4561    {
Note: See TracChangeset for help on using the changeset viewer.