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

Value constant not accepted for behavior annex #2184

Closed
philip-alldredge opened this issue Jan 31, 2020 · 6 comments · Fixed by #2238
Closed

Value constant not accepted for behavior annex #2184

philip-alldredge opened this issue Jan 31, 2020 · 6 comments · Fixed by #2238

Comments

@philip-alldredge
Copy link
Collaborator

philip-alldredge commented Jan 31, 2020

Summary

When trying to specify an initial value constant for a behavior annex variable, a parse error occurs. This could be the result of having a bad version of the standard. Using a draft from 2017-02. The grammar on page 9 shows that a value_constant can be specified.

Steps to Reproduce

  1. Paste model
  2. Receive error unterminated behavior variable (missing ending ';')
package ba_test
public
	with Base_Types;

	process top
		features
			o1: out data port Base_Types::Integer_32;

		annex behavior_specification {**
          variables
            tmp :  Base_Types::Integer_32 :=1;
          states
            a : initial final state;
          transitions
            t : a -[]-> a {
              o1 := tmp
            };
        **};
	end top;

	
end ba_test;

Environment

  • OSATE Version: Nightly
  • Operating System: Windows
@Etienne13 Etienne13 self-assigned this Feb 1, 2020
@Etienne13
Copy link
Contributor

Etienne13 commented Feb 3, 2020

In the latest version of the BA, we opted for the usage of the Initial_Value property associated to variables as a way to model the initialization of these variables. The rationale was to follow the same initialization method as the core standard.

The initialization of your tmp variable should be modeled as follows:

tmp :  Base_Types::Integer_32 {Initial_Value => ("1");};

The behavior plugin does not support these property associations yet, but I have started working on it.

@philip-alldredge
Copy link
Collaborator Author

philip-alldredge commented Feb 3, 2020

Sounds like the draft document I was looking at is out of date and I need an updated version of the BA spec. Is "AS5506/3" the correct document?

When you say "support" these property associations, what do you mean? I thought the BA plugin just provided parsing support/meta-model support.

@Etienne13
Copy link
Contributor

Etienne13 commented Feb 3, 2020

By "support" I meant that the parser, and meta-model for property associated to behavior variables is not implemented yet (wip).

@philip-alldredge
Copy link
Collaborator Author

philip-alldredge commented Feb 3, 2020

Okay. Thanks for the clarification! I'm going to close this since the syntax I was using was invalid.

@philip-alldredge
Copy link
Collaborator Author

philip-alldredge commented Feb 5, 2020

@Etienne13
I'm reopening this because the latest version of AS5506/3 published by the SAE include the value constant as part of the grammar. Issued on 2017-08 "Superseding AS5506/2 Annex D".

@Etienne13
Copy link
Contributor

Etienne13 commented Feb 6, 2020

Yes, I double checked and you are right. Both ways of initialization (using a direct affectation := or using property associations) should be supported.

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