Skip to content

Commit

Permalink
#3 Changed from action to block (syntax benefit)
Browse files Browse the repository at this point in the history
  • Loading branch information
arminzavada committed Apr 1, 2021
1 parent 4a19624 commit 7a41765
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ ActivityDefinition returns ActivityDefinition:

ActionDefinition returns ActionDefinition:
'[' 'language' '=' 'action' ']'
'{'
action = Action
'}'
action = Block
;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<eClassifiers xsi:type="ecore:EClass" name="InputPin" eSuperTypes="#//Pin"/>
<eClassifiers xsi:type="ecore:EClass" name="ActionDefinition" eSuperTypes="#//Definition">
<eStructuralFeatures xsi:type="ecore:EReference" name="action" lowerBound="1"
eType="ecore:EClass ../../hu.bme.mit.gamma.action.model/model/action.ecore#//Action"
eType="ecore:EClass ../../hu.bme.mit.gamma.action.model/model/action.ecore#//Block"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Definition" abstract="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import hu.bme.mit.gamma.action.model.AssignmentStatement;
import hu.bme.mit.gamma.action.util.ActionModelValidator;
import hu.bme.mit.gamma.activity.model.ActivityDeclaration;
import hu.bme.mit.gamma.activity.model.ActivityDefinition;
import hu.bme.mit.gamma.activity.model.ActivityNode;
import hu.bme.mit.gamma.activity.model.ActivityPackage;
import hu.bme.mit.gamma.activity.model.NamedActivityDeclaration;
import hu.bme.mit.gamma.activity.model.Pin;
import hu.bme.mit.gamma.activity.model.PinReference;
import hu.bme.mit.gamma.expression.model.ExpressionModelPackage;
import hu.bme.mit.gamma.expression.model.NamedElement;
import hu.bme.mit.gamma.expression.util.ExpressionModelValidator.ValidationResultMessage;

public class ActivityModelValidator extends ActionModelValidator {
// Singleton
Expand Down Expand Up @@ -64,4 +68,13 @@ public <T> Collection<ValidationResultMessage> checkDirectNames(Collection<T> el
return validationResultMessages;
}

@Override
public Collection<ValidationResultMessage> checkAssignmentActions(AssignmentStatement assignment) {
if (assignment.getLhs() instanceof PinReference) {
return Collections.emptyList();
}

return super.checkAssignmentActions(assignment);
}

}

0 comments on commit 7a41765

Please sign in to comment.