Ignore:
Timestamp:
Jul 10, 2015, 4:51:39 PM (4 years ago)
Author:
nmedfort
Message:

Initial introduction of a PabloFunction? type.

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

Legend:

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

    r4650 r4657  
    2121#include <cc/cc_namemap.hpp>
    2222#include <pablo/codegenstate.h>
     23#include <pablo/function.h>
    2324#include <resolve_properties.h>
    2425#include <assert.h>
     
    175176}
    176177
    177 void RE_Compiler::finalizeMatchResult(MarkerType match_result) {
     178void RE_Compiler::finalizeMatchResult(PabloFunction & function, MarkerType match_result) {
    178179    //These three lines are specifically for grep.
    179180    PabloAST * lb = UNICODE_LINE_BREAK ? mUnicodeLineBreak : mLineFeed;
    180     PabloAST * v = markerVar(match_result);
    181     mPB.createAssign("matches", mPB.createAnd(mPB.createMatchStar(v, mPB.createNot(lb)), lb), 0);
    182     mPB.createAssign("lf", mPB.createAnd(lb, mPB.createNot(mCRLF)), 1);
     181    PabloAST * v = markerVar(match_result);   
     182    function.addResult(mPB.createAssign("matches", mPB.createAnd(mPB.createMatchStar(v, mPB.createNot(lb)), lb)));
     183    function.addResult(mPB.createAssign("lf", mPB.createAnd(lb, mPB.createNot(mCRLF))));
    183184}
    184185
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r4641 r4657  
    2020class CC_NameMap;
    2121}
     22
     23namespace pablo {
     24class PabloFunction;
     25}
     26
    2227
    2328/*   Marker streams represent the results of matching steps.
     
    5661    RE_Compiler(cc::CC_Compiler & ccCompiler);
    5762    void initializeRequiredStreams();
    58     void finalizeMatchResult(MarkerType match_result);
     63    void finalizeMatchResult(pablo::PabloFunction & function, MarkerType match_result);
    5964    MarkerType compile(RE * re) {
    6065        return compile(re, mPB);
Note: See TracChangeset for help on using the changeset viewer.