Add files via upload

RegEx
This commit is contained in:
multmine1 2025-07-28 00:25:26 +03:00 • committed by GitHub
commit b48d3ec773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 2817 additions and 0 deletions

43
dfa_node.hpp Normal file
View file

@ -0,0 +1,43 @@
//
// dfa_node.hpp
// lab2
//
// Created by Владислав Агибалов on 19.07.2025.
//
#ifndef dfa_node_hpp
#define dfa_node_hpp
#include <stdio.h>
#include "node.hpp"
namespace regex {
class dfa_node: public node{
bool finish_;
std::map<size_t, std::weak_ptr<dfa_node>> next_dfa_states_;
inline static std::shared_ptr<dfa_node> null_node_ = nullptr;
public:
dfa_node();
std::map<size_t, std::weak_ptr<dfa_node>> const& getnextstates() const;
void setFinish(bool);
bool getFinish() const;
void addEdge(size_t, std::weak_ptr<dfa_node>);
std::weak_ptr<dfa_node> operator[](size_t) const;
};
}
#endif /* dfa_node_hpp */