Skip to content

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

Closed
@Etienne13

Description

@Etienne13

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions