Changeset 4806


Ignore:
Timestamp:
Sep 30, 2015, 8:29:03 AM (2 years ago)
Author:
cameron
Message:

Name expression support now functional.

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

Legend:

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

    r4803 r4806  
    165165                c = (c << 4) | (tolower(buffer[line_pos]) - 'a' + 10);
    166166            }
     167            line_pos++;
    167168        }
    168169        assert(((line_pos - line_start) >= 4) && ((line_pos - line_start) <= 6)); // UCD format 4 to 6 hex digits.
     170#ifndef NDEBUG
     171        std::cerr << "\\N expression found codepoint " << std::hex << c << std::dec << std::endl;
     172#endif
     173       
    169174        mParsedCodePointSet->insert(c);
    170175       
     
    258263            Output output;
    259264            mProcessBlockFcn(basis_bits, output);
    260 
    261265            mMatch_scanner.load_block(output.matches, blk);
    262266            mLineBreak_scanner.load_block(output.LF, blk);
     
    301305        Output output;
    302306        mProcessBlockFcn(basis_bits, output);
    303 
    304307        mLineBreak_scanner.load_block(output.LF, blk);
    305308        mMatch_scanner.load_block(output.matches, blk);
     
    345348    Output output;
    346349    mProcessBlockFcn(basis_bits, output);
    347 
    348350    if (mCountOnlyOption) {
    349351        match_count += bitblock::popcount(match_vector);
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r4803 r4806  
    1616#include <re/re_assertion.h>
    1717#include <re/parsefailure.h>
     18#include <re/printer_re.h>
    1819#include <UCD/resolve_properties.h>
    1920#include <UCD/CaseFolding_txt.h>
     
    552553
    553554    RE * nameRE = parse_RE();
    554 
     555#ifndef NDEBUG
     556    std::cerr << "nameRE:" << std::endl << Printer_RE::PrintRE(nameRE) << std::endl;
     557#endif
    555558    // Reset outer parsing state.
    556559    fModeFlagSet = outerFlags;
     
    561564    RE * embedded = makeSeq({re::makeCC(0x3B), re::makeRep(re::makeAny(), 0, Rep::UNBOUNDED_REP), nameRE});
    562565    Encoding encoding(Encoding::Type::UTF_8, 8);
    563     throw ParseFailure("\\N{...} character name expression recognized but not yet supported.");
    564     // Debugging needed:
     566    embedded = regular_expression_passes(encoding, embedded);
     567#ifndef NDEBUG
     568    std::cerr << "embedded:" << std::endl << Printer_RE::PrintRE(embedded) << std::endl;
     569#endif
    565570    pablo::PabloFunction * nameSearchFunction = re2pablo_compiler(encoding, embedded);
    566571    llvm::Function * nameSearchIR = nullptr;
     
    577582        exit(1);
    578583    }
     584#ifndef NDEBUG
     585    nameSearchIR->dump();
     586#endif
    579587    llvm::ExecutionEngine * engine = JIT_to_ExecutionEngine(nameSearchIR);
    580588   
     
    586594    void * icgrep_MCptr = engine->getPointerToFunction(nameSearchIR);
    587595   
     596    CC * nameSearchResult = nullptr;
    588597    if (icgrep_MCptr) {
    589598        GrepExecutor grepEngine(icgrep_MCptr);
    590599        grepEngine.setParseCodepointsOption();
    591600        grepEngine.doGrep("../Uname.txt");
    592         return grepEngine.getParsedCodepoints();
    593     }
    594     else {
    595         return nullptr;
     601        nameSearchResult = grepEngine.getParsedCodepoints();
    596602    }
    597603   
    598604    //engine->freeMachineCodeForFunction(nameSearchIR); // This function only prints a "not supported" message. Reevaluate with LLVM 3.6.
    599605    delete engine;
     606    return nameSearchResult;
    600607}
    601608
Note: See TracChangeset for help on using the changeset viewer.