Skip to content

Commit

Permalink
временно удалила getNFA из taskGenerator (№352)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathhyyn committed Jun 23, 2024
1 parent 0648782 commit cdcaf86
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/automaton_parser/grammar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ stack_pushes --> stack_symbol stack_pushes | EPS ;
node_id --> STRING ;
cell_id --> NUMBER ;
symbol --> (MFA ? '&' cell_id | eps_symbol : eps_symbol) ;
eps_symbol --> (DFA ? LETTER | DIGIT : 'eps' | LETTER | DIGIT)
eps_symbol --> (DFA ? LETTER : 'eps' | LETTER)
14 changes: 8 additions & 6 deletions libs/InputGenerator/src/TasksGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,15 @@ string TasksGenerator::generate_arguments(Function first_func) {
args_str += " N" + get_random_id_by_type(input_type);
/* генерируемые типы: */
} else if (input_type == NFA) {
std::string filename = std::to_string(automata_id++) + ".txt";
AutomatonGenerator(FA_type::NFA).write_to_file(filename);
args_str += " (getNFA \"" + filename + "\")";
args_str += " *NFA";
// std::string filename = std::to_string(automata_id++) + ".txt";
// AutomatonGenerator(FA_type::NFA).write_to_file(filename);
// args_str += " (getNFA \"" + filename + "\")";
} else if (input_type == MFA) {
std::string filename = std::to_string(automata_id++) + ".txt";
AutomatonGenerator(FA_type::MFA).write_to_file(filename);
args_str += " (getMFA \"" + filename + "\")";
args_str += " *MFA";
// std::string filename = std::to_string(automata_id++) + ".txt";
// AutomatonGenerator(FA_type::MFA).write_to_file(filename);
// args_str += " (getMFA \"" + filename + "\")";
} else if (input_type == REGEX) {
args_str += " " + generate_regex();
} else if (input_type == BRefRegex) {
Expand Down
8 changes: 6 additions & 2 deletions libs/Interpreter/src/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,12 @@ optional<GeneralObject> Interpreter::eval_expression(const Expression& expr) {
current_random_objects[expr.type] = generated_object;
return ObjectBRefRegex(BackRefRegex(generated_object));
}
std::string test_path =
"./test_data/MetamorphicTest/test" + Typization::types_to_string.at(expr.type) + ".txt";
std::string test_path;
if (user_name == "")
test_path = "./test_data/MetamorphicTest";
else
test_path = user_name;
test_path += "/" + Typization::types_to_string.at(expr.type) + ".txt";
Parser parser;
if (expr.type == ObjectType::RandomDFA) {
if (!(in_verification && current_random_objects.count(expr.type))) {
Expand Down

0 comments on commit cdcaf86

Please sign in to comment.