osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
39 stars 8 forks source link

Behavior annex parser flags the entire annex block on syntax errors #1863

Closed smithdtyler closed 5 years ago

smithdtyler commented 5 years ago

If I make a small error like swapping a colon and semicolon, OSATE flags the entire BA block as being an error.

Screen Shot 2019-06-27 at 2 47 25 PM
  thread group implementation threadB.impl
    subcomponents
      t0 : thread;
      annex behavior_specification {**
    states
    s0: initial complete final state;
    s1; state;
    transitions
    s0 -[ on dispatch ]-> s1 {output:=1};
    **};
  end threadB.impl;

The error message is unhelpfully complicated:

The required feature 'initialState' of 'org.osate.ba.aadlba.impl.BehaviorAnnexImpl@46462898{platform:/resource/com.adventiumlabs.sliced.unittest/LivenessAssertionFail.aadl#/0/@ownedPublicSection/@ownedClassifier.4/@ownedAnnexSubclause.0/@parsedAnnexSubclause}' must be set

Environment

Etienne13 commented 5 years ago

This problem is due to the fact the parsed annex object is kept assigned to the result provided by the parser even though the parser reported errors. In class AnnexParserAgent, line 225, you can see that the second part of the conjunction has been commented. If you assign the parsed annex object to null when this condition is true (which is the case in your example) the strange error message disappears.

However, syntax highlighting will then be off (see #1864) and no error is reported (probably same issue as #891).

lwrage commented 5 years ago

Closed via PR #1875