--------------------------------------------------------------------- ----------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . A A D L . T O K E N S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2006, 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 Types; use Types; package Ocarina.AADL.Tokens is pragma elaborate_body (Tokens); type token_type is (t_error, t_identifier, -- Special_Characters t_quotation_mark, -- " (for T_String_Literal) t_number_sign, -- # t_underline, -- _ t_comma, -- , First Delimiter t_plus, -- + First Binary Operator t_minus, -- - t_multiply, -- * t_divide, -- / Last Binary Operator t_dot, -- . t_colon, -- : t_semicolon, -- ; t_less_than_sign, -- < t_equals_sign, -- = t_greater_than_sign, -- > t_association, -- => t_additive_association, -- +=> t_connection, -- -> t_delayed_connection, -- ->> t_interval, -- .. t_colon_colon, -- :: t_left_parenthesis, -- ( First Opening Delimiter t_left_square_bracket, -- [ t_left_curly_bracket, -- { t_left_step_bracket, -- -[ t_begin_annex, -- {** Last Opening Delimiter t_right_parenthesis, -- ) First Closing Delimiter t_right_square_bracket, -- ] t_right_curly_bracket, -- } t_right_step_bracket, -- ]-> t_end_annex, -- **} Last Closing Delimiter, Last --Delimiter -- Reserved Words t_aadlboolean, -- 'aadlboolean' t_aadlinteger, -- 'aadlinteger' t_aadlreal, -- 'aadlreal' t_aadlstring, -- 'aadlstring' t_access, -- 'access' t_all, -- 'all' t_and, -- 'and' t_annex, -- 'annex' t_applies, -- 'applies' t_binding, -- 'binding' t_bus, -- 'bus' t_calls, -- 'calls' t_classifier, -- 'classifier' t_connections, -- 'connections' t_constant, -- 'constant' t_data, -- 'data' t_delta, -- 'delta' t_device, -- 'device' t_end, -- 'end' t_enumeration, -- 'enumeration' t_event, -- 'event' t_extends, -- 'extends' t_false, -- 'false' Boolean Value t_true, -- 'true' Boolean Value t_features, -- 'features' t_flow, -- 'flow' t_flows, -- 'flows' t_group, -- 'group' t_implementation, -- 'implementaion' t_in, -- 'in' t_inherit, -- 'inherit' t_initial, -- 'initial' t_inverse, -- 'inverse' t_is, -- 'is' t_list, -- 'list' t_memory, -- 'memory' t_mode, -- 'mode' t_modes, -- 'modes' t_none, -- 'none' t_not, -- 'not' t_of, -- 'of' t_or, -- 'or' t_out, -- 'out' t_package, -- 'package' t_parameter, -- 'parameter' t_path, -- 'path' t_port, -- 'port' t_private, -- 'private' t_process, -- 'process' t_processor, -- 'processor' t_properties, -- 'properties' t_property, -- 'property' t_provides, -- 'provides' t_public, -- 'public' t_range, -- 'range' t_reference, -- 'reference' t_refined, -- 'refined' t_refines, -- 'refines' t_requires, -- 'requires' t_server, -- 'server' t_set, -- 'set' t_sink, -- 'sink' t_source, -- 'source' t_subcomponents, -- 'subcomponents' t_subprogram, -- 'subprogram' t_system, -- 'system' t_thread, -- 'thread' t_to, -- 'to' t_type, -- 'type' t_units, -- 'units' t_value, -- 'value' -- Numeric Literals t_real_literal, -- real number t_integer_literal, -- integer number -- Others t_string_literal, -- string t_comment, -- comment (ignored) t_raw_text, -- raw text (used for annex parsing / --printing) t_eof -- end of file ); first_token_pos : constant := token_type'pos (token_type'first); last_token_pos : constant := token_type'pos (token_type'last); type token_list_type is array (Positive range <>) of token_type; -- Sybtype definitions subtype binary_operator_type is token_type range t_plus .. t_divide; subtype boolean_type is token_type range t_false .. t_true; subtype opening_delimiter is token_type range t_left_parenthesis .. t_begin_annex; subtype closing_delimiter is token_type range t_right_parenthesis .. t_end_annex; subtype delimiter_type is token_type range t_comma .. t_end_annex; subtype numeric_type is token_type range t_real_literal .. t_integer_literal; subtype reserved_word_type is token_type range t_aadlboolean .. t_value; first_reserved_word_pos : constant := reserved_word_type'pos (reserved_word_type'first); last_reserved_word_pos : constant := reserved_word_type'pos (reserved_word_type'last); Max_Number_Of_Digits : constant Integer := 20; -- Number of digits of the biggest allowed integer, 2**64 have 20 -- digits Integer_Literal_Value : unsigned_long_long; -- for Tokens : T_Integer_Literal Float_Literal_Value : Long_Long_Float; -- for Tokens : T_Real_Literal Numeric_Literal_Base : unsigned_short_short; -- for Tokens : T_Integer_Literal, T_Real_Literal Numeric_Literal_Exp : Integer; -- for Tokens : T_Integer_Literal, T_Real_Literal function Image (T : token_type) return String; -- Return an image of token T procedure Init_Tokens; -- Set all the token strings into the name table. function Quoted_Image (T : token_type) return String; -- Return the quoted image of token T end Ocarina.AADL.Tokens;