Changeset 5218


Ignore:
Timestamp:
Nov 22, 2016, 9:02:01 PM (12 months ago)
Author:
xuedongx
Message:

Add parser for PROSITE protein patterns

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

Legend:

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

    r5217 r5218  
    6464add_library(PabloADT ${PABLO_SRC})
    6565add_library(RegExpADT re/re_re.cpp re/re_cc.cpp re/re_rep.cpp re/re_diff.cpp re/re_intersect.cpp re/printer_re.cpp)
    66 add_library(RegExpCompiler re/re_parser.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_compiler.cpp re/re_analysis.cpp re/re_toolchain.cpp re/re_name_resolve.cpp re/re_parser_pcre.cpp re/re_parser_ere.cpp re/re_parser_bre.cpp re/re_utility.cpp)
     66add_library(RegExpCompiler re/re_parser.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_compiler.cpp re/re_analysis.cpp re/re_toolchain.cpp re/re_name_resolve.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)
    6767add_library(CCADT cc/cc_compiler.cpp utf8_encoder.cpp utf16_encoder.cpp UCD/CaseFolding_txt.cpp)
    6868add_library(UCDlib UCD/unicode_set.cpp UCD/ucd_compiler.cpp UCD/PropertyObjects.cpp UCD/resolve_properties.cpp UCD/UnicodeNameData.cpp)
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5202 r5218  
    4444        clEnumValN(re::RE_Syntax::BRE, "G", "Posix basic regular expression (BRE) syntax"),
    4545        clEnumValN(re::RE_Syntax::ERE, "E", "Posix extended regular expression (ERE) syntax"),
     46        clEnumValN(re::RE_Syntax::PROSITE, "PRO", "PROSITE protein patterns syntax"),
    4647        clEnumValN(re::RE_Syntax::PCRE, "P", "Perl-compatible regular expression (PCRE) syntax - default"),
    4748               clEnumValEnd), cl::cat(LegacyGrepOptions), cl::Grouping, cl::init(re::RE_Syntax::PCRE));
     
    209210bool isArgUnwantedForGrep(char *argument) {
    210211#ifdef FUTURE
    211     std::vector<std::string> unwantedFlags = {"-n", "-P", "-G", "-E"};
     212    std::vector<std::string> unwantedFlags = {"-n", "-P", "-G", "-E", "-PRO"};
    212213#else
    213214    std::vector<std::string> unwantedFlags = {"-n"};
     
    278279        case re::RE_Syntax::ERE:
    279280            grepArguments.append("\"-E\" ");
     281            break;
     282        case re::RE_Syntax::PROSITE:
     283            grepArguments.append("\"-PRO\" ");
    280284            break;
    281285        case re::RE_Syntax::PCRE:
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r5206 r5218  
    1010#include <re/re_parser_ere.h>
    1111#include <re/re_parser_bre.h>
     12#include <re/re_parser_prosite.h>
    1213#include <re/re_name.h>
    1314#include <re/re_alt.h>
     
    4344            parser = llvm::make_unique<RE_Parser_BRE>(regular_expression);
    4445            break;
     46        case RE_Syntax ::PROSITE:
     47            parser = llvm::make_unique<RE_Parser_PROSITE>(regular_expression);
     48            break;
    4549        default:
    4650            //TODO handle FixString
  • icGREP/icgrep-devel/icgrep/re/re_parser.h

    r5206 r5218  
    2121namespace re {
    2222
    23 enum RE_Syntax {FixedStrings, BRE, ERE, PCRE};
     23enum RE_Syntax {FixedStrings, BRE, ERE, PCRE, PROSITE};
    2424enum CharsetOperatorKind
    2525    {intersectOp, setDiffOp, ampChar, hyphenChar, rangeHyphen, posixPropertyOpener, setOpener, setCloser, backSlash, emptyOperator};
     
    119119    virtual RE * parse_RE();
    120120
    121     RE * parse_alt();
     121    virtual RE * parse_alt();
    122122
    123123    virtual RE * parse_alt_with_intersect(RE* reToBeIntersected);
    124124
    125     RE * parse_seq();
     125    virtual RE * parse_seq();
    126126
    127127    RE * parse_seq_with_intersect(RE* reToBeIntersected);
Note: See TracChangeset for help on using the changeset viewer.