Skip to content
Snippets Groups Projects
Forked from Eclipse Projects / aidge / aidge_core
2463 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
StmFactory.hpp 1.35 KiB
/********************************************************************************
 * Copyright (c) 2023 CEA-List
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 ********************************************************************************/

#ifndef AIDGE_STMFACTORY_H_
#define AIDGE_STMFACTORY_H_

#include <map>
#include <utility>
#include <set>
#include <string>
#include <vector>
#include <iostream>
#include <stdexcept>   // for exception, runtime_error, out_of_range
#include <regex>

#include "aidge/graphmatching/NodeRegex.hpp"
#include "aidge/graphmatching/SeqStm.hpp"
#include "aidge/graphmatching/Utile.hpp"

namespace Aidge{



class StmFactory {

    const std::map<std::string,NodeRegex*>& mNodesRegex;
    std::size_t mCmptStm = 0;
public:
    StmFactory(const std::map<std::string,NodeRegex*>& nodesRegex);
    //StmFactory(){};

    SeqStm* makeNewStm(const std::string& sequRegex);
    SeqStm* duplicateStm(SeqStm* stm);

    std::size_t getNumberOfStm(){
        return mCmptStm;
    }
private:

    ParsingReturn initParsingSequRegex(const std::string& sequRegex);

    std::vector<std::vector<int>> initTransitionMatrix(ParsingReturn& parsing);

};
}

#endif //AIDGE_STMFACTORY_H_