-- Applies to all entities. True for task types and subtypes
-- Is_Thunk (Flag225)
--- Applies to all entities. True for subprograms that are thunks: that is
+-- Defined in all entities. True for subprograms that are thunks: that is
-- small subprograms built by the expander for tagged types that cover
-- interface types. As part of the runtime call to an interface, thunks
-- displace the pointer to the object (pointer named "this" in the C++
-- non-synthesized attributes, of the corresponding set procedures) are
-- in the Einfo body.
- -- The following attributes apply to all entities
+ -- The following attributes are defined in all entities
-- Ekind (Ekind)
-- Is_Shared_Passive (Flag60)
-- Is_Statically_Allocated (Flag28)
-- Is_Tagged_Type (Flag55)
+ -- Is_Thunk (Flag225)
-- Is_Trivial_Subprogram (Flag235)
-- Is_Unchecked_Union (Flag117)
-- Is_Visible_Formal (Flag206)
-- Is_Private_Descendant (Flag53)
-- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
- -- Is_Thunk (Flag225)
-- Is_Visible_Lib_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
-- Requires_Overriding (Flag213) (non-generic case only)
-- Is_Pure (Flag44)
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Primitive (Flag218)
- -- Is_Thunk (Flag225)
-- Default_Expressions_Processed (Flag108)
-- Aren't there more flags and fields? seems like this list should be
-- more similar to the E_Function list, which is much longer ???
-- Is_Private_Descendant (Flag53)
-- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
- -- Is_Thunk (Flag225)
-- Is_Valued_Procedure (Flag127)
-- Is_Visible_Lib_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
Target : Target_Type;
-- The Target variable is initialized using the command line
- Valid_Characters : constant Character_Set :=
- To_Set (Span => (' ', '~'));
+ Valid_Characters : constant Character_Set := To_Set (Span => (' ', '~'));
-- This array controls which characters are permitted in the input
-- file (after line breaks have been removed). Valid characters
-- are all printable ASCII characters and the space character.
Word_Characters : constant Character_Set :=
(To_Set (Ranges =>
(('0', '9'), ('a', 'z'), ('A', 'Z')))
- or To_Set ("?-_~"));
+ or To_Set ("?-_~"));
-- The characters which are permitted in words. Other (valid)
-- characters are assumed to be delimiters between words. Note that
-- this set has to include all characters of the source words of the
Trim (Line (1 .. Split - 1), Both);
Target : constant String :=
Trim (Line (Split + 1 .. Line'Last), Both);
- Two_Spaces : constant Natural :=
- Index (Source, " ");
+
+ Two_Spaces : constant Natural := Index (Source, " ");
+
Non_Word_Character : constant Natural :=
Index (Source,
Word_Characters or
declare
Prefix : String renames
Source (Source'First .. J - 1);
-
begin
if not Is_Known_Word (Prefix) then
Error (Dictionary_File,
(VMS_Second_Character + 1, VMS_Third_Character - 1));
return;
end;
- end if; -- VMS_Alternative
+ end if;
-- The Word case. Search for characters not in Word_Characters.
-- We have found a word if the first non-word character is not
procedure Rewrite_Word is
First_Word : String
- renames Line (Token.Span.First .. Token.Span.Last);
+ renames Line (Token.Span.First .. Token.Span.Last);
begin
-- We do not perform any error checking below, so we can just skip
-- longest possible sequence we can rewrite.
declare
- Seq : Token_Span := Token.Span;
+ Seq : Token_Span := Token.Span;
Lost_Space : Boolean := False;
begin
and then Line (Token.Span.First .. Token.Span.Last) = " "
then
Next_Token;
+
if Token.Kind /= Word
or else not Is_Known_Word (Line (Seq.First
.. Token.Span.Last))
then
- -- When we reach this point, the following
- -- conditions are true:
- --
- -- Seq is a known word.
- -- The previous token was a space character.
- -- Seq extended to the current token is not a
- -- known word.
+ -- When we reach this point, the following conditions
+ -- are true:
+
+ -- Seq is a known word
+
+ -- The previous token was a space character
+
+ -- Seq extended to the current token is not a
+ -- known word.
Lost_Space := True;
exit;
else
-
-- Extend Seq to cover the current (known) word
Seq.Last := Token.Span.Last;
else
-- When we reach this point, the following conditions
-- are true:
- --
- -- Seq is a known word.
- -- The previous token was a word.
- -- The current token is not a space character.
+
+ -- Seq is a known word
+
+ -- The previous token was a word
+
+ -- The current token is not a space character.
exit;
end if;
Next_Token;
if Token.Kind = Word
- and then Is_Extension (Line (Token.Span.First
- .. Token.Span.Last))
+ and then
+ Is_Extension (Line (Token.Span.First .. Token.Span.Last))
then
-- We have discovered a file extension. Convert the file
-- name to upper case.
-- Rewrite_Word would have handled it.
Next_Token;
+
if Token.Kind = Word
and then Is_Extension (Line (Token.Span.First
.. Token.Span.Last))
else
Append (Rewritten_Line, '.');
end if;
+
else
Append (Rewritten_Line, Line (Token.Span.First
.. Token.Span.Last));
Append (Rewritten_Line, Line (Token.Non_VMS.First
.. Token.Non_VMS.Last));
end if;
+
Next_Token;
when VMS_Error =>
while not End_Of_File (Source_File.Data) loop
declare
Line : constant String := Get_Line (Source_File'Access);
+
Rewritten : constant String := Rewrite_Source_Line (Line);
-- We unconditionally rewrite the line so that we can check the
-- syntax of all lines, and not only those which are actually
procedure Initialize_Extensions is
procedure Add (Extension : String);
- -- Adds an extension which is replaced with itself (in upper
- -- case).
+ -- Adds an extension which is replaced with itself (in upper case)
procedure Add (Extension, Replacement : String);
-- Adds an extension with a custom replacement