32 lines
505 B
C++
32 lines
505 B
C++
![]() |
#pragma once
|
||
|
#include <variant>
|
||
|
#include <vector>
|
||
|
#include <memory>
|
||
|
#include <string>
|
||
|
#include <string_view>
|
||
|
|
||
|
namespace regular {
|
||
|
class RegularTree {
|
||
|
public:
|
||
|
class Node {
|
||
|
public:
|
||
|
Node();
|
||
|
|
||
|
void Parse(const std::string&);
|
||
|
void Parse(const std::string_view);
|
||
|
|
||
|
enum class Type {
|
||
|
Addition, Concatenation
|
||
|
};
|
||
|
std::variant<std::vector<std::unique_ptr<Node>>, std::string> value;
|
||
|
Type type;
|
||
|
private:
|
||
|
};
|
||
|
|
||
|
RegularTree(const std::string&);
|
||
|
|
||
|
private:
|
||
|
Node node_;
|
||
|
};
|
||
|
}
|