Skip to content

Ярош Антон, гр. 5094 Лабораторная работа 2 - #1938

Open
j4de53 wants to merge 7 commits into
Dovgalyuk:masterfrom
j4de53:lab2
Open

j4de53 wants to merge 7 commits into
Dovgalyuk:masterfrom
j4de53:lab2

Conversation

@j4de53

@j4de53 j4de53 commented Oct 27, 2026

Copy link
Copy Markdown

Реализованы команды и операции стека для лабораторной работы № 2.
Выполнены модули односвязного списка и стека.
Обновлена конфигурация CMake для сборки проекта.
Проверена работа программы на примерах и сценариях с ошибками.

@Dovgalyuk

Copy link
Copy Markdown
Owner

Нужны тесты для контейнеров.

Comment thread Lab2/main.cpp Outdated

class VMStack {
Stack data;
vector<bool> flags;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А нельзя просто взять такой же стек, как для данных?

Comment thread Lab2/main.cpp Outdated

struct Instruction {
string command;
vector<string> args;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У команды может быть больше одного аргумента?

Comment thread Lab2/main.cpp Outdated
data.push(b);
}

vector<Value> values() const {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

стоит сделать typedef.

Comment thread Lab2/CMakeLists.txt Outdated
add_vm_test(variables variables.txt variables.out)
add_vm_test(swap swap.txt swap.out)
add_vm_test(error_return error_return.txt error.out)
add_vm_test(error_address_pop error_address_pop.txt error.out)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не проверяется код возврата или вывод сообщения об ошибке.

Comment thread Lab2/main.cpp
if (empty()) throw runtime_error("Stack is empty");
return { data.get(), flags[0] };

Stack flags_copy = flags;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем копировать весь стек?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants