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

Make K3FSM semantics work with null input/outputs #258

Merged
merged 3 commits into from
Jun 28, 2022

Conversation

ebousse
Copy link
Contributor

@ebousse ebousse commented Feb 3, 2022

Description

Currently, the semantics of K3FSM can only execute models where all transitions have both an input and an output string.

This PR solves that, and will make sure the semantics can legally fire a transition that has no input string.

Changes

  • Add new condition to consider a transition to be "valid" : t.input === null
  • Adapt code to the fact that input and output may be null
  • Reformat k3fsm semantics file

Copy link
Contributor

@dvojtise dvojtise left a comment

Choose a reason for hiding this comment

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

the // are asciidoc comments they must remain in the file or one must replace them with another documentation


@Aspect(className=FSM)
class FSMAspect {
@Step
@InitializeModel // <1>
Copy link
Contributor

Choose a reason for hiding this comment

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

the // <1> is a directive for the asciidoc generator, it must stay in the file (or find another way to document it)
cf. https://download.eclipse.org/gemoc/docs/nightly/K3FSM-example.html#_add_semantics_operations

println("nothing to process, did you forgot to pass parameters to the launch configuration ?")
}
}
@Step
@Main // <2>
Copy link
Contributor

Choose a reason for hiding this comment

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

same asciidoc comment

}
}

@Aspect(className=State)
class StateAspect {
@Step // <3>
Copy link
Contributor

Choose a reason for hiding this comment

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

asciidoc comment

@@ -62,22 +62,20 @@ class StateAspect {

@Aspect(className=Transition)
class TransitionAspect {

@Step // <4>
Copy link
Contributor

Choose a reason for hiding this comment

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

asccidoc comment

Signed-off-by: Didier Vojtisek <didier.vojtisek@inria.fr>
@dvojtise dvojtise merged commit 1c61403 into master Jun 28, 2022
@dvojtise dvojtise added the bug label Jun 30, 2022
@dvojtise dvojtise deleted the k3fsm-tolerate-nulls branch June 30, 2022 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants