Skip to content

Comments

Recursive Automaton (RSM), CFG in Extended Backus-Naur Form, RPQ algorithm#34

Merged
IlyaMuravjov merged 30 commits intospbu-se:developfrom
AlexShmak:develop
Oct 27, 2025
Merged

Recursive Automaton (RSM), CFG in Extended Backus-Naur Form, RPQ algorithm#34
IlyaMuravjov merged 30 commits intospbu-se:developfrom
AlexShmak:develop

Conversation

@AlexShmak
Copy link
Collaborator

Реализовано:

  • Поддержка рекурсивных автоматов
  • Построение рекурсивного автомата по контекстно-свободной грамматике в расширенной форме Бэкуса-Наура (EBNF)
  • Построение EBNF по рекурсивному автомату
  • Алгоритм RPQ с возможностью пошаговой визуализации выполнения
  • Добавлены локализованные сообщения (messages*.properties)
  • Обновление конфигурации сборки (изменен репозиторий tornadofx)
  • Тестовое покрытие на реализованную функциональность

AlexShmak and others added 18 commits May 26, 2025 04:44
…iews and execution logic for recursive automaton

- Introduce RecursiveAutomatonBox vertex type and HasSubAutomaton interface for vertices containing sub-automaton
- Update Automaton, AutomatonVertexView, AutomatonGraphView, and CentralView to support RecursiveAutomatonBox
- Adjust transition and table views to hide labels for transitions connected to RecursiveAutomatonBox (unchangeable epsilon transitions)
- Refactor execution logic to handle recursion and sub-automaton management
- Extend EBNF grammar handling and export functionality
- Update grammar input and error messages for consistency
- Add tests for EBNF export
…age, update imports and references

test(Recursive Automaton): add unit tests for RecursiveAutomaton and EBNF exporter
@gsvgit gsvgit requested a review from IlyaMuravjov October 1, 2025 07:59
Comment on lines 223 to 233
val srcV = source.vertex
val tgtV = automatonVertexView.vertex
if (srcV is RecursiveAutomatonBox && tgtV is RecursiveAutomatonBox) {
information(
"Transitions between recursive automaton boxes are not allowed",
title = I18N.messages.getString("Dialog.information"),
owner = automatonViewContext.uiComponent.currentWindow
)
} else {
automaton.addTransition(srcV, tgtV)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Этот if выглядит, как часть бизнес логики, которая по возможности должна обрабатываться моделью, а не контроллером. Кажется, конкретное условие логичнее перенести внутрь addTransition() и возвращать из этого метода успешность добавления перехода

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Вынес безопасное создание перехода в helper (TransitionAddUIHelper.kt), который пытается добавить новый переход и выкидывает диалоговое окно в случае неудачи

Copy link
Collaborator

@IlyaMuravjov IlyaMuravjov Oct 25, 2025

Choose a reason for hiding this comment

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

Я имел ввиду, что к бизнес логике относится условие if и его логично перенести внутрь модели. Выносить тела веток if в пакет utils было не надо, utils --- это пакет для не домен-специфичных утилит, но это уже мелочи

Copy link
Collaborator

Choose a reason for hiding this comment

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

Нужно ещё обновить README и добавить видео в Wiki

Copy link
Collaborator

Choose a reason for hiding this comment

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

Отправил приглашение, чтобы были права на редактирование Wiki

Про новые фичи, думаю, надо сделать пометку, что они появятся в релизе 1.3

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Обновил README и Wiki. Не уверен, где лучше указать примечание про фичи -- перечислить в разделе Home или сделать пометки в разделах с соответствующей функциональностью

Copy link
Collaborator

Choose a reason for hiding this comment

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

Я думаю, в разделах с соответствующей функциональностью. Хотя в целом можно и релиз выпустить, тогда не надо будет пометку делать

Copy link
Collaborator

@IlyaMuravjov IlyaMuravjov left a comment

Choose a reason for hiding this comment

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

С точки зрения архитектуры выглядит достаточно хорошо

Отдельное спасибо за за чистую структуру коммитов и следование conventional commits, особенно при исправлении замечаний

@IlyaMuravjov IlyaMuravjov merged commit 2149979 into spbu-se:develop Oct 27, 2025
2 checks passed
IlyaMuravjov pushed a commit that referenced this pull request Oct 31, 2025
…Q algorithm (#34)

* fix(ci): Update actions/cache from v2 to v3

* fix(ci): Update actions/cache from v2 to v3

* feat: Add RecursiveAutomaton type, data class and factory stub

* feat: Add localized messages for RA, transition action for RA, stub for settings creation in RA factory class

* feat: Add stub for CFG to RSA conversion

* feat(view): add grammar input view (EBNFInputView) for RecursiveAutomaton creation, update messages.properties

* feat(view): make separate class for EBNF grammar input view, make EBNF grammar subclass

* feat(view): implement EBNF grammar input view

* feat(view): implement production addition in EBNF grammar and clean up code

* feat(Recursive Automaton): add RecursiveAutomatonBox vertex, update views and execution logic for recursive automaton

- Introduce RecursiveAutomatonBox vertex type and HasSubAutomaton interface for vertices containing sub-automaton
- Update Automaton, AutomatonVertexView, AutomatonGraphView, and CentralView to support RecursiveAutomatonBox
- Adjust transition and table views to hide labels for transitions connected to RecursiveAutomatonBox (unchangeable epsilon transitions)
- Refactor execution logic to handle recursion and sub-automaton management
- Extend EBNF grammar handling and export functionality
- Update grammar input and error messages for consistency
- Add tests for EBNF export

* refactor(grammar): move grammar-related classes to model.grammar package, update imports and references

test(Recursive Automaton): add unit tests for RecursiveAutomaton and EBNF exporter

* feat(RPQ Algorithm): add RPQ algorithm execution view and controller class

* fix(build): change tornadofx repository

* feat(RPQ Algorithm): implement RPQ algorithm and update execution view

* refactor(grammar): refactor EBNF grammar to use RARegex and update related classes

* refactor(i18n): rename Algorithms.Error to FiniteAutomatonOnlyAlgorithm.Error

* fix(AutomatonElement): encapsulate string parsing in DynamicProperty.setFromString to remove unchecked cast

* refactor(i18n): add correct localization via properties bundle

* refactor(RecursiveAutomaton): move recursive automaton and related classes to distinct package

* refactor(AutomatonGraphController): extract recursive automaton context menu construction into function

* feat(test): add recursive automaton file for serialization test

* refactor(Grammar): rename ProductionInterface to Production

* refactor(RecursiveAutomaton): extract all RecursiveAutomaton related logic from AbstractAutomaton

* refactor: implement helper for safe transition addition with dialog window in case of error

* refactor(Transition): make labels on transitions from and to RecursiveAutomatonBox visible but not modifiable

* fix(SteppingStrategy): restore correct `step` function logic

* update README
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