Changeset 5753 for icGREP/icgrep-devel


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

Parser for fixed strings (-F) mode

Location:
icGREP/icgrep-devel/icgrep
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5734 r5753  
    9595add_library(PabloADT ${PABLO_SRC})
    9696add_library(RegExpADT re/re_re.cpp re/re_cc.cpp re/re_rep.cpp re/re_diff.cpp re/re_intersect.cpp re/re_assertion.cpp re/printer_re.cpp)
    97 add_library(RegExpCompiler re/re_parser.cpp re/re_memoizer.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_star_normal.cpp re/re_minimizer.cpp re/re_local.cpp re/re_compiler.cpp re/re_analysis.cpp re/re_toolchain.cpp re/re_name_resolve.cpp re/re_name_gather.cpp re/re_collect_unicodesets.cpp re/re_multiplex.cpp re/re_parser_pcre.cpp re/re_parser_ere.cpp re/re_parser_bre.cpp re/re_parser_prosite.cpp re/re_utility.cpp ${GREP_CORE_SRC})
     97add_library(RegExpCompiler re/re_parser.cpp re/re_memoizer.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_star_normal.cpp re/re_minimizer.cpp re/re_local.cpp re/re_compiler.cpp re/re_analysis.cpp re/re_toolchain.cpp re/re_name_resolve.cpp re/re_name_gather.cpp re/re_collect_unicodesets.cpp re/re_multiplex.cpp re/re_parser_pcre.cpp re/re_parser_ere.cpp re/re_parser_bre.cpp re/re_parser_prosite.cpp re/parse_fixed_strings.cpp re/re_utility.cpp ${GREP_CORE_SRC})
    9898add_library(CCADT cc/cc_compiler.cpp utf8_encoder.cpp utf16_encoder.cpp UCD/CaseFolding.cpp cc/alphabet.cpp cc/multiplex_CCs.cpp)
    9999add_library(UCDlib UCD/unicode_set.cpp UCD/ucd_compiler.cpp UCD/PropertyObjects.cpp UCD/resolve_properties.cpp)
  • icGREP/icgrep-devel/icgrep/grep_interface.cpp

    r5732 r5753  
    249249    }
    250250   
    251     if (RegexpSyntax == re::RE_Syntax::FixedStrings) {
    252         llvm::report_fatal_error("Sorry, FixedStrings syntax is not fully supported.\n");
    253     }
    254251    if (TextFlag) {
    255252        if (BinaryNonMatchingFlag || (BinaryFilesFlag == WithoutMatch)) {
  • 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.