diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-11-21 01:22:45 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-30 08:41:55 +0100 |
commit | f38e8d2677cb5a93a3ad4c0e818e31b0063abf15 (patch) | |
tree | 149b8d181a8e73332f805eb3b0460426fbbf39e2 /src/vhdl/ieee.adb | |
parent | cf17632924e55d4a9357942d8dac828c1e93b41c (diff) | |
download | ghdl-f38e8d2677cb5a93a3ad4c0e818e31b0063abf15.tar.gz ghdl-f38e8d2677cb5a93a3ad4c0e818e31b0063abf15.tar.bz2 ghdl-f38e8d2677cb5a93a3ad4c0e818e31b0063abf15.zip |
ieee: recognize ieee.numeric_std.
Diffstat (limited to 'src/vhdl/ieee.adb')
-rw-r--r-- | src/vhdl/ieee.adb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/vhdl/ieee.adb b/src/vhdl/ieee.adb new file mode 100644 index 000000000..d730bf388 --- /dev/null +++ b/src/vhdl/ieee.adb @@ -0,0 +1,50 @@ +-- Nodes recognizer for ieee packages - utilities. +-- Copyright (C) 2016 Tristan Gingold +-- +-- GHDL is free software; you can redistribute it and/or modify it under +-- the terms of the GNU General Public License as published by the Free +-- Software Foundation; either version 2, or (at your option) any later +-- version. +-- +-- GHDL 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 +-- along with GHDL; see the file COPYING. If not, write to the Free +-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA +-- 02111-1307, USA. + +with Iirs_Utils; use Iirs_Utils; +with Std_Package; + +package body Ieee is + function Skip_Copyright_Notice (Decl : Iir) return Iir + is + begin + if Decl /= Null_Iir + and then Get_Kind (Decl) = Iir_Kind_Constant_Declaration + and then (Get_Base_Type (Get_Type (Decl)) + = Std_Package.String_Type_Definition) + then + return Get_Chain (Decl); + else + return Decl; + end if; + end Skip_Copyright_Notice; + + function Skip_Implicit (Decl : Iir) return Iir + is + Res : Iir; + begin + Res := Decl; + loop + exit when Res = Null_Iir; + exit when not (Get_Kind (Res) = Iir_Kind_Function_Declaration + and then Is_Implicit_Subprogram (Res)); + Res := Get_Chain (Res); + end loop; + return Res; + end Skip_Implicit; +end Ieee; |