aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sinput-l.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2007-06-06 12:47:30 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-06-06 12:47:30 +0200
commit0600d9bc835c519013e43a91d434284b7dc868e5 (patch)
treed398210e4f92106bb31f0bcbe95e1f72c3e41539 /gcc/ada/sinput-l.adb
parentff6821917192a0e459c2b050723a2a66d4b2cb8f (diff)
downloadgcc-0600d9bc835c519013e43a91d434284b7dc868e5.zip
gcc-0600d9bc835c519013e43a91d434284b7dc868e5.tar.gz
gcc-0600d9bc835c519013e43a91d434284b7dc868e5.tar.bz2
sinput-l.ads, [...]: implement a new pragma No_Body
2007-04-20 Robert Dewar <dewar@adacore.com> * sinput-l.ads, sinput-l.adb: implement a new pragma No_Body From-SVN: r125462
Diffstat (limited to 'gcc/ada/sinput-l.adb')
-rw-r--r--gcc/ada/sinput-l.adb35
1 files changed, 33 insertions, 2 deletions
diff --git a/gcc/ada/sinput-l.adb b/gcc/ada/sinput-l.adb
index b1062b7..03706f1 100644
--- a/gcc/ada/sinput-l.adb
+++ b/gcc/ada/sinput-l.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -29,7 +29,6 @@ with Atree; use Atree;
with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
-with Namet; use Namet;
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
@@ -38,6 +37,7 @@ with Prepcomp; use Prepcomp;
with Scans; use Scans;
with Scn; use Scn;
with Sinfo; use Sinfo;
+with Snames; use Snames;
with System; use System;
with Unchecked_Conversion;
@@ -641,6 +641,37 @@ package body Sinput.L is
Prep_Buffer (Prep_Buffer_Last) := C;
end Put_Char_In_Prep_Buffer;
+ -----------------------------------
+ -- Source_File_Is_Pragma_No_Body --
+ -----------------------------------
+
+ function Source_File_Is_No_Body (X : Source_File_Index) return Boolean is
+ begin
+ Initialize_Scanner (No_Unit, X);
+
+ if Token /= Tok_Pragma then
+ return False;
+ end if;
+
+ Scan; -- past pragma
+
+ if Token /= Tok_Identifier
+ or else Chars (Token_Node) /= Name_No_Body
+ then
+ return False;
+ end if;
+
+ Scan; -- past No_Body
+
+ if Token /= Tok_Semicolon then
+ return False;
+ end if;
+
+ Scan; -- past semicolon
+
+ return Token = Tok_EOF;
+ end Source_File_Is_No_Body;
+
----------------------------
-- Source_File_Is_Subunit --
----------------------------