source: icGREP/icgrep-devel/icgrep/re/re_parser_bre.h

Last change on this file was 5206, checked in by xwa163, 11 months ago
  1. Extend Regex Syntax, include: (a) RL2.6 of UTS#18, support regex in property value. e.g. \p{script=/.*hir.*/} (b) Support syntax of property expression when parsing boundary. e.g. \b{greek} (c) Extend property expression in non capture group. e.g. (?\p{upper}:\p{greek}\p{script=hira})
  2. Add related test cases
File size: 1.2 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef ICGREP_RE_PARSER_BRE_H
8#define ICGREP_RE_PARSER_BRE_H
9
10#include <re/re_parser.h>
11
12namespace re {
13    class RE_Parser_BRE : public RE_Parser  {
14    public:
15        RE_Parser_BRE(const std::string & regular_expression) : RE_Parser(regular_expression) {
16            mReSyntax = RE_Syntax::BRE;
17        }
18
19    protected:
20        virtual bool isSetEscapeChar(char c) override;
21        virtual bool isUnsupportChartsetOperator(char c) override;
22        virtual RE * parse_alt_with_intersect(RE* reToBeIntersected) override;
23        virtual RE * parse_next_item() override ;
24        virtual RE * parse_escaped() override;
25        virtual RE * extend_item(RE * re) override;
26        virtual RE * parse_group() override;
27        virtual std::pair<int, int> parse_range_bound() override;
28        virtual codepoint_t parse_escaped_codepoint() override;
29        virtual RE * parsePropertyExpression() override;
30        virtual RE * parseEscapedSet() override;
31
32    private:
33        bool isEscapedCharAhead(char c);
34
35    };
36}
37
38
39#endif //ICGREP_RE_PARSER_BRE_H
Note: See TracBrowser for help on using the repository browser.