summaryrefslogtreecommitdiff
path: root/gcc/ada/g-regpat.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-23 11:57:52 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-23 11:57:52 +0000
commitb743d2fec7f114a7ad9f774f53d9790ce38b30c1 (patch)
treebdb15adb9e94a854c31457fc6b697589530ef086 /gcc/ada/g-regpat.adb
parentfabb7dc5d9930bb83dc7372080383b31544caf1d (diff)
downloadgcc-b743d2fec7f114a7ad9f774f53d9790ce38b30c1.tar.gz
PR ada/11978:
* exp_ch13.adb (Expand_N_Freeze_Entity): Do not consider inherited External_Tag attribute definition clauses. PR ada/7613: * exp_dbug.adb (Debug_Renaming_Declaration): For the renaming of a child unit, generate a fully qualified name to avoid spurious errors when the context contains renamings of different child units with the same simple name. * exp_dbug.ads: Add documentation on name qualification for renamings of child units. * g-regpat.ads, g-regpat.adb: Minor reformatting * Makefile.in: Use the file 1atags.ads with the ZFP and cert run-times. * trans.c: (tree_transform, case N_Real_Literal): Add extra arg to Machine call. * urealp.h: (Machine): Update to proper definition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72843 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-regpat.adb')
-rw-r--r--gcc/ada/g-regpat.adb87
1 files changed, 38 insertions, 49 deletions
diff --git a/gcc/ada/g-regpat.adb b/gcc/ada/g-regpat.adb
index 20001bc4fc8..35df55d70bd 100644
--- a/gcc/ada/g-regpat.adb
+++ b/gcc/ada/g-regpat.adb
@@ -237,8 +237,7 @@ package body GNAT.Regpat is
function Get_From_Class
(Bitmap : Character_Class;
- C : Character)
- return Boolean;
+ C : Character) return Boolean;
-- Return True if the entry is set for C in the class Bitmap.
procedure Reset_Class (Bitmap : out Character_Class);
@@ -268,8 +267,7 @@ package body GNAT.Regpat is
function String_Length
(Program : Program_Data;
- P : Pointer)
- return Program_Size;
+ P : Pointer) return Program_Size;
-- Return the length of the string argument of the node at P
function String_Operand (P : Pointer) return Pointer;
@@ -283,14 +281,12 @@ package body GNAT.Regpat is
function Get_Next_Offset
(Program : Program_Data;
- IP : Pointer)
- return Pointer;
+ IP : Pointer) return Pointer;
-- Get the offset field of a node. Used by Get_Next.
function Get_Next
(Program : Program_Data;
- IP : Pointer)
- return Pointer;
+ IP : Pointer) return Pointer;
-- Dig the next instruction pointer out of a node
procedure Optimize (Self : in out Pattern_Matcher);
@@ -298,8 +294,7 @@ package body GNAT.Regpat is
function Read_Natural
(Program : Program_Data;
- IP : Pointer)
- return Natural;
+ IP : Pointer) return Natural;
-- Return the 2-byte natural coded at position IP.
-- All of the subprograms above are tiny and should be inlined
@@ -2052,8 +2047,7 @@ package body GNAT.Regpat is
function Compile
(Expression : String;
- Flags : Regexp_Flags := No_Flags)
- return Pattern_Matcher
+ Flags : Regexp_Flags := No_Flags) return Pattern_Matcher
is
Size : Program_Size;
Dummy : Pattern_Matcher (0);
@@ -2296,8 +2290,7 @@ package body GNAT.Regpat is
function Get_From_Class
(Bitmap : Character_Class;
- C : Character)
- return Boolean
+ C : Character) return Boolean
is
Value : constant Class_Byte := Character'Pos (C);
@@ -2327,8 +2320,7 @@ package body GNAT.Regpat is
function Get_Next_Offset
(Program : Program_Data;
- IP : Pointer)
- return Pointer
+ IP : Pointer) return Pointer
is
begin
return Pointer (Read_Natural (Program, IP + 1));
@@ -2432,9 +2424,8 @@ package body GNAT.Regpat is
-- Find character C in Data starting at Start and return position
function Repeat
- (IP : Pointer;
- Max : Natural := Natural'Last)
- return Natural;
+ (IP : Pointer;
+ Max : Natural := Natural'Last) return Natural;
-- Repeatedly match something simple, report how many
-- It only matches on things of length 1.
-- Starting from Input_Pos, it matches at most Max CURLY.
@@ -2468,8 +2459,7 @@ package body GNAT.Regpat is
(Op : Opcode;
Scan : Pointer;
Next : Pointer;
- Greedy : Boolean)
- return Boolean;
+ Greedy : Boolean) return Boolean;
-- Return True it the simple operator (possibly non-greedy) matches
pragma Inline (Index);
@@ -2484,11 +2474,7 @@ package body GNAT.Regpat is
-- Index --
-----------
- function Index
- (Start : Positive;
- C : Character)
- return Natural
- is
+ function Index (Start : Positive; C : Character) return Natural is
begin
for J in Start .. Last_In_Data loop
if Data (J) = C then
@@ -2529,7 +2515,7 @@ package body GNAT.Regpat is
-- Match --
-----------
- function Match (IP : Pointer) return Boolean is
+ function Match (IP : Pointer) return Boolean is
Scan : Pointer := IP;
Next : Pointer;
Op : Opcode;
@@ -2835,8 +2821,7 @@ package body GNAT.Regpat is
(Op : Opcode;
Scan : Pointer;
Next : Pointer;
- Greedy : Boolean)
- return Boolean
+ Greedy : Boolean) return Boolean
is
Next_Char : Character := ASCII.Nul;
Next_Char_Known : Boolean := False;
@@ -3137,9 +3122,8 @@ package body GNAT.Regpat is
------------
function Repeat
- (IP : Pointer;
- Max : Natural := Natural'Last)
- return Natural
+ (IP : Pointer;
+ Max : Natural := Natural'Last) return Natural
is
Scan : Natural := Input_Pos;
Last : Natural;
@@ -3384,12 +3368,15 @@ package body GNAT.Regpat is
return;
end Match;
- function Match
- (Self : Pattern_Matcher;
- Data : String;
+ -----------
+ -- Match --
+ -----------
+
+ function Match
+ (Self : Pattern_Matcher;
+ Data : String;
Data_First : Integer := -1;
- Data_Last : Positive := Positive'Last)
- return Natural
+ Data_Last : Positive := Positive'Last) return Natural
is
Matches : Match_Array (0 .. 0);
@@ -3402,12 +3389,11 @@ package body GNAT.Regpat is
end if;
end Match;
- function Match
+ function Match
(Self : Pattern_Matcher;
Data : String;
Data_First : Integer := -1;
- Data_Last : Positive := Positive'Last)
- return Boolean
+ Data_Last : Positive := Positive'Last) return Boolean
is
Matches : Match_Array (0 .. 0);
@@ -3436,13 +3422,16 @@ package body GNAT.Regpat is
end if;
end Match;
+ -----------
+ -- Match --
+ -----------
+
function Match
(Expression : String;
Data : String;
Size : Program_Size := 0;
Data_First : Integer := -1;
- Data_Last : Positive := Positive'Last)
- return Natural
+ Data_Last : Positive := Positive'Last) return Natural
is
PM : Pattern_Matcher (Size);
Final_Size : Program_Size; -- unused
@@ -3456,13 +3445,16 @@ package body GNAT.Regpat is
end if;
end Match;
+ -----------
+ -- Match --
+ -----------
+
function Match
(Expression : String;
Data : String;
Size : Program_Size := 0;
Data_First : Integer := -1;
- Data_Last : Positive := Positive'Last)
- return Boolean
+ Data_Last : Positive := Positive'Last) return Boolean
is
Matches : Match_Array (0 .. 0);
PM : Pattern_Matcher (Size);
@@ -3592,8 +3584,7 @@ package body GNAT.Regpat is
function Read_Natural
(Program : Program_Data;
- IP : Pointer)
- return Natural
+ IP : Pointer) return Natural
is
begin
return Character'Pos (Program (IP)) +
@@ -3618,7 +3609,6 @@ package body GNAT.Regpat is
C : Character)
is
Value : constant Class_Byte := Character'Pos (C);
-
begin
Bitmap (Value / 8) := Bitmap (Value / 8)
or Bit_Conversion (Value mod 8);
@@ -3630,8 +3620,7 @@ package body GNAT.Regpat is
function String_Length
(Program : Program_Data;
- P : Pointer)
- return Program_Size
+ P : Pointer) return Program_Size
is
begin
pragma Assert (Program (P) = EXACT or else Program (P) = EXACTF);