----------------------------------------- --------------------------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . G E N E R A T O R S . A D A _ V A L U E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2006-2007, 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 -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. Ocarina is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Ocarina; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth -- -- Floor, Boston, MA 02111-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Ocarina is maintained by the Ocarina team -- -- (ocarina-users@listes.enst.fr) -- -- -- ------------------------------------------------------------------------------ with Ocarina.Generators.Ada_Tree.Nodes; use Ocarina.Generators.Ada_Tree.Nodes; package Ocarina.Generators.Ada_Values is type value_type (K : node_kind := k_boolean) is record case K is when k_integer | k_boolean => IVal : unsigned_long_long; Sign : short_short; Base : unsigned_short_short; when k_float => FVal : long_double; when k_string | k_wide_string => SVal : name_id; when k_character | k_wide_character => CVal : unsigned_short; when others => null; end case; end record; Bad_Value : constant value_type; No_Value : constant value_id; function New_Boolean_Value (Value : Boolean) return value_id; function New_Floating_Point_Value (Value : long_double) return value_id; function New_Integer_Value (Value : unsigned_long_long; Sign : short_short; Base : unsigned_short_short) return value_id; function New_String_Value (Value : name_id; Wide : Boolean := False) return value_id; function New_Character_Value (Value : unsigned_short; Wide : Boolean := False) return value_id; function New_Value (Value : value_type) return value_id; function Value (V : value_id) return value_type; procedure Set_Value (V : value_id; X : value_type); function Image (Value : value_id) return String; function To_Ada_Value (V : value_id) return value_id; -- Converts an Ocarina (or Gaia) Value to and Ada one function "not" (R : value_type) return value_type; function "-" (R : value_type) return value_type; function "-" (L, R : value_type) return value_type; function "+" (L, R : value_type) return value_type; function "mod" (L, R : value_type) return value_type; function "/" (L, R : value_type) return value_type; function "*" (L, R : value_type) return value_type; function "and" (L, R : value_type) return value_type; function "or" (L, R : value_type) return value_type; function "xor" (L, R : value_type) return value_type; function Shift_Left (L, R : value_type) return value_type; function Shift_Right (L, R : value_type) return value_type; function "<" (L, R : value_type) return Boolean; -- Assume L and R have the same type. procedure Reset; -- Reset the value table private Bad_Value : constant value_type := value_type'((K => k_node_id)); No_Value : constant value_id := 0; end Ocarina.Generators.Ada_Values;