Ignore:
Timestamp:
Jul 4, 2016, 8:54:48 PM (3 years ago)
Author:
cameron
Message:

Initial support for capture groups/back references; back reference simply repeats regexp

File:
1 edited

Legend:

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

    r4831 r5080  
    2525        , Unicode
    2626        , UnicodeProperty
     27        , Capture
     28        , Reference
    2729        , Unknown
    2830    };
     
    3941protected:
    4042    friend Name * makeName(const std::string & name, RE * cc);
     43    friend Name * makeCapture(const std::string & name, RE * captured);
     44    friend Name * makeReference(const std::string & name, RE * captureName);
    4145    friend Name * makeName(CC * const cc);
    4246    friend Name * makeName(const std::string &, const Type);
     
    156160}
    157161
     162inline Name * makeCapture(const std::string & name, RE * captured) {
     163    return new Name(nullptr, 0, name.c_str(), name.length(), Name::Type::Capture, captured);
     164}
     165   
     166inline Name * makeReference(const std::string & name, RE * captureName) {
     167    return new Name(nullptr, 0, name.c_str(), name.length(), Name::Type::Reference, captureName);
     168}
     169
    158170}
    159171
Note: See TracChangeset for help on using the changeset viewer.