Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Доработка доменной модели кодогенерации #31

Open
Stepami opened this issue Mar 26, 2023 · 1 comment
Labels
architecture invalid This doesn't seem right

Comments

@Stepami
Copy link
Owner

Stepami commented Mar 26, 2023

Сейчас доменная модель чётко сформулирована только для фронтенда интерпретатора.
Как только дело доходит до AST, нарушается SRP.

Дело в том, что дерево помимо хранения синтаксической структуры программы, даёт возможность получения инструкций:

public interface IAbstractSyntaxTree
{
    AddressedInstructions GetInstructions();
}

Процесс кодогенерации с проверкой корректности семантики программы не является ответственностью дерева.
Также, контракт не подразумевает доступа к узлам через корень, что довольно странно.

@Stepami Stepami added the invalid This doesn't seem right label Mar 26, 2023
@Stepami
Copy link
Owner Author

Stepami commented Mar 26, 2023

Также у виртуальной машины отсутствует какой-либо контракт операций.
По сути, это просто группа различных стеков для выполнения инструкций.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant