Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In BA plugin, fail referencing fields of a subprogram data access or input parameter when calling another one #2466

Closed
Etienne13 opened this issue Sep 30, 2020 · 3 comments · Fixed by #2582
Assignees
Milestone

Comments

@Etienne13
Copy link
Contributor

Etienne13 commented Sep 30, 2020

Summary

When the data type of data access of a subprogram is a struct, we cannot access its fields in a parameter of a subprogram call action. The BA plugin complains that it "cannot have any more tokens".

Expected and Current Behavior

The example bellow is not considered legit by the BA parser, although I do not see any problem with it. Note: it works with subprogram out parameters but fails with requires data accesses or in parameters.

Steps to Reproduce

  1. copy paste the example above
  2. see the error; if you replace "requires data access" by "in parameter" it works.
package test
public
	
	with data_model;
	
	data field_type
	end field_type;
	
	data my_data
	properties
		Data_Model::Data_Representation => Struct;
			Data_Model::Element_Names => ("f");
			Data_Model::Base_Type => (classifier (field_type));
	end my_data;
	
	subprogram s1
		features
			f: requires data access field_type;
	end s1;
	
	subprogram s2
		features
			d: requires data access my_data;
		annex behavior_specification {**
			states
				s: initial final state;
			transitions
				t: s-[]-> s {s1!(d.f)};
		**};
	end s2;

        subprogram s3
		features
			d: in parameter my_data;
		annex behavior_specification {**
			states
				s: initial final state;
			transitions
				t: s-[]-> s {s1!(d.f)};
		**};
	end s3;
	
end test;

Environment

  • OSATE Version: 2.8.0
  • Operating System: Linux, Ubuntu 18.04
@Etienne13 Etienne13 self-assigned this Sep 30, 2020
@Etienne13 Etienne13 modified the milestones: 2.9.0, 2.9.1 Sep 30, 2020
@Etienne13
Copy link
Contributor Author

This is also related to the direction of the data access in s1: if you specify it to be read_only, the model is suddenly considered correct.

The issue to be fixed is in AadlBaTypeChecker, method subprogramParameterListCheck.

Note: the error produced in s3 is legit: we pass to a read_write data access an in parameter.

@lwrage lwrage modified the milestones: 2.9.1, 2.9.2 Jan 15, 2021
@lwrage
Copy link
Contributor

lwrage commented Feb 11, 2021

@Etienne13 Do you think you can resolve this issue before end of March for the 2.9.2 release?

@Etienne13
Copy link
Contributor Author

@lwrage ok, I am working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants