Skip to content

Commit

Permalink
(#318) Пеарсер автоматов теперь в интерпретаторе
Browse files Browse the repository at this point in the history
  • Loading branch information
Robby-the-paladin committed Jan 22, 2024
1 parent 4fa1cfc commit c351425
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/AutomataParser/include/AutomataParser/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Parser {

public:
// Разбор MFA из файла
statiс MemoryFiniteAutomaton parse_MFA(std::string filename);
static MemoryFiniteAutomaton parse_MFA(std::string filename);

// Разбор FA из файла
static FiniteAutomaton parse_FA(std::string filename);
Expand Down
1 change: 1 addition & 0 deletions libs/Interpreter/include/Interpreter/Interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "Objects/MemoryFiniteAutomaton.h"
#include "Objects/Regex.h"
#include "Objects/TransformationMonoid.h"
#include "AutomataParser/Parser.h"

using namespace Typization; // NOLINT(build/namespaces)
using namespace FuncLib; // NOLINT(build/namespaces)
Expand Down
4 changes: 2 additions & 2 deletions libs/Interpreter/src/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ optional<GeneralObject> Interpreter::apply_function(const Function& function,
}
if (function.name == "getNFA") {
string filename = get<ObjectString>(arguments[0]).value;
return ObjectNFA(FiniteAutomaton());
return ObjectNFA(Parser::parse_FA(filename));
}
if (function.name == "getMFA") {
string filename = get<ObjectString>(arguments[0]).value;
return ObjectMFA(MemoryFiniteAutomaton());
return ObjectMFA(Parser::parse_MFA(filename));
}
// # place for another diff types funcs

Expand Down

0 comments on commit c351425

Please sign in to comment.