osate / osate2

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

Need reference to source AADL file. Element location reference is null. #912

Closed smithdtyler closed 7 years ago

smithdtyler commented 7 years ago

I need to add markers to the source AADL file(s) associated with an instance I'm analyzing. The class org.osate.aadl2.Element (passed as an argument to OSATE plugins) has a method getLocationReference() that seems to always return null.

How do I properly get a pointer to the source AADL file where an implementation is defined?

  @Override
  protected void doAaxlAction(IProgressMonitor monitor, Element root) {

    LocationReference ref = root.getLocationReference(); // always returns null

    IFile sourceAADLFile = // what?
lwrage commented 7 years ago

Location reference is a leftover from our AADL 1 implementation and is no longer used. (Even there it was not filled for instance model elements. For instance model elements you would not be able to get the location of the corresponding declarative element, anyway.) Instance model objects have a reference to the declarative model. From the declarative element. You can find the file via the URI of the resource containing the declarative element. If you need the exact location in the file, you can get it from the Xtext node model. BTW, could you use the google group for questions, please?