source: icGREP/icgrep-devel/icgrep/re_simplifier.h @ 3998

Last change on this file since 3998 was 3935, checked in by daled, 5 years ago

The parser is now able to parse unicode categories.

File size: 891 bytes
Line 
1#ifndef RE_SIMPLIFIER_H
2#define RE_SIMPLIFIER_H
3
4//Regular Expressions
5#include "re_re.h"
6#include "re_cc.h"
7#include "re_name.h"
8#include "re_start.h"
9#include "re_end.h"
10#include "re_seq.h"
11#include "re_alt.h"
12#include "re_rep.h"
13
14#include <algorithm>
15#include <list>
16
17class RE_Simplifier
18{
19public:
20    static RE* mkSeq(Seq::Type type, std::list<RE*>* re_list);
21    static RE* mkRep(RE* re, int lb2, int ub2);
22    static RE* mkAlt(std::list<RE*>* re_list);
23    static RE* simplify(RE* re);
24private:
25    static std::list<RE*>* mkSeqList(std::list<RE*>* re_list);
26    static std::list<RE*>* mkSeqList_helper(std::list<RE*>* ret_list, std::list<RE*>* re_list);
27    static std::list<RE*>* mkAltList(std::list<RE*>* re_list);
28    static std::list<RE*>* mkAltList_helper(std::list<RE*>* ret_list, std::list<RE*>* re_list);
29    static int ubCombine(int h1, int h2);
30};
31
32#endif // RE_SIMPLIFIER_H
Note: See TracBrowser for help on using the repository browser.