Ignore:
Timestamp:
Dec 2, 2017, 6:06:01 PM (21 months ago)
Author:
cameron
Message:

Parser for fixed strings (-F) mode

File:
1 edited

Legend:

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

    r5752 r5753  
    1111#include <re/re_parser_bre.h>
    1212#include <re/re_parser_prosite.h>
     13#include <re/parse_fixed_strings.h>
    1314#include <re/re_name.h>
    1415#include <re/re_alt.h>
     
    5556            break;
    5657        default:
    57             //TODO handle FixString
    58             ParseFailure("Unsupported RE syntax!");
     58            parser = make_unique<FixedStringParser>(regular_expression);
    5959            break;
    6060    }
     
    102102RE * RE_Parser::parse_alt() {
    103103    std::vector<RE *> alt;
    104     for (;;) {
     104    do {
    105105        alt.push_back(parse_seq());
    106         if (*mCursor != '|') {
    107             break;
    108         }
    109         ++mCursor; // advance past the alternation character '|'
    110     }
     106    }
     107    while (mCursor.more() && (*mCursor == '|'));
    111108    return makeAlt(alt.begin(), alt.end());
    112109}
Note: See TracChangeset for help on using the changeset viewer.