libregexis024/src/libregexis024sol/subexpr_fa_transformed.h

34 lines
1.4 KiB
C++

#ifndef LIBREGEXIS024_SRC_LIBREGEXIS024SOL_SUBEXPR_FA_TRANSFORMED_H
#define LIBREGEXIS024_SRC_LIBREGEXIS024SOL_SUBEXPR_FA_TRANSFORMED_H
#include <libregexis024fa/finite_automaton.h>
namespace regexis024 {
struct SubExprCompiled{
FA_Node* start = NULL;
/* After putting there values from neighbour vectors in nodes, these vectors must not change size */
std::vector<FA_Node**> ends;
bool can_be_empty = true;
void assertDefault();
};
SubExprCompiled subexpr_charset_reading_filter(const codeset_t& codeset, FA_Container& fa);
SubExprCompiled join(const SubExprCompiled& A, const SubExprCompiled& B);
SubExprCompiled forkify(const std::vector<SubExprCompiled>& options, FA_Container& fa);
SubExprCompiled subexpression_from_path(FA_NodePathPart* node);
/* And then Robert Angier said `It's prestige time` and prestiged all over the place.
* If you still don't get it, this function copies section of NFA of regexp */
SubExprCompiled RobertAngier(const SubExprCompiled& source, FA_Container& fa);
#define REGEXIS024_MAX_REPEAT 64
/* pass REGEXIS024_MAX_REPEAT + 1 as max_allowed to allow infinite repeat */
void apply_repeat_to_subexpression(SubExprCompiled& patient, FA_Container& fa, size_t min_allowed, size_t max_allowed);
}
#endif //LIBREGEXIS024_SRC_LIBREGEXIS024SOL_SUBEXPR_FA_TRANSFORMED_H