Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Bank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ronny Böttger
Bank
Commits
6108f1aa
Commit
6108f1aa
authored
5 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
remove attributes in task
parent
7b3c1193
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
statemachine.task/src/main/jastadd/Navigation.jrag
+9
-18
9 additions, 18 deletions
statemachine.task/src/main/jastadd/Navigation.jrag
with
9 additions
and
18 deletions
statemachine.task/src/main/jastadd/Navigation.jrag
+
9
−
18
View file @
6108f1aa
...
@@ -6,53 +6,44 @@ aspect Navigation {
...
@@ -6,53 +6,44 @@ aspect Navigation {
/** Check, whether an this element is a state */
/** Check, whether an this element is a state */
syn boolean Element.isState() = false;
syn boolean Element.isState() = false;
eq State.isState() = true;
/** View this element as a state */
/** View this element as a state */
syn State Element.asState() = null;
syn State Element.asState() = null;
eq State.asState() = this;
/** Check, whether an this element is a transition */
/** Check, whether an this element is a transition */
syn boolean Element.isTransition() = false;
syn boolean Element.isTransition() = false;
eq Transition.isTransition() = true;
/** View this element as a transition */
/** View this element as a transition */
syn Transition Element.asTransition() = null;
syn Transition Element.asTransition() = null;
eq Transition.asTransition() = this;
/** Get all states */
/** Get all states */
syn List<State> StateMachine.states() {
syn List<State> StateMachine.states() {
List<State> states = new ArrayList<>();
List<State> states = new ArrayList<>();
for (Element element: getElementList()) {
// TODO implement
if (element.isState()) {
states.add(element.asState());
}
}
return states;
return states;
}
}
/** Get all transitions */
/** Get all transitions */
syn List<Transition> StateMachine.transitions() {
syn List<Transition> StateMachine.transitions() {
List<Transition> transitions = new ArrayList<>();
List<Transition> transitions = new ArrayList<>();
for (Element element: getElementList()) {
// TODO implement
if (element.isTransition()) {
transitions.add(element.asTransition());
}
}
return transitions;
return transitions;
}
}
/** Get the state machine the element is contained in */
/** Get the state machine the element is contained in */
inh StateMachine Element.containingStateMachine();
inh StateMachine Element.containingStateMachine();
eq StateMachine.getElement().containingStateMachine() = this;
// the following equation is only there to make the progam compile, it must be replaced by a reasonable alternative
eq ASTNode.getChild().containingStateMachine() = null;
/** Determine whether the State is final */
/** Determine whether the State is final */
syn boolean State.isInitial() =
containingStateMachine().getInitial().equals(this)
;
syn boolean State.isInitial() =
false
;
/** Determine whether the State is final */
/** Determine whether the State is final */
syn boolean State.isFinal() =
containingStateMachine().getFinalList().contains(this)
;
syn boolean State.isFinal() =
false
;
/** Get all successor states */
/** Get all successor states */
syn Collection<State> State.successors() = getOutgoingList().stream().map(Transition::getTo).collect(Collectors.toList());
syn Collection<State> State.successors() {
return new ArrayList<>();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment