Skip to content
Snippets Groups Projects
Commit 6108f1aa authored by Johannes Mey's avatar Johannes Mey
Browse files

remove attributes in task

parent 7b3c1193
Branches
No related tags found
No related merge requests found
...@@ -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<>();
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment