Commit bdbfe2ca authored by yoogx's avatar yoogx

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

        Fixes #1
parent febb96d7
......@@ -35,10 +35,11 @@ property set Communication_Properties is
Transmission_Type: enumeration (push, pull)
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);
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);
IO_Time_Spec: type record (
......@@ -48,19 +49,20 @@ property set Communication_Properties is
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);
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);
Rate_Spec: type record (
Value_Range: range of aadlreal;
Rate_Unit: enumeration (PerSecond, PerDispatch);
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);
Transmission_Time: record (
......
......@@ -5,61 +5,61 @@
property set Memory_Properties is
Size: type aadlinteger 0 Bytes .. Max_Memory_Size units Size_Units;
Size_Range: type range of Size;
Access_Right: Access_Rights => read_write
applies to (data, bus, data access, bus access);
Access_Rights: type enumeration (read_only, write_only, read_write, by_method);
Access_Time: record (
First: IO_Time_Spec;
Last: IO_Time_Spec;)
=> (First => (Time => Start; Offset => 0 ns .. 0 ns;);
Last => (Time => Completion; Offset => 0 ns .. 0 ns;);)
applies to (data access);
=> [ First => [ Time => Start; Offset => 0 ns .. 0 ns; ];
Last => [ Time => Completion; Offset => 0 ns .. 0 ns; ]; ]
applies to (data access);
Allowed_Message_Size: Size_Range
applies to (bus);
Assign_Time: record (
Fixed: Time_Range;
PerByte: Time_Range;)
applies to (processor);
Base_Address: aadlinteger 0 .. Max_Base_Address
applies to (memory, data, data access, port);
Device_Register_Address: aadlinteger
applies to (port, feature group);
Read_Time: record (
Fixed: Time_Range;
PerByte: Time_Range;)
applies to (memory);
Source_Code_Size: Size
applies to (data, thread, thread group, process, system, subprogram, processor, device);
Source_Data_Size: Size
applies to (data, subprogram, thread, thread group, process, system, processor, device);
Source_Heap_Size: Size
applies to (thread, subprogram);
Source_Stack_Size: Size
applies to (thread, subprogram, processor, device);
Byte_Count: aadlinteger 0 .. Max_Byte_Count
applies to (memory);
Word_Size: Size => 8 bits
applies to (memory);
Word_Space: aadlinteger 1 .. Max_Word_Space => 1
applies to (memory);
Write_Time: record (
Fixed: Time_Range;
PerByte: Time_Range;)
......
......@@ -311,7 +311,7 @@ package body Ocarina.BE_AADL.Properties.Values is
List_Node : Node_Id;
begin
Print_Token (T_Left_Parenthesis);
Print_Token (T_Left_Square_Bracket);
Write_Space;
List_Node := First_Node
......@@ -331,7 +331,7 @@ package body Ocarina.BE_AADL.Properties.Values is
end loop;
Write_Space;
Print_Token (T_Right_Parenthesis);
Print_Token (T_Right_Square_Bracket);
end Print_Record_Term;
-------------------------------
......
......@@ -2365,6 +2365,16 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is
when T_Left_Parenthesis =>
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 =>
if AADL_Version = AADL_V2 then
return P_Computed_Term;
......@@ -2539,8 +2549,8 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is
-- AADL_V2
-- 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
use Ocarina.ME_AADL.AADL_Tree.Nodes;
......@@ -2567,7 +2577,7 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is
Items := P_Items_List (P_Record_Term_Element'Access,
No_Node,
T_Semicolon,
T_Right_Parenthesis,
T_Right_Square_Bracket,
PC_Record_Term,
True);
......
......@@ -280,3 +280,4 @@ tests/test_identifier/t.aadl
tests/example_04_03/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.
Markdown is supported
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