diff --git a/src/core/model/ocarina-analyzer-aadl-semantics.adb b/src/core/model/ocarina-analyzer-aadl-semantics.adb index 91a2828f0a0ea1cd1f46c67f9690e7d974789b40..031bdc2e219123c420bfe810d6fef27d3706cdfc 100644 --- a/src/core/model/ocarina-analyzer-aadl-semantics.adb +++ b/src/core/model/ocarina-analyzer-aadl-semantics.adb @@ -1948,7 +1948,7 @@ package body Ocarina.Analyzer.AADL.Semantics is Get_Type_Of_Property_Value (Expanded_Single_Value (Property_Association_Value - (Property_Association)))) + (Property_Association)))) and then Test_Property_Value_Validity (Property_Name_Type (Property_Name), Expanded_Single_Value @@ -2001,7 +2001,7 @@ package body Ocarina.Analyzer.AADL.Semantics is end if; -- Use the routines of the AADL_Values package to compare the - -- values and wrapp them to intercept any comparison error. + -- values and wrap them to intercept any comparison error. begin if Value (Value (Literal_1)) < Value (Value (Literal_2)) then @@ -2014,6 +2014,7 @@ package body Ocarina.Analyzer.AADL.Semantics is exception when Constraint_Error => Result := -2; + raise; end; return Result; @@ -2150,6 +2151,7 @@ package body Ocarina.Analyzer.AADL.Semantics is N := New_Node (K_Literal, Loc (L)); Set_Value (N, New_Value (Result)); + return N; end Convert_To_Base; @@ -2340,7 +2342,6 @@ package body Ocarina.Analyzer.AADL.Semantics is if Success then case Kind (Type_Designator) is - when K_Classifier_Type => List_Node := First_Node (List_Items (Type_Designator)); @@ -2400,9 +2401,10 @@ package body Ocarina.Analyzer.AADL.Semantics is if Get_Entity_Category (Temp_Node) = EC_Subcomponent then - -- If the subcomponent specification - -- is incmplete (see AADL 1.0 - -- standard paragraph 4.5 section + -- If the subcomponent + -- specification is incomplete + -- (see AADL 1.0 standard + -- paragraph 4.5 section -- `semantics'), then there is -- nothing else to analyze. @@ -2507,18 +2509,14 @@ package body Ocarina.Analyzer.AADL.Semantics is Present (Lower_Bound (Type_Range (Type_Designator))) and then (Compare_Numbers - (Lower_Bound - (Type_Range - (Type_Designator)), - Actual_Literal) >= 0) + (Lower_Bound (Type_Range (Type_Designator)), + Actual_Literal) >= 0) and then Present (Upper_Bound (Type_Range (Type_Designator))) and then (Compare_Numbers (Actual_Literal, - Upper_Bound - (Type_Range - (Type_Designator))) >= 0); + Upper_Bound (Type_Range (Type_Designator))) >= 0); end if; else Success := False; diff --git a/src/core/tree/ocarina-aadl_values.adb b/src/core/tree/ocarina-aadl_values.adb index 18c26dfa7fe44e26d490077f4c4f348950ed5de2..0570f754fa50498b544add7c57a6330060be4af2 100644 --- a/src/core/tree/ocarina-aadl_values.adb +++ b/src/core/tree/ocarina-aadl_values.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2008, GET-Telecom Paris. -- +-- Copyright (C) 2004-2010, GET-Telecom Paris. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -262,28 +262,16 @@ package body Ocarina.AADL_Values is return Remove_Leading_Spaces (Unsigned_Short_Short'Image (V)); end Image; - ----------- - -- Image -- - ----------- - function Image (V : Integer) return String is begin return Remove_Leading_Spaces (Integer'Image (V)); end Image; - ----------- - -- Image -- - ----------- - function Image (V : Unsigned_Long_Long) return String is begin return Remove_Leading_Spaces (Unsigned_Long_Long'Image (V)); end Image; - ----------- - -- Image -- - ----------- - function Image (V : Unsigned_Long_Long; Base : Unsigned_Short_Short) @@ -321,10 +309,6 @@ package body Ocarina.AADL_Values is return Str (Str_Pos + 1 .. Str'Last); end Image; - ----------- - -- Image -- - ----------- - function Image (V : Unsigned_Long_Long; Base : Unsigned_Short_Short; @@ -359,10 +343,6 @@ package body Ocarina.AADL_Values is end if; end Image; - ----------- - -- Image -- - ----------- - function Image (V : Long_Long_Float) return String is Str : String (1 .. 2 * Long_Long_Float'Digits + 2); -- Max digits = [+/-] Fore . Aft @@ -372,10 +352,6 @@ package body Ocarina.AADL_Values is return Remove_Ending_Zeros (Remove_Leading_Spaces (Str)); end Image; - ----------- - -- Image -- - ----------- - function Image (V : Long_Long_Float; Base : Unsigned_Short_Short) @@ -430,10 +406,6 @@ package body Ocarina.AADL_Values is end if; end Image; - ----------- - -- Image -- - ----------- - function Image (V : Long_Long_Float; Base : Unsigned_Short_Short; @@ -468,10 +440,6 @@ package body Ocarina.AADL_Values is end if; end Image; - ----------- - -- Image -- - ----------- - function Image (Kind : Node_Kind) return String is use Charset; @@ -504,7 +472,7 @@ package body Ocarina.AADL_Values is PExp : constant Integer := abs (Exp); begin - for I in 1 .. PExp loop + for J in 1 .. PExp loop Result := Result * LBase; end loop; @@ -568,6 +536,7 @@ package body Ocarina.AADL_Values is Result.IBase := 10; Result.ISign := Safe_XOR (L.ISign, R.ISign); Result.IVal := L.IVal * R.IVal; + Result.IExp := 0; return Result; end;