Ignore:
Timestamp:
Jul 21, 2014, 11:49:25 AM (5 years ago)
Author:
cameron
Message:

Updates for icgrep-0.9: re simplifications, re names, replimit mods, debugged while loops

File:
1 edited

Legend:

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

    r3850 r3914  
    77#include "re_parser.h"
    88
    9 RE_Parser::RE_Parser(){}
    109
    1110ParseResult* RE_Parser::parse_re(std::string input_string)
     
    6665    {
    6766        if (form_result.remaining.operator [](0) == '|')
    68         {
     67        {           
    6968            parse_re_list_retVal t1_re_list_retVal =
    7069                    parse_re_alt_form_list(form_result.remaining.substr(1, form_result.remaining.length() - 1));
    71 
    7270            std::list<RE*>::iterator it;
    7371            it=t1_re_list_retVal.re_list.begin();
    7472            re_list_retVal.re_list.assign(it, t1_re_list_retVal.re_list.end());
    75             re_list_retVal.re_list.push_back(re_success->getRE());
    7673            re_list_retVal.remaining = t1_re_list_retVal.remaining;
    7774        }
     
    205202     if (s.operator [](0) == '*')
    206203     {
    207          return extend_item(new Rep(re, 0, new Unbounded), s.substr(1, s.length() - 1));
     204         return extend_item(new Rep(re, 0, unboundedRep), s.substr(1, s.length() - 1));
    208205     }
    209206     else if (s.operator[](0) == '?')
    210207     {
    211          return extend_item(new Rep(re, 0, new UpperBound(1)), s.substr(1, s.length() - 1));
     208         return extend_item(new Rep(re, 0, 1), s.substr(1, s.length() - 1));
    212209     }
    213210     else if (s.operator[](0) == '+')
    214211     {
    215          return extend_item(new Rep(re, 1, new Unbounded), s.substr(1, s.length() - 1));
     212         return extend_item(new Rep(re, 1, unboundedRep), s.substr(1, s.length() - 1));
    216213     }
    217214     else if (s.operator[](0) == '{')
     
    222219        {
    223220            extend_item_retVal =
    224                     extend_item(new Rep(re, int_retVal.i, new UpperBound(int_retVal.i)), int_retVal.remaining.substr(1, int_retVal.remaining.length() - 1));
     221                    extend_item(new Rep(re, int_retVal.i, int_retVal.i), int_retVal.remaining.substr(1, int_retVal.remaining.length() - 1));
    225222
    226223        }
     
    228225        {
    229226            extend_item_retVal =
    230                     extend_item(new Rep(re, int_retVal.i, new Unbounded), int_retVal.remaining.substr(2, int_retVal.remaining.length() - 2));
     227                    extend_item(new Rep(re, int_retVal.i, unboundedRep), int_retVal.remaining.substr(2, int_retVal.remaining.length() - 2));
    231228
    232229        }
     
    238235            {
    239236                extend_item_retVal =
    240                         extend_item(new Rep(re, int_retVal.i, new UpperBound(t1_int_retVal.i)), t1_int_retVal.remaining.substr(1, t1_int_retVal.remaining.length() - 1));
     237                        extend_item(new Rep(re, int_retVal.i, t1_int_retVal.i), t1_int_retVal.remaining.substr(1, t1_int_retVal.remaining.length() - 1));
    241238            }
    242239            else
Note: See TracChangeset for help on using the changeset viewer.