osate / osate2

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

BA Parsing Failure in OSATE Eclipse Luna #415

Closed spmiller2055 closed 10 years ago

spmiller2055 commented 10 years ago

When installing the OSATE BA Annex sources in Eclipse Luna, the Behavior Annexes are not being parsed correctly. Syntax highlighting still works, but syntax errors (for example, "complete finalxxx state" as shown in attached screen shop) are not identified and the internal representation of the annex is not being constructed.

ba parsing failure in osate ecliipse luna

SebastienGardoll commented 10 years ago

I have upgraded to Eclipse Luna and everything works fine for me. Does someone have the same problem ?

spmiller2055 commented 10 years ago

I just discovered that this problem goes away if I close the projects that parse and build the AST for AGREE annexes. By doing this, the AGREE annexes appear as comments to the Behavior Annex code. The problem probably is that the Behavior Annex code is not expecting to encounter an AST for anything other than a Behavior Annex and gets confused when it encounters an AGREE annext. The following code will only see the ASTs for Behavior Annexes.

for (AnnexSubclause as : AnnexUtil.getAllAnnexSubclauses(cc, org.osate.ba.aadlba.AadlBaFactory.eINSTANCE.getAadlBaPackage().getBehaviorAnnex())){

Steve Miller

On Fri, Aug 22, 2014 at 3:14 AM, gardoll notifications@github.com wrote:

I have upgraded to Eclipse Luna and everything works fine for me. Does someone have the same problem ?

— Reply to this email directly or view it on GitHub https://github.com/osate/osate2-core/issues/415#issuecomment-53034607.

Dr. Steven P. Miller Rockwell Collins, MS 108-206 400 Collins Road NE Cedar Rapids, Iowa 52498

Steven.Miller@rockwellcollins.com (319) 295-2055

SebastienGardoll commented 10 years ago

It seems that BA marker error reporters don't work. BA parser use directly ANTLR v4 and not Xtext mechanism. I think my brigde between ANTLR error reporting and Xtext one, doesn't work any more. Stay tune ...

SebastienGardoll commented 10 years ago

After an intensive analyse, I found out why BA's error markers vanish when BA subclause exists alongside others annex subclauses (including AGREE). In fact, BA plugin is cleared from this bug. AnnexParserAgent (1) controls the resolution of the subclauses. Its method "afterModelLinked", recursively calls itself when the current subclause annex to resolve hasn't got any resolver but has a linkingservice (2). Calling linkingservice reinstantiates the parser error reporter (3) and delete all the previous error markers (4). As I do not know much about xtext, I made a patch for you and let Julien or an other person, decides to apply the patch on the git repository.

Gist example (normaly, "port" in the behavior condition is marked) : https://gist.github.com/gardoll/e95c05ba5f7e9f298380

(1): org.osate.xtext.aadl2.parsing.AnnexParserAgent.java (2): AnnexParserAgent.java line 237 (3): AnnexParserAgent.java line 113 (4): org.osate.aadl2.modelsupport.errorreporting.ParseErrorReporterManager.java line 116

lwrage commented 10 years ago

Fixed by merging pull request #485