source: icGREP/icgrep-devel/icgrep/re/parse_fixed_strings.cpp @ 5787

Last change on this file since 5787 was 5787, checked in by cameron, 9 months ago

RE parser restructuring; parsing symbolic ranges, collation and equivalence exprs

File size: 731 bytes
Line 
1/*
2 *  Copyright (c) 2017 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#include <re/re_parser.h>
8#include <re/parse_fixed_strings.h>
9#include <re/re_alt.h>
10#include <re/re_seq.h>
11
12namespace re {
13
14RE * FixedStringParser::parse_alt() {
15    std::vector<RE *> alt;
16    do {
17        alt.push_back(parse_seq());
18    }
19    while (accept('\n'));
20    return makeAlt(alt.begin(), alt.end());
21}
22
23RE * FixedStringParser::parse_seq() {
24    std::vector<RE *> seq;
25    while (mCursor.more() && (!at('\n'))) {
26        seq.push_back(createCC(parse_literal_codepoint()));
27    }
28    return makeSeq(seq.begin(), seq.end());
29}
30
31}
Note: See TracBrowser for help on using the repository browser.