From 6108f1aa8acf9a433b313f9e65fc1221d30d77bc Mon Sep 17 00:00:00 2001 From: Johannes Mey <johannes.mey@tu-dresden.de> Date: Mon, 2 Dec 2019 00:53:37 +0100 Subject: [PATCH] remove attributes in task --- .../src/main/jastadd/Navigation.jrag | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/statemachine.task/src/main/jastadd/Navigation.jrag b/statemachine.task/src/main/jastadd/Navigation.jrag index 18c4e4f..964b1ed 100644 --- a/statemachine.task/src/main/jastadd/Navigation.jrag +++ b/statemachine.task/src/main/jastadd/Navigation.jrag @@ -6,53 +6,44 @@ aspect Navigation { /** Check, whether an this element is a state */ syn boolean Element.isState() = false; - eq State.isState() = true; /** View this element as a state */ syn State Element.asState() = null; - eq State.asState() = this; /** Check, whether an this element is a transition */ syn boolean Element.isTransition() = false; - eq Transition.isTransition() = true; /** View this element as a transition */ syn Transition Element.asTransition() = null; - eq Transition.asTransition() = this; /** Get all states */ syn List<State> StateMachine.states() { List<State> states = new ArrayList<>(); - for (Element element: getElementList()) { - if (element.isState()) { - states.add(element.asState()); - } - } + // TODO implement return states; } /** Get all transitions */ syn List<Transition> StateMachine.transitions() { List<Transition> transitions = new ArrayList<>(); - for (Element element: getElementList()) { - if (element.isTransition()) { - transitions.add(element.asTransition()); - } - } + // TODO implement return transitions; } /** Get the state machine the element is contained in */ 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 */ - syn boolean State.isInitial() = containingStateMachine().getInitial().equals(this); + syn boolean State.isInitial() = false; /** Determine whether the State is final */ - syn boolean State.isFinal() = containingStateMachine().getFinalList().contains(this); + syn boolean State.isFinal() = false; /** 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<>(); + } } -- GitLab