Commit 824b3ff3 authored by jhugues's avatar jhugues
Browse files

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

        Fixes #1

git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@6248 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent f03cd543
...@@ -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 (
......
...@@ -5,61 +5,61 @@ ...@@ -5,61 +5,61 @@
property set Memory_Properties is property set Memory_Properties is
Size: type aadlinteger 0 Bytes .. Max_Memory_Size units Size_Units; Size: type aadlinteger 0 Bytes .. Max_Memory_Size units Size_Units;
Size_Range: type range of Size; Size_Range: type range of Size;
Access_Right: Access_Rights => read_write Access_Right: Access_Rights => read_write
applies to (data, bus, data access, bus access); applies to (data, bus, data access, bus access);
Access_Rights: type enumeration (read_only, write_only, read_write, by_method); Access_Rights: type enumeration (read_only, write_only, read_write, by_method);
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
applies to (bus); applies to (bus);
Assign_Time: record ( Assign_Time: record (
Fixed: Time_Range; Fixed: Time_Range;
PerByte: Time_Range;) PerByte: Time_Range;)
applies to (processor); applies to (processor);
Base_Address: aadlinteger 0 .. Max_Base_Address Base_Address: aadlinteger 0 .. Max_Base_Address
applies to (memory, data, data access, port); applies to (memory, data, data access, port);
Device_Register_Address: aadlinteger Device_Register_Address: aadlinteger
applies to (port, feature group); applies to (port, feature group);
Read_Time: record ( Read_Time: record (
Fixed: Time_Range; Fixed: Time_Range;
PerByte: Time_Range;) PerByte: Time_Range;)
applies to (memory); applies to (memory);
Source_Code_Size: Size Source_Code_Size: Size
applies to (data, thread, thread group, process, system, subprogram, processor, device); applies to (data, thread, thread group, process, system, subprogram, processor, device);
Source_Data_Size: Size Source_Data_Size: Size
applies to (data, subprogram, thread, thread group, process, system, processor, device); applies to (data, subprogram, thread, thread group, process, system, processor, device);
Source_Heap_Size: Size Source_Heap_Size: Size
applies to (thread, subprogram); applies to (thread, subprogram);
Source_Stack_Size: Size Source_Stack_Size: Size
applies to (thread, subprogram, processor, device); applies to (thread, subprogram, processor, device);
Byte_Count: aadlinteger 0 .. Max_Byte_Count Byte_Count: aadlinteger 0 .. Max_Byte_Count
applies to (memory); applies to (memory);
Word_Size: Size => 8 bits Word_Size: Size => 8 bits
applies to (memory); applies to (memory);
Word_Space: aadlinteger 1 .. Max_Word_Space => 1 Word_Space: aadlinteger 1 .. Max_Word_Space => 1
applies to (memory); applies to (memory);
Write_Time: record ( Write_Time: record (
Fixed: Time_Range; Fixed: Time_Range;
PerByte: Time_Range;) PerByte: Time_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.
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