|
| Pattern () |
| Construct an unset pattern. More...
|
|
| Pattern (const char *regex, const char *options=NULL) |
| Construct a pattern object given a regex string. More...
|
|
| Pattern (const char *regex, const std::string &options) |
| Construct a pattern object given a regex string. More...
|
|
| Pattern (const std::string ®ex, const char *options=NULL) |
| Construct a pattern object given a regex string. More...
|
|
| Pattern (const std::string ®ex, const std::string &options) |
| Construct a pattern object given a regex string. More...
|
|
| Pattern (const Opcode *code, const uint8_t *pred=NULL) |
| Construct a pattern object given an opcode table. More...
|
|
| Pattern (FSM fsm, const uint8_t *pred=NULL) |
| Construct a pattern object given a function pointer to FSM code. More...
|
|
virtual | ~Pattern () |
| Destructor, deletes internal code array when owned and allocated. More...
|
|
void | clear () |
| Clear and delete pattern data. More...
|
|
Pattern & | assign (const char *regex, const char *options=NULL) |
| Assign a (new) pattern. More...
|
|
Pattern & | assign (const char *regex, const std::string &options) |
| Assign a (new) pattern. More...
|
|
Pattern & | assign (const std::string ®ex, const char *options=NULL) |
| Assign a (new) pattern. More...
|
|
Pattern & | assign (const std::string ®ex, const std::string &options) |
| Assign a (new) pattern. More...
|
|
Pattern & | assign (const Opcode *code, const uint8_t *pred=NULL) |
| Assign a (new) pattern. More...
|
|
Pattern & | assign (FSM fsm, const uint8_t *pred=NULL) |
| Assign a (new) pattern. More...
|
|
Pattern & | operator= (const Pattern &pattern) |
| Assign a (new) pattern. More...
|
|
Pattern & | operator= (const char *regex) |
| Assign a (new) pattern. More...
|
|
Pattern & | operator= (const std::string ®ex) |
| Assign a (new) pattern. More...
|
|
Pattern & | operator= (const Opcode *code) |
| Assign a (new) pattern. More...
|
|
Pattern & | operator= (FSM fsm) |
| Assign a (new) pattern. More...
|
|
Index | size () const |
| Number of subpatterns of this pattern object. More...
|
|
const std::string | operator[] (Index choice) const |
| Get subpattern regex of this pattern object or the whole regex with index 0. More...
|
|
bool | reachable (Index choice) const |
| Check is subpattern is reachable by a match. More...
|
|
size_t | nodes () const |
| Get the number of finite state machine nodes (vertices). More...
|
|
size_t | edges () const |
| Get the number of finite state machine edges (transitions on input characters). More...
|
|
size_t | words () const |
| Get the code size in number of words. More...
|
|
float | parse_time () const |
| Get elapsed regex parsing and analysis time. More...
|
|
float | nodes_time () const |
| Get elapsed DFA vertices construction time. More...
|
|
float | edges_time () const |
| Get elapsed DFA edges construction time. More...
|
|
float | words_time () const |
| Get elapsed code words assembly time. More...
|
|
|
enum | Meta {
META_MIN = 0x100,
META_NWB = 0x101,
META_NWE = 0x102,
META_BWB = 0x103,
META_EWB = 0x104,
META_BWE = 0x105,
META_EWE = 0x106,
META_BOL = 0x107,
META_EOL = 0x108,
META_BOB = 0x109,
META_EOB = 0x10A,
META_UND = 0x10B,
META_IND = 0x10C,
META_DED = 0x10D,
META_MAX
} |
| Meta characters. More...
|
|
typedef unsigned int | Char |
|
typedef ORanges< Char > | Chars |
| represent char (0-255 + meta chars) set as a set of ranges More...
|
|
typedef size_t | Location |
|
typedef ORanges< Location > | Locations |
|
typedef std::set< Location > | Set |
|
typedef std::map< int, Locations > | Map |
|
typedef std::set< Position > | Positions |
|
typedef std::map< Position, Positions > | Follow |
|
typedef std::pair< Chars, Positions > | Move |
|
typedef std::list< Move > | Moves |
|
|
void | init (const char *options, const uint8_t *pred=NULL) |
| Initialize the pattern at construction. More...
|
|
void | init_options (const char *options) |
|
void | parse (Positions &startpos, Follow &followpos, Map &modifiers, Map &lookahead) |
|
void | parse1 (bool begin, Location &loc, Positions &firstpos, Positions &lastpos, bool &nullable, Follow &followpos, Positions &lazypos, Map &modifiers, Locations &lookahead, Index &iter) |
|
void | parse2 (bool begin, Location &loc, Positions &firstpos, Positions &lastpos, bool &nullable, Follow &followpos, Positions &lazypos, Map &modifiers, Locations &lookahead, Index &iter) |
|
void | parse3 (bool begin, Location &loc, Positions &firstpos, Positions &lastpos, bool &nullable, Follow &followpos, Positions &lazypos, Map &modifiers, Locations &lookahead, Index &iter) |
|
void | parse4 (bool begin, Location &loc, Positions &firstpos, Positions &lastpos, bool &nullable, Follow &followpos, Positions &lazypos, Map &modifiers, Locations &lookahead, Index &iter) |
|
void | parse_esc (Location &loc) const |
|
void | compile (State &start, Follow &followpos, const Map &modifiers, const Map &lookahead) |
|
void | lazy (const Positions &lazypos, Positions &pos) const |
|
void | lazy (const Positions &lazypos, const Positions &pos, Positions &pos1) const |
|
void | greedy (Positions &pos) const |
|
void | trim_lazy (Positions &pos) const |
|
void | compile_transition (State *state, Follow &followpos, const Map &modifiers, const Map &lookahead, Moves &moves) const |
|
void | transition (Moves &moves, const Chars &chars, const Positions &follow) const |
|
Char | compile_esc (Location loc, Chars &chars) const |
|
void | compile_list (Location loc, Chars &chars, const Map &modifiers) const |
|
void | posix (size_t index, Chars &chars) const |
|
void | flip (Chars &chars) const |
|
void | assemble (State &start) |
|
void | compact_dfa (State &start) |
|
void | encode_dfa (State &start) |
|
void | gencode_dfa (const State &start) const |
|
void | gencode_dfa_closure (FILE *fd, const State *start, int nest) const |
|
void | delete_dfa (State &start) |
|
void | export_dfa (const State &start) const |
|
void | export_code () const |
|
void | predict_match_dfa (State &start) |
|
void | gen_predict_match (State *state) |
|
void | gen_predict_match_transitions (State *state, std::map< State *, ORanges< Char > > &states) |
|
void | gen_predict_match_transitions (Index level, State *state, ORanges< Char > &labels, std::map< State *, ORanges< Char > > &states) |
|
void | write_predictor (FILE *fd) const |
|
void | write_namespace_open (FILE *fd) const |
|
void | write_namespace_close (FILE *fd) const |
|
Location | find_at (Location loc, char c) const |
|
Char | at (Location k) const |
|
bool | eq_at (Location loc, const char *s) const |
|
Char | escape_at (Location loc) const |
|
Char | escapes_at (Location loc, const char *escapes) const |
|
|
static bool | is_modified (Char mode, const Map &modifiers, Location loc) |
|
static void | update_modified (Char mode, Map &modifiers, Location from, Location to) |
|
static bool | is_meta (Char c) |
|
static Opcode | opcode_take (Index index) |
|
static Opcode | opcode_redo () |
|
static Opcode | opcode_tail (Index index) |
|
static Opcode | opcode_head (Index index) |
|
static Opcode | opcode_goto (Char lo, Char hi, Index index) |
|
static Opcode | opcode_halt () |
|
static bool | is_opcode_redo (Opcode opcode) |
|
static bool | is_opcode_take (Opcode opcode) |
|
static bool | is_opcode_tail (Opcode opcode) |
|
static bool | is_opcode_head (Opcode opcode) |
|
static bool | is_opcode_halt (Opcode opcode) |
|
static bool | is_opcode_meta (Opcode opcode) |
|
static bool | is_opcode_meta (Opcode opcode, Char a) |
|
static bool | is_opcode_match (Opcode opcode, unsigned char c) |
|
static Char | meta_of (Opcode opcode) |
|
static Char | lo_of (Opcode opcode) |
|
static Char | hi_of (Opcode opcode) |
|
static Index | index_of (Opcode opcode) |
|
static Char | lowercase (Char c) |
|
static Char | uppercase (Char c) |
|
static Char | reversecase (Char c) |
|
static Hash | hash (Hash h1, Hash h2) |
|
static Hash | hash (Hash h) |
|
Pattern class holds a regex pattern and its compiled FSM opcode table or code for the reflex::Matcher engine.
More info TODO