You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Dave Thompson (Jira)" <ji...@apache.org> on 2021/05/24 12:06:00 UTC
[jira] [Closed] (DAFFODIL-1437) Clarity: DFA Rules - eliminate
anonymous classes and functions
[ https://issues.apache.org/jira/browse/DAFFODIL-1437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Thompson closed DAFFODIL-1437.
-----------------------------------
Verified the specified commit (commit 45b26a254d627e24bde07ac88a1c75b514de2600) is included in the latest pull from the daffodil repository.
Verified changes specified in the commit comment were implemented in the update via review.
Verified the associated daffodil sub-project sbt test suites execute successfully.
> Clarity: DFA Rules - eliminate anonymous classes and functions
> --------------------------------------------------------------
>
> Key: DAFFODIL-1437
> URL: https://issues.apache.org/jira/browse/DAFFODIL-1437
> Project: Daffodil
> Issue Type: Improvement
> Components: Back End, Clean Ups
> Reporter: Mike Beckerle
> Assignee: Sandeep Kumar
> Priority: Major
> Fix For: 3.2.0
>
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> This is a lisp sort of thing to do as written, but there really is no reason these can't be ordinary objects with two methods, test and act. The code would be clearer and easier to debug. Particularly if the classes have names like
> {code}
> final class StartState(states: => ArrayBuffer[State], val stateNum: Int) extends State(states) {
> type R = Registers // put into State base class, protected
> object Got_EC_goto_ESCState extends Rule {
> def test(r: R) = { ... }
> def act(r: R) = { ... }
> }
> object Got_EEC_goto_ESCESCState extends Rule {
> def test(r: R) = { ... }
> def act(r: R) = { ... }
> }
> ...
> override val rules = ArrayBuffer(
> Got_EC_goto_ESCState,
> Got_EEC_goto_EECState,
> ...
> )
> ...
> }
> {code}
> In the above, the nesting makes it clear each "Rule" which is a state-machine transition, originates at a particular state.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)