Recursive Automaton (RSM), CFG in Extended Backus-Naur Form, RPQ algorithm#34
Recursive Automaton (RSM), CFG in Extended Backus-Naur Form, RPQ algorithm#34IlyaMuravjov merged 30 commits intospbu-se:developfrom
Conversation
…or settings creation in RA factory class
…aton creation, update messages.properties
…F grammar subclass
…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
RSM, EBNF, RPQ
src/main/kotlin/automaton/constructor/controller/AutomatonGraphController.kt
Show resolved
Hide resolved
src/main/kotlin/automaton/constructor/controller/AutomatonGraphController.kt
Outdated
Show resolved
Hide resolved
| 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) | ||
| } |
There was a problem hiding this comment.
Этот if выглядит, как часть бизнес логики, которая по возможности должна обрабатываться моделью, а не контроллером. Кажется, конкретное условие логичнее перенести внутрь addTransition() и возвращать из этого метода успешность добавления перехода
There was a problem hiding this comment.
Вынес безопасное создание перехода в helper (TransitionAddUIHelper.kt), который пытается добавить новый переход и выкидывает диалоговое окно в случае неудачи
There was a problem hiding this comment.
Я имел ввиду, что к бизнес логике относится условие if и его логично перенести внутрь модели. Выносить тела веток if в пакет utils было не надо, utils --- это пакет для не домен-специфичных утилит, но это уже мелочи
src/main/kotlin/automaton/constructor/controller/AutomatonGraphController.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/automaton/constructor/model/automaton/AbstractAutomaton.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/automaton/constructor/view/elements/transition/AdjacencyMatrixTransitionView.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/automaton/constructor/view/elements/transition/AdjacencyMatrixTransitionView.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/automaton/constructor/controller/algorithms/rpq/RPQAlgoTest.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Нужно ещё обновить README и добавить видео в Wiki
There was a problem hiding this comment.
Отправил приглашение, чтобы были права на редактирование Wiki
Про новые фичи, думаю, надо сделать пометку, что они появятся в релизе 1.3
There was a problem hiding this comment.
Обновил README и Wiki. Не уверен, где лучше указать примечание про фичи -- перечислить в разделе Home или сделать пометки в разделах с соответствующей функциональностью
There was a problem hiding this comment.
Я думаю, в разделах с соответствующей функциональностью. Хотя в целом можно и релиз выпустить, тогда не надо будет пометку делать
…setFromString to remove unchecked cast
…asses to distinct package
…xt menu construction into function
…logic from AbstractAutomaton
…indow in case of error
…eAutomatonBox visible but not modifiable
IlyaMuravjov
left a comment
There was a problem hiding this comment.
С точки зрения архитектуры выглядит достаточно хорошо
Отдельное спасибо за за чистую структуру коммитов и следование conventional commits, особенно при исправлении замечаний
…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
Реализовано:
EBNF)EBNFпо рекурсивному автоматуRPQс возможностью пошаговой визуализации выполненияmessages*.properties)tornadofx)