Commit bdbfe2ca authored by yoogx's avatar yoogx
Browse files

* Adjust to AADLv2.1 syntax for record using square brackets '['

        Fixes #1
parent febb96d7
...@@ -35,10 +35,11 @@ property set Communication_Properties is ...@@ -35,10 +35,11 @@ property set Communication_Properties is
Transmission_Type: enumeration (push, pull) Transmission_Type: enumeration (push, pull)
applies to (data port, port connection, bus, virtual bus); applies to (data port, port connection, bus, virtual bus);
Input_Rate: Rate_Spec => (Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed;)
Input_Rate: Rate_Spec => [ Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed; ]
applies to (port); applies to (port);
Input_Time: list of IO_Time_Spec => ((Time => Dispatch; Offset => 0 ns .. 0 ns;)) Input_Time: list of IO_Time_Spec => ([ Time => Dispatch; Offset => 0 ns .. 0 ns; ])
applies to (port); applies to (port);
IO_Time_Spec: type record ( IO_Time_Spec: type record (
...@@ -48,19 +49,20 @@ property set Communication_Properties is ...@@ -48,19 +49,20 @@ property set Communication_Properties is
IO_Reference_Time: type enumeration (Dispatch, Start, Completion, Deadline, NoIO); IO_Reference_Time: type enumeration (Dispatch, Start, Completion, Deadline, NoIO);
Output_Rate: Rate_Spec => (Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed;) Output_Rate: Rate_Spec => [ Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed; ]
applies to (port); applies to (port);
Output_Time: list of IO_Time_Spec => ((Time => Completion; Offset => 0 ns .. 0 ns;)) Output_Time: list of IO_Time_Spec => ([ Time => Completion; Offset => 0 ns .. 0 ns; ])
applies to (port); applies to (port);
Rate_Spec: type record ( Rate_Spec: type record (
Value_Range: range of aadlreal; Value_Range: range of aadlreal;
Rate_Unit: enumeration (PerSecond, PerDispatch); Rate_Unit: enumeration (PerSecond, PerDispatch);
Rate_Distribution: Supported_Distributions; Rate_Distribution: Supported_Distributions;
); );
Subprogram_Call_Rate: Rate_Spec => (Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed;) Subprogram_Call_Rate: Rate_Spec => [ Value_Range => 1.0 .. 1.0; Rate_Unit => PerDispatch; Rate_Distribution => Fixed; ]
applies to (subprogram access); applies to (subprogram access);
Transmission_Time: record ( Transmission_Time: record (
......
...@@ -16,8 +16,8 @@ property set Memory_Properties is ...@@ -16,8 +16,8 @@ property set Memory_Properties is
Access_Time: record ( Access_Time: record (
First: IO_Time_Spec; First: IO_Time_Spec;
Last: IO_Time_Spec;) Last: IO_Time_Spec;)
=> (First => (Time => Start; Offset => 0 ns .. 0 ns;); => [ First => [ Time => Start; Offset => 0 ns .. 0 ns; ];
Last => (Time => Completion; Offset => 0 ns .. 0 ns;);) Last => [ Time => Completion; Offset => 0 ns .. 0 ns; ]; ]
applies to (data access); applies to (data access);
Allowed_Message_Size: Size_Range Allowed_Message_Size: Size_Range
......
...@@ -311,7 +311,7 @@ package body Ocarina.BE_AADL.Properties.Values is ...@@ -311,7 +311,7 @@ package body Ocarina.BE_AADL.Properties.Values is
List_Node : Node_Id; List_Node : Node_Id;
begin begin
Print_Token (T_Left_Parenthesis); Print_Token (T_Left_Square_Bracket);
Write_Space; Write_Space;
List_Node := First_Node List_Node := First_Node
...@@ -331,7 +331,7 @@ package body Ocarina.BE_AADL.Properties.Values is ...@@ -331,7 +331,7 @@ package body Ocarina.BE_AADL.Properties.Values is
end loop; end loop;
Write_Space; Write_Space;
Print_Token (T_Right_Parenthesis); Print_Token (T_Right_Square_Bracket);
end Print_Record_Term; end Print_Record_Term;
------------------------------- -------------------------------
......
...@@ -2365,6 +2365,16 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is ...@@ -2365,6 +2365,16 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is
when T_Left_Parenthesis => when T_Left_Parenthesis =>
return P_Boolean_Or_Record_Term; return P_Boolean_Or_Record_Term;
when T_Left_Square_Bracket =>
if AADL_Version = AADL_V2 then
return P_Record_Term;
else
DPE (PC_Property_Expression,
EMC_Not_Allowed_In_AADL_V1);
Skip_Tokens (T_Semicolon);
return No_Node;
end if;
when T_Compute => when T_Compute =>
if AADL_Version = AADL_V2 then if AADL_Version = AADL_V2 then
return P_Computed_Term; return P_Computed_Term;
...@@ -2539,8 +2549,8 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is ...@@ -2539,8 +2549,8 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is
-- AADL_V2 -- AADL_V2
-- record_term ::= -- record_term ::=
-- ( record_field_identifier => property_expression ; -- [ record_field_identifier => property_expression ;
-- ( record_field_identifier => property_expression ; )* ) -- ( record_field_identifier => property_expression ; )* ]
function P_Record_Term return Node_Id is function P_Record_Term return Node_Id is
use Ocarina.ME_AADL.AADL_Tree.Nodes; use Ocarina.ME_AADL.AADL_Tree.Nodes;
...@@ -2567,7 +2577,7 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is ...@@ -2567,7 +2577,7 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is
Items := P_Items_List (P_Record_Term_Element'Access, Items := P_Items_List (P_Record_Term_Element'Access,
No_Node, No_Node,
T_Semicolon, T_Semicolon,
T_Right_Parenthesis, T_Right_Square_Bracket,
PC_Record_Term, PC_Record_Term,
True); True);
......
...@@ -280,3 +280,4 @@ tests/test_identifier/t.aadl ...@@ -280,3 +280,4 @@ tests/test_identifier/t.aadl
tests/example_04_03/t.aadl tests/example_04_03/t.aadl
tests/example_04_05_1/t.aadl tests/example_04_05_1/t.aadl
tests/github/issue_1/test.aadl
package PropValue
public
bus Ethernet_Cable
end Ethernet_Cable;
bus implementation Ethernet_Cable.ARINC_664
properties
-- The following is legal AADL 2 and accepted by OSATE
-- but not by Ocarina. Ocarina only accepts () and OSATE
-- only accepts [] for records.
Transmission_Time => [ Fixed => 3360 ns .. 3360 ns; PerByte => 80 ns .. 80 ns; ];
end Ethernet_Cable.ARINC_664;
system Test
end Test;
system implementation Test.Imp
subcomponents
aBus : bus Ethernet_Cable.ARINC_664;
end Test.Imp;
end PropValue;
\ No newline at end of file
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment